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 &, OUString, ScDocument *, const ScRange &, bool bAll, OUString aStreamPath, std::u16string_view aFilterOptions)
 
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 &, std::string_view rImgOptions, XOutFlags nXOutFlags=XOutFlags::NONE)
 
bool WriteFieldText (const EditTextObject *pData)
 
void CopyLocalFileToINet (OUString &rFileNm, std::u16string_view 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
 
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 99 of file htmlexp.hxx.

Member Typedef Documentation

◆ FileNameMapPtr

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

Definition at line 109 of file htmlexp.hxx.

◆ GraphEntryList

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

Definition at line 110 of file htmlexp.hxx.

Constructor & Destructor Documentation

◆ ScHTMLExport()

ScHTMLExport::ScHTMLExport ( SvStream rStrmP,
OUString  _aBaseURL,
ScDocument pDocP,
const ScRange rRangeP,
bool  bAll,
OUString  aStreamPath,
std::u16string_view  aFilterOptions 
)

◆ ~ScHTMLExport()

ScHTMLExport::~ScHTMLExport ( )
overridevirtual

Definition at line 249 of file htmlexp.cxx.

References aGraphList.

Member Function Documentation

◆ BorderToStyle()

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

Definition at line 534 of file htmlexp.cxx.

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

Referenced by WriteCell().

◆ CopyLocalFileToINet()

void ScHTMLExport::CopyLocalFileToINet ( OUString &  rFileNm,
std::u16string_view  rTargetNm 
)
private

◆ FillGraphList()

void ScHTMLExport::FillGraphList ( const SdrPage pPage,
SCTAB  nTab,
SCCOL  nStartCol,
SCROW  nStartRow,
SCCOL  nEndCol,
SCROW  nEndRow 
)
private

◆ GetFontSizeCss()

const char * ScHTMLExport::GetFontSizeCss ( sal_uInt16  nHeight)
staticprivate

Definition at line 268 of file htmlexp.cxx.

References GetFontSizeNumber(), and pFontSizeCss.

Referenced by WriteHeader().

◆ GetFontSizeNumber()

sal_uInt16 ScHTMLExport::GetFontSizeNumber ( sal_uInt16  nHeight)
staticprivate

Definition at line 254 of file htmlexp.cxx.

References nFontSize, and SC_HTML_FONTSIZES.

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

◆ GetIndentStr()

const char * ScHTMLExport::GetIndentStr ( ) const
inlineprivate

Definition at line 169 of file htmlexp.hxx.

References sIndent.

Referenced by WriteImage().

◆ GetNonConvertibleChars()

const OUString & ScHTMLExport::GetNonConvertibleChars ( ) const
inline

Definition at line 179 of file htmlexp.hxx.

References aNonConvertibleChars.

Referenced by ScFormatFilterPluginImpl::ScExportHTML().

◆ IncIndent()

void ScHTMLExport::IncIndent ( short  nVal)
private

Definition at line 1388 of file htmlexp.cxx.

References nIndent, nIndentMax, and sIndent.

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

◆ MMToPixel()

Size ScHTMLExport::MMToPixel ( const Size r100thMMSize)
private

Definition at line 286 of file htmlexp.cxx.

References Size::Height(), pAppWin, Size::setHeight(), Size::setWidth(), and Size::Width().

Referenced by FillGraphList().

◆ PageDefaults()

const SfxItemSet & ScHTMLExport::PageDefaults ( SCTAB  nTab)
private

◆ PrepareGraphics()

void ScHTMLExport::PrepareGraphics ( ScDrawLayer pDrawLayer,
SCTAB  nTab,
SCCOL  nStartCol,
SCROW  nStartRow,
SCCOL  nEndCol,
SCROW  nEndRow 
)
private

◆ ToPixel()

sal_uInt16 ScHTMLExport::ToPixel ( sal_uInt16  nTwips)
private

Definition at line 274 of file htmlexp.cxx.

References pAppWin.

Referenced by WriteCell(), and WriteTables().

◆ Write()

void ScHTMLExport::Write ( )

◆ WriteBody()

void ScHTMLExport::WriteBody ( )
private

◆ WriteCell()

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 885 of file htmlexp.cxx.

References ScHTMLStyle::aBackgroundColor, ScRange::aEnd, ScHTMLStyle::aFontFamilyName, aGraphList, aHTMLStyle, aNonConvertibleChars, ScHTMLGraphEntry::aRange, aStr, ATTR_BACKGROUND(), ATTR_BORDER(), ATTR_CONDITIONAL(), 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, BorderToStyle(), bTabHasGraphics, bTableDataHeight, CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_VALUE, ScAddress::Col(), COL_AUTO(), COL_BLACK(), HTMLOutFuncs::ConvertStringToHTML(), HTMLOutFuncs::CreateTableDataOptionsValNum(), Color::GetAlpha(), ScDocument::GetAttr(), SvxBoxItem::GetBottom(), ScMergeAttr::GetColMerge(), SvxBrushItem::GetColor(), ScColorScaleFormat::GetColor(), ScDocument::GetColWidth(), ScCondFormatItem::GetCondFormatData(), ScDocument::GetCondFormList(), ScDocument::GetCondResult(), ScRefCellValue::getDouble(), ScRefCellValue::getEditText(), ScConditionalFormat::GetEntry(), SvxFontItem::GetFamilyName(), GetFontSizeNumber(), ScConditionalFormatList::GetFormat(), ScRefCellValue::getFormula(), 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(), ScPostIt::GetText(), SvxBoxItem::GetTop(), ScRefCellValue::getType(), ScFormulaCell::GetURLResult(), ScFormulaCell::GetValue(), SvxColorItem::GetValue(), SvxWeightItem::GetWeight(), ScDocument::HasNote(), ScRefCellValue::hasNumeric(), i, ScRefCellValue::isEmpty(), ScFormulaCell::IsHyperLinkCell(), ScMergeAttr::IsMerged(), ScMergeFlagAttr::IsOverlapped(), ITALIC_NONE, lcl_makeHTMLColorTriplet(), LINESTYLE_NONE, mbSkipImages, 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(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), STRIKEOUT_SINGLE, TAG_OFF, TAG_OFF_LF, TAG_ON, ToPixel(), v, WEIGHT_BOLD, WriteFieldText(), and WriteGraphEntry().

Referenced by WriteTables().

◆ WriteFieldText()

bool ScHTMLExport::WriteFieldText ( const EditTextObject pData)
private

◆ WriteGraphEntry()

void ScHTMLExport::WriteGraphEntry ( ScHTMLGraphEntry pE)
private

◆ WriteHeader()

void ScHTMLExport::WriteHeader ( )
private

◆ WriteImage()

void ScHTMLExport::WriteImage ( OUString &  rLinkName,
const Graphic rGrf,
std::string_view  rImgOptions,
XOutFlags  nXOutFlags = XOutFlags::NONE 
)
private

◆ WriteOverview()

void ScHTMLExport::WriteOverview ( )
private

◆ WriteTables()

void ScHTMLExport::WriteTables ( )
private

Member Data Documentation

◆ aBaseURL

OUString ScHTMLExport::aBaseURL
private

Definition at line 114 of file htmlexp.hxx.

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

◆ aGraphList

GraphEntryList ScHTMLExport::aGraphList
private

Definition at line 112 of file htmlexp.hxx.

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

◆ aHTMLStyle

ScHTMLStyle ScHTMLExport::aHTMLStyle
private

Definition at line 113 of file htmlexp.hxx.

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

◆ aNonConvertibleChars

OUString ScHTMLExport::aNonConvertibleChars
private

Definition at line 118 of file htmlexp.hxx.

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

◆ aStreamPath

OUString ScHTMLExport::aStreamPath
private

Definition at line 115 of file htmlexp.hxx.

Referenced by WriteBody(), and WriteImage().

◆ bAll

bool ScHTMLExport::bAll
private

Definition at line 122 of file htmlexp.hxx.

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

◆ bCalcAsShown

bool ScHTMLExport::bCalcAsShown
private

Definition at line 125 of file htmlexp.hxx.

Referenced by WriteCell().

◆ bCopyLocalFileToINet

bool ScHTMLExport::bCopyLocalFileToINet
private

Definition at line 126 of file htmlexp.hxx.

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

◆ bTabAlignedLeft

bool ScHTMLExport::bTabAlignedLeft
private

Definition at line 124 of file htmlexp.hxx.

Referenced by PrepareGraphics(), and WriteTables().

◆ bTabHasGraphics

bool ScHTMLExport::bTabHasGraphics
private

Definition at line 123 of file htmlexp.hxx.

Referenced by PrepareGraphics(), WriteCell(), and WriteTables().

◆ bTableDataHeight

bool ScHTMLExport::bTableDataHeight
private

Definition at line 127 of file htmlexp.hxx.

Referenced by WriteCell(), and WriteTables().

◆ mbSkipHeaderFooter

bool ScHTMLExport::mbSkipHeaderFooter
private

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

Definition at line 130 of file htmlexp.hxx.

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

◆ mbSkipImages

bool ScHTMLExport::mbSkipImages
private

Definition at line 128 of file htmlexp.hxx.

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

◆ nCellSpacing

const sal_uInt16 ScHTMLExport::nCellSpacing = 0
staticprivate

Definition at line 106 of file htmlexp.hxx.

Referenced by FillGraphList(), and WriteTables().

◆ nDefaultFontSize

const sal_uInt16 ScHTMLExport::nDefaultFontSize
staticprivate
Initial value:
=
{
}
#define HTMLFONTSZ4_DFLT
#define HTMLFONTSZ3_DFLT
#define HTMLFONTSZ5_DFLT
#define HTMLFONTSZ6_DFLT
#define HTMLFONTSZ2_DFLT
#define HTMLFONTSZ1_DFLT
#define HTMLFONTSZ7_DFLT

Definition at line 102 of file htmlexp.hxx.

Referenced by ScHTMLExport().

◆ nFontSize

sal_uInt16 ScHTMLExport::nFontSize = { 0 }
staticprivate

Definition at line 104 of file htmlexp.hxx.

Referenced by GetFontSizeNumber(), and ScHTMLExport().

◆ nIndent

short ScHTMLExport::nIndent
private

Definition at line 120 of file htmlexp.hxx.

Referenced by IncIndent().

◆ nUsedTables

SCTAB ScHTMLExport::nUsedTables
private

Definition at line 119 of file htmlexp.hxx.

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

◆ pAppWin

VclPtr<OutputDevice> ScHTMLExport::pAppWin
private

Definition at line 116 of file htmlexp.hxx.

Referenced by MMToPixel(), and ToPixel().

◆ pFileNameMap

FileNameMapPtr ScHTMLExport::pFileNameMap
private

Definition at line 117 of file htmlexp.hxx.

Referenced by CopyLocalFileToINet().

◆ pFontSizeCss

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

Definition at line 105 of file htmlexp.hxx.

Referenced by GetFontSizeCss().

◆ sIndent

char ScHTMLExport::sIndent[nIndentMax+1]
private

Definition at line 121 of file htmlexp.hxx.

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

◆ sIndentSource

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 107 of file htmlexp.hxx.

Referenced by ScHTMLExport().


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