LibreOffice Module sc (master)  1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ScHTMLExport Class Reference

#include <htmlexp.hxx>

Inheritance diagram for ScHTMLExport:
[legend]
Collaboration diagram for ScHTMLExport:
[legend]

Public Member Functions

 ScHTMLExport (SvStream &, const OUString &, ScDocument *, const ScRange &, bool bAll, const OUString &aStreamPath, const OUString &rFilterOptions)
 
virtual ~ScHTMLExport () override
 
void Write ()
 
const OUString & GetNonConvertibleChars () const
 
- Public Member Functions inherited from ScExportBase
 ScExportBase (SvStream &, ScDocument *, const ScRange &)
 
virtual ~ScExportBase ()
 
bool TrimDataArea (SCTAB nTab, SCCOL &nStartCol, SCROW &nStartRow, SCCOL &nEndCol, SCROW &nEndRow) const
 
bool GetDataArea (SCTAB nTab, SCCOL &nStartCol, SCROW &nStartRow, SCCOL &nEndCol, SCROW &nEndRow) const
 
bool IsEmptyTable (SCTAB nTab) const
 
ScFieldEditEngineGetEditEngine () const
 

Private Types

typedef std::unique_ptr< std::map< OUString, OUString > > FileNameMapPtr
 
typedef std::vector< ScHTMLGraphEntryGraphEntryList
 

Private Member Functions

const SfxItemSetPageDefaults (SCTAB nTab)
 
void WriteBody ()
 
void WriteHeader ()
 
void WriteOverview ()
 
void WriteTables ()
 
void WriteCell (sc::ColumnBlockPosition &rBlockPos, SCCOL nCol, SCROW nRow, SCTAB nTab)
 
void WriteGraphEntry (ScHTMLGraphEntry *)
 
void WriteImage (OUString &rLinkName, const Graphic &, const OString &rImgOptions, XOutFlags nXOutFlags=XOutFlags::NONE)
 
bool WriteFieldText (const EditTextObject *pData)
 
void CopyLocalFileToINet (OUString &rFileNm, const OUString &rTargetNm)
 
void PrepareGraphics (ScDrawLayer *, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
 
void FillGraphList (const SdrPage *, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
 
sal_uInt16 ToPixel (sal_uInt16 nTwips)
 
Size MMToPixel (const Size &r100thMMSize)
 
void IncIndent (short nVal)
 
const char * GetIndentStr () const
 

Static Private Member Functions

static OString BorderToStyle (const char *pBorderName, const editeng::SvxBorderLine *pLine, bool &bInsertSemicolon)
 
static sal_uInt16 GetFontSizeNumber (sal_uInt16 nHeight)
 
static const char * GetFontSizeCss (sal_uInt16 nHeight)
 

Private Attributes

GraphEntryList aGraphList
 
ScHTMLStyle aHTMLStyle
 
OUString aBaseURL
 
OUString aStreamPath
 
VclPtr< OutputDevicepAppWin
 
FileNameMapPtr pFileNameMap
 
OUString aNonConvertibleChars
 
rtl_TextEncoding eDestEnc
 
SCTAB nUsedTables
 
short nIndent
 
char sIndent [nIndentMax+1]
 
bool bAll
 
bool bTabHasGraphics
 
bool bTabAlignedLeft
 
bool bCalcAsShown
 
bool bCopyLocalFileToINet
 
bool bTableDataHeight
 
bool mbSkipImages
 
bool mbSkipHeaderFooter
 If HTML header and footer should be written as well, or just the content itself. More...
 

Static Private Attributes

static const sal_uInt16 nDefaultFontSize [SC_HTML_FONTSIZES]
 
static sal_uInt16 nFontSize [SC_HTML_FONTSIZES] = { 0 }
 
static const char * pFontSizeCss [SC_HTML_FONTSIZES]
 
static const sal_uInt16 nCellSpacing = 0
 
static const char sIndentSource []
 

Additional Inherited Members

- Protected Attributes inherited from ScExportBase
SvStreamrStrm
 
ScRange aRange
 
ScDocumentpDoc
 
SvNumberFormatterpFormatter
 
std::unique_ptr< ScFieldEditEnginepEditEngine
 

Detailed Description

Definition at line 100 of file htmlexp.hxx.

Member Typedef Documentation

typedef std::unique_ptr<std::map<OUString, OUString> > ScHTMLExport::FileNameMapPtr
private

Definition at line 110 of file htmlexp.hxx.

typedef std::vector<ScHTMLGraphEntry> ScHTMLExport::GraphEntryList
private

Definition at line 111 of file htmlexp.hxx.

Constructor & Destructor Documentation

ScHTMLExport::ScHTMLExport ( SvStream rStrmP,
const OUString &  rBaseURL,
ScDocument pDocP,
const ScRange rRangeP,
bool  bAll,
const OUString &  aStreamPath,
const OUString &  rFilterOptions 
)
ScHTMLExport::~ScHTMLExport ( )
overridevirtual

Definition at line 242 of file htmlexp.cxx.

References aGraphList.

Member Function Documentation

OString ScHTMLExport::BorderToStyle ( const char *  pBorderName,
const editeng::SvxBorderLine pLine,
bool &  bInsertSemicolon 
)
staticprivate

Definition at line 477 of file htmlexp.cxx.

References TWIPS_PER_PIXEL.

Referenced by WriteCell().

void ScHTMLExport::CopyLocalFileToINet ( OUString &  rFileNm,
const OUString &  rTargetNm 
)
private
void ScHTMLExport::FillGraphList ( const SdrPage pPage,
SCTAB  nTab,
SCCOL  nStartCol,
SCROW  nStartRow,
SCCOL  nEndCol,
SCROW  nEndRow 
)
private
const char * ScHTMLExport::GetFontSizeCss ( sal_uInt16  nHeight)
staticprivate

Definition at line 261 of file htmlexp.cxx.

References GetFontSizeNumber(), and pFontSizeCss.

Referenced by WriteHeader().

sal_uInt16 ScHTMLExport::GetFontSizeNumber ( sal_uInt16  nHeight)
staticprivate

Definition at line 247 of file htmlexp.cxx.

References nFontSize, and SC_HTML_FONTSIZES.

Referenced by GetFontSizeCss(), PageDefaults(), and WriteCell().

const char* ScHTMLExport::GetIndentStr ( ) const
inlineprivate

Definition at line 171 of file htmlexp.hxx.

References sIndent.

const OUString& ScHTMLExport::GetNonConvertibleChars ( ) const
inline

Definition at line 181 of file htmlexp.hxx.

References aNonConvertibleChars.

Referenced by ScFormatFilterPluginImpl::ScExportHTML().

void ScHTMLExport::IncIndent ( short  nVal)
private

Definition at line 1298 of file htmlexp.cxx.

References nIndent, nIndentMax, and sIndent.

Referenced by WriteHeader(), WriteOverview(), and WriteTables().

Size ScHTMLExport::MMToPixel ( const Size r100thMMSize)
private
const SfxItemSet & ScHTMLExport::PageDefaults ( SCTAB  nTab)
private
void ScHTMLExport::PrepareGraphics ( ScDrawLayer pDrawLayer,
SCTAB  nTab,
SCCOL  nStartCol,
SCROW  nStartRow,
SCCOL  nEndCol,
SCROW  nEndRow 
)
private

Definition at line 40 of file htmlexp2.cxx.

References ScHTMLGraphEntry::bInCell, SdrModel::GetPage(), ScDrawLayer::HasObjectsInRows(), i, and pE.

Referenced by WriteTables().

sal_uInt16 ScHTMLExport::ToPixel ( sal_uInt16  nTwips)
private

Definition at line 267 of file htmlexp.cxx.

References OutputDevice::LogicToPixel(), and pAppWin.

Referenced by WriteCell(), and WriteTables().

void ScHTMLExport::Write ( )
void ScHTMLExport::WriteBody ( )
private
void ScHTMLExport::WriteCell ( sc::ColumnBlockPosition rBlockPos,
SCCOL  nCol,
SCROW  nRow,
SCTAB  nTab 
)
private

TODO: we could entirely use CSS1 here instead, but that would exclude Netscape 3.0 and Netscape 4.x without JavaScript enabled. Do we want that?

Definition at line 829 of file htmlexp.cxx.

References ScHTMLStyle::aBackgroundColor, ScRange::aEnd, ScHTMLStyle::aFontFamilyName, aGraphList, aHTMLStyle, aNonConvertibleChars, ScHTMLGraphEntry::aRange, ScRange::aStart, aStr, ATTR_BACKGROUND(), ATTR_BORDER(), ATTR_FONT(), ATTR_FONT_COLOR(), ATTR_FONT_CROSSEDOUT(), ATTR_FONT_HEIGHT(), ATTR_FONT_POSTURE(), ATTR_FONT_UNDERLINE(), ATTR_FONT_WEIGHT(), ATTR_HOR_JUSTIFY(), ATTR_MERGE(), ATTR_MERGE_FLAG(), ATTR_VER_JUSTIFY(), bCalcAsShown, ScHTMLGraphEntry::bInCell, BorderToStyle(), bTabHasGraphics, bTableDataHeight, CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_VALUE, ScAddress::Col(), COL_AUTO(), COL_BLACK(), HTMLOutFuncs::ConvertStringToHTML(), HTMLOutFuncs::CreateTableDataOptionsValNum(), eDestEnc, ScDocument::GetAttr(), SvxBoxItem::GetBottom(), ScMergeAttr::GetColMerge(), SvxBrushItem::GetColor(), ScDocument::GetColWidth(), ScDocument::GetCondResult(), SvxFontItem::GetFamilyName(), GetFontSizeNumber(), SvxFontHeightItem::GetHeight(), ScPatternAttr::GetItem(), SvxBoxItem::GetLeft(), SvxTextLineItem::GetLineStyle(), ScDocument::GetNote(), ScPatternAttr::GetNumberFormat(), ScDocument::GetPattern(), SvxPostureItem::GetPosture(), SvxBoxItem::GetRight(), ScDocument::GetRowHeight(), ScMergeAttr::GetRowMerge(), ScGlobal::GetScriptedWhichID(), ScDocument::GetScriptType(), SvxCrossedOutItem::GetStrikeout(), ScCellFormat::GetString(), SvxBoxItem::GetTop(), Color::GetTransparency(), SvxColorItem::GetValue(), ScFormulaCell::GetValue(), SvxWeightItem::GetWeight(), ScDocument::HasNote(), ScRefCellValue::hasNumeric(), i, ScRange::In(), ScRefCellValue::isEmpty(), ScMergeAttr::IsMerged(), ScMergeFlagAttr::IsOverlapped(), ITALIC_NONE, lcl_makeHTMLColorTriplet(), LINESTYLE_NONE, mbSkipImages, ScRefCellValue::meType, ScRefCellValue::mfValue, ScRefCellValue::mpEditText, ScRefCellValue::mpFormula, ScHTMLStyle::nDefaultScriptType, ScHTMLStyle::nFontHeight, ScHTMLStyle::nFontSizeNumber, nPos, OOO_STRING_SVTOOLS_HTML_AL_center, OOO_STRING_SVTOOLS_HTML_AL_justify, OOO_STRING_SVTOOLS_HTML_AL_left, OOO_STRING_SVTOOLS_HTML_AL_right, OOO_STRING_SVTOOLS_HTML_anchor, OOO_STRING_SVTOOLS_HTML_bold, OOO_STRING_SVTOOLS_HTML_comment2, OOO_STRING_SVTOOLS_HTML_font, OOO_STRING_SVTOOLS_HTML_italic, OOO_STRING_SVTOOLS_HTML_linebreak, OOO_STRING_SVTOOLS_HTML_O_align, OOO_STRING_SVTOOLS_HTML_O_bgcolor, OOO_STRING_SVTOOLS_HTML_O_class, OOO_STRING_SVTOOLS_HTML_O_color, OOO_STRING_SVTOOLS_HTML_O_colspan, OOO_STRING_SVTOOLS_HTML_O_face, OOO_STRING_SVTOOLS_HTML_O_height, OOO_STRING_SVTOOLS_HTML_O_rowspan, OOO_STRING_SVTOOLS_HTML_O_size, OOO_STRING_SVTOOLS_HTML_O_valign, OOO_STRING_SVTOOLS_HTML_strikethrough, OOO_STRING_SVTOOLS_HTML_style, OOO_STRING_SVTOOLS_HTML_tabledata, OOO_STRING_SVTOOLS_HTML_underline, OOO_STRING_SVTOOLS_HTML_VA_bottom, OOO_STRING_SVTOOLS_HTML_VA_middle, OOO_STRING_SVTOOLS_HTML_VA_top, OUT_LF, OUT_STR, pChar, ScExportBase::pDoc, pE, ScExportBase::pFormatter, ScDocument::RoundValueAsShown(), ScAddress::Row(), STRIKEOUT_SINGLE, TAG_OFF, TAG_OFF_LF, TAG_ON, ToPixel(), v, WEIGHT_BOLD, WriteFieldText(), and WriteGraphEntry().

Referenced by WriteTables().

bool ScHTMLExport::WriteFieldText ( const EditTextObject pData)
private
void ScHTMLExport::WriteGraphEntry ( ScHTMLGraphEntry pE)
private
void ScHTMLExport::WriteHeader ( )
private
void ScHTMLExport::WriteImage ( OUString &  rLinkName,
const Graphic rGrf,
const OString &  rImgOptions,
XOutFlags  nXOutFlags = XOutFlags::NONE 
)
private
void ScHTMLExport::WriteOverview ( )
private
void ScHTMLExport::WriteTables ( )
private

Member Data Documentation

OUString ScHTMLExport::aBaseURL
private

Definition at line 115 of file htmlexp.hxx.

Referenced by WriteBody(), and WriteHeader().

GraphEntryList ScHTMLExport::aGraphList
private

Definition at line 113 of file htmlexp.hxx.

Referenced by WriteCell(), WriteTables(), and ~ScHTMLExport().

ScHTMLStyle ScHTMLExport::aHTMLStyle
private

Definition at line 114 of file htmlexp.hxx.

Referenced by PageDefaults(), WriteBody(), WriteCell(), and WriteHeader().

OUString ScHTMLExport::aNonConvertibleChars
private

Definition at line 119 of file htmlexp.hxx.

Referenced by GetNonConvertibleChars(), WriteCell(), and WriteHeader().

OUString ScHTMLExport::aStreamPath
private

Definition at line 116 of file htmlexp.hxx.

Referenced by WriteBody().

bool ScHTMLExport::bAll
private

Definition at line 124 of file htmlexp.hxx.

Referenced by WriteBody(), WriteHeader(), and WriteTables().

bool ScHTMLExport::bCalcAsShown
private

Definition at line 127 of file htmlexp.hxx.

Referenced by WriteCell().

bool ScHTMLExport::bCopyLocalFileToINet
private

Definition at line 128 of file htmlexp.hxx.

Referenced by ScHTMLExport(), and WriteBody().

bool ScHTMLExport::bTabAlignedLeft
private

Definition at line 126 of file htmlexp.hxx.

Referenced by WriteTables().

bool ScHTMLExport::bTabHasGraphics
private

Definition at line 125 of file htmlexp.hxx.

Referenced by WriteCell(), and WriteTables().

bool ScHTMLExport::bTableDataHeight
private

Definition at line 129 of file htmlexp.hxx.

Referenced by WriteCell(), and WriteTables().

rtl_TextEncoding ScHTMLExport::eDestEnc
private

Definition at line 120 of file htmlexp.hxx.

Referenced by ScHTMLExport(), WriteCell(), and WriteHeader().

bool ScHTMLExport::mbSkipHeaderFooter
private

If HTML header and footer should be written as well, or just the content itself.

Definition at line 132 of file htmlexp.hxx.

Referenced by ScHTMLExport(), Write(), and WriteBody().

bool ScHTMLExport::mbSkipImages
private

Definition at line 130 of file htmlexp.hxx.

Referenced by ScHTMLExport(), WriteBody(), WriteCell(), and WriteTables().

const sal_uInt16 ScHTMLExport::nCellSpacing = 0
staticprivate

Definition at line 107 of file htmlexp.hxx.

Referenced by WriteTables().

const sal_uInt16 ScHTMLExport::nDefaultFontSize
staticprivate
sal_uInt16 ScHTMLExport::nFontSize = { 0 }
staticprivate

Definition at line 105 of file htmlexp.hxx.

Referenced by GetFontSizeNumber(), and ScHTMLExport().

short ScHTMLExport::nIndent
private

Definition at line 122 of file htmlexp.hxx.

Referenced by IncIndent().

SCTAB ScHTMLExport::nUsedTables
private

Definition at line 121 of file htmlexp.hxx.

Referenced by ScHTMLExport(), WriteOverview(), and WriteTables().

VclPtr<OutputDevice> ScHTMLExport::pAppWin
private

Definition at line 117 of file htmlexp.hxx.

Referenced by MMToPixel(), and ToPixel().

FileNameMapPtr ScHTMLExport::pFileNameMap
private

Definition at line 118 of file htmlexp.hxx.

Referenced by CopyLocalFileToINet().

const char * ScHTMLExport::pFontSizeCss
staticprivate
Initial value:
=
{
"xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"
}

Definition at line 106 of file htmlexp.hxx.

Referenced by GetFontSizeCss().

char ScHTMLExport::sIndent[nIndentMax+1]
private

Definition at line 123 of file htmlexp.hxx.

Referenced by GetIndentStr(), IncIndent(), ScHTMLExport(), and WriteHeader().

const char ScHTMLExport::sIndentSource
staticprivate
Initial value:
=
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"

Definition at line 108 of file htmlexp.hxx.

Referenced by ScHTMLExport().


The documentation for this class was generated from the following files: