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:
Collaboration diagram for ScHTMLExport:

Public Member Functions

 ScHTMLExport (SvStream &, const OUString &, ScDocument *, const ScRange &, bool bAll, const OUString &aStreamPath, std::u16string_view 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
ScRange aRange
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

Definition at line 110 of file htmlexp.hxx.

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

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,
std::u16string_view  rFilterOptions 
ScHTMLExport::~ScHTMLExport ( )

Definition at line 247 of file htmlexp.cxx.

References aGraphList.

Member Function Documentation

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

Definition at line 482 of file htmlexp.cxx.

References o3tl::convert(), o3tl::px, and o3tl::twip.

Referenced by WriteCell().

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

Definition at line 266 of file htmlexp.cxx.

References GetFontSizeNumber(), and pFontSizeCss.

Referenced by WriteHeader().

sal_uInt16 ScHTMLExport::GetFontSizeNumber ( sal_uInt16  nHeight)

Definition at line 252 of file htmlexp.cxx.

References nFontSize, and SC_HTML_FONTSIZES.

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

const char* ScHTMLExport::GetIndentStr ( ) const

Definition at line 171 of file htmlexp.hxx.

References sIndent.

const OUString& ScHTMLExport::GetNonConvertibleChars ( ) const

Definition at line 181 of file htmlexp.hxx.

References aNonConvertibleChars.

Referenced by ScFormatFilterPluginImpl::ScExportHTML().

void ScHTMLExport::IncIndent ( short  nVal)

Definition at line 1325 of file htmlexp.cxx.

References nIndent, nIndentMax, and sIndent.

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

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

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)

Definition at line 272 of file htmlexp.cxx.

References OutputDevice::LogicToPixel(), and pAppWin.

Referenced by WriteCell(), and WriteTables().

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

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 834 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(), aURL, bCalcAsShown, ScHTMLGraphEntry::bInCell, BorderToStyle(), bTabHasGraphics, bTableDataHeight, CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_VALUE, ScAddress::Col(), COL_AUTO(), COL_BLACK, HTMLOutFuncs::ConvertStringToHTML(), HTMLOutFuncs::CreateTableDataOptionsValNum(), eDestEnc, Color::GetAlpha(), 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(), ScFormulaCell::GetURLResult(), SvxColorItem::GetValue(), ScFormulaCell::GetValue(), SvxWeightItem::GetWeight(), ScDocument::HasNote(), ScRefCellValue::hasNumeric(), i, ScRange::In(), ScRefCellValue::isEmpty(), ScFormulaCell::IsHyperLinkCell(), 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_href, 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)
void ScHTMLExport::WriteGraphEntry ( ScHTMLGraphEntry pE)
void ScHTMLExport::WriteHeader ( )
void ScHTMLExport::WriteImage ( OUString &  rLinkName,
const Graphic rGrf,
const OString &  rImgOptions,
XOutFlags  nXOutFlags = XOutFlags::NONE 
void ScHTMLExport::WriteOverview ( )
void ScHTMLExport::WriteTables ( )

Member Data Documentation

OUString ScHTMLExport::aBaseURL

Definition at line 115 of file htmlexp.hxx.

Referenced by WriteBody(), and WriteHeader().

GraphEntryList ScHTMLExport::aGraphList

Definition at line 113 of file htmlexp.hxx.

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

ScHTMLStyle ScHTMLExport::aHTMLStyle

Definition at line 114 of file htmlexp.hxx.

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

OUString ScHTMLExport::aNonConvertibleChars

Definition at line 119 of file htmlexp.hxx.

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

OUString ScHTMLExport::aStreamPath

Definition at line 116 of file htmlexp.hxx.

Referenced by WriteBody().

bool ScHTMLExport::bAll

Definition at line 124 of file htmlexp.hxx.

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

bool ScHTMLExport::bCalcAsShown

Definition at line 127 of file htmlexp.hxx.

Referenced by WriteCell().

bool ScHTMLExport::bCopyLocalFileToINet

Definition at line 128 of file htmlexp.hxx.

Referenced by ScHTMLExport(), and WriteBody().

bool ScHTMLExport::bTabAlignedLeft

Definition at line 126 of file htmlexp.hxx.

Referenced by WriteTables().

bool ScHTMLExport::bTabHasGraphics

Definition at line 125 of file htmlexp.hxx.

Referenced by WriteCell(), and WriteTables().

bool ScHTMLExport::bTableDataHeight

Definition at line 129 of file htmlexp.hxx.

Referenced by WriteCell(), and WriteTables().

rtl_TextEncoding ScHTMLExport::eDestEnc

Definition at line 120 of file htmlexp.hxx.

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

bool ScHTMLExport::mbSkipHeaderFooter

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

Definition at line 130 of file htmlexp.hxx.

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

const sal_uInt16 ScHTMLExport::nCellSpacing = 0

Definition at line 107 of file htmlexp.hxx.

Referenced by WriteTables().

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

Definition at line 105 of file htmlexp.hxx.

Referenced by GetFontSizeNumber(), and ScHTMLExport().

short ScHTMLExport::nIndent

Definition at line 122 of file htmlexp.hxx.

Referenced by IncIndent().

SCTAB ScHTMLExport::nUsedTables

Definition at line 121 of file htmlexp.hxx.

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

VclPtr<OutputDevice> ScHTMLExport::pAppWin

Definition at line 117 of file htmlexp.hxx.

Referenced by MMToPixel(), and ToPixel().

FileNameMapPtr ScHTMLExport::pFileNameMap

Definition at line 118 of file htmlexp.hxx.

Referenced by CopyLocalFileToINet().

const char * ScHTMLExport::pFontSizeCss
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]

Definition at line 123 of file htmlexp.hxx.

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

const char ScHTMLExport::sIndentSource
Initial value:

Definition at line 108 of file htmlexp.hxx.

Referenced by ScHTMLExport().

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