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

Stores all data of an Excel font and provides import of FONT records. More...

#include <xistyle.hxx>

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

Public Member Functions

 XclImpFont (const XclImpRoot &rRoot)
 
 XclImpFont (const XclImpRoot &rRoot, const XclFontData &rFontData)
 Constructs a font from font data. More...
 
void SetAllUsedFlags (bool bUsed)
 Sets all font attributes to used or unused. More...
 
void SetFontData (const XclFontData &rFontData, bool bHasCharSet)
 Sets the passed font data and all used flags to 'used'. More...
 
const XclFontDataGetFontData () const
 Returns read-only access to font data. More...
 
bool HasCharSet () const
 Returns true, if the font character set is valid. More...
 
bool HasEscapement () const
 Returns true, if the font contains superscript or subscript. More...
 
rtl_TextEncoding GetFontEncoding () const
 Returns the text encoding for strings used with this font. More...
 
bool HasAsianChars () const
 Returns true, if this font contains characters for Asian scripts (CJK). More...
 
void ReadFont (XclImpStream &rStrm)
 Reads a FONT record for all BIFF versions. More...
 
void ReadEfont (XclImpStream &rStrm)
 Reads an EFONT record (BIFF2 font color). More...
 
void ReadCFFontBlock (XclImpStream &rStrm)
 Reads the font block from a CF (conditional format) record. More...
 
void FillToItemSet (SfxItemSet &rItemSet, XclFontItemType eType, bool bSkipPoolDefs=false) const
 Fills all font properties to the item set. More...
 
void WriteFontProperties (ScfPropertySet &rPropSet, XclFontPropSetType eType, const Color *pFontColor=nullptr) const
 Writes all font properties to the passed property set. More...
 

Private Member Functions

void ReadFontData2 (XclImpStream &rStrm)
 Reads and sets height and flags. More...
 
void ReadFontData5 (XclImpStream &rStrm)
 Reads and sets height, flags, color, boldness, script, family and charset. More...
 
void ReadFontColor (XclImpStream &rStrm)
 Reads and sets the font color. More...
 
void ReadFontName2 (XclImpStream &rStrm)
 Reads and sets a byte string as font name. More...
 
void ReadFontName8 (XclImpStream &rStrm)
 Reads and sets a Unicode string as font name. More...
 
void GuessScriptType ()
 Tests whether the font contains CJK or CTL characters. More...
 

Private Attributes

XclFontData maData
 
bool mbHasCharSet
 All font attributes. More...
 
bool mbHasWstrn
 true = Font contains own character set info. More...
 
bool mbHasAsian
 true = Font contains Western script characters. More...
 
bool mbHasCmplx
 true = Font contains Asian script characters. More...
 
bool mbFontNameUsed
 true = Font contains Complex script characters. More...
 
bool mbHeightUsed
 true = Font name, family, charset used. More...
 
bool mbColorUsed
 true = Font height used. More...
 
bool mbWeightUsed
 true = Color used. More...
 
bool mbEscapemUsed
 true = Weight used. More...
 
bool mbUnderlUsed
 true = Escapement type used. More...
 
bool mbItalicUsed
 true = Underline style used. More...
 
bool mbStrikeUsed
 true = Italic used. More...
 
bool mbOutlineUsed
 true = Strikeout used. More...
 
bool mbShadowUsed
 true = Outlined used. More...
 

Additional Inherited Members

- Protected Member Functions inherited from XclImpRoot
 XclImpRoot (XclImpRootData &rImpRootData)
 
const XclImpRootGetRoot () const
 Returns this root instance - for code readability in derived classes. More...
 
XclImpRootGetRoot ()
 
void SetCodePage (sal_uInt16 nCodePage)
 Sets a code page read from a CODEPAGE record for byte string import. More...
 
void InitializeTable (SCTAB nScTab)
 Is called when import filter starts importing a single sheet (all BIFF versions). More...
 
void FinalizeTable ()
 Is called when import filter stops importing a single sheet (all BIFF versions). More...
 
XclImpAddressConverterGetAddressConverter () const
 Returns the address converter. More...
 
XclImpFormulaCompilerGetFormulaCompiler () const
 Returns the formula converter. More...
 
ExcelToScGetOldFmlaConverter () const
 Returns the old formula converter. More...
 
XclImpSstGetSst () const
 Returns the shared string table. More...
 
XclImpPaletteGetPalette () const
 Returns the color buffer. More...
 
XclImpFontBufferGetFontBuffer () const
 Returns the font buffer. More...
 
XclImpNumFmtBufferGetNumFmtBuffer () const
 Returns the number format buffer. More...
 
XclImpXFBufferGetXFBuffer () const
 Returns the cell formatting attributes buffer. More...
 
XclImpXFRangeBufferGetXFRangeBuffer () const
 Returns the buffer of XF index ranges for a sheet. More...
 
ScRangeListTabsGetPrintAreaBuffer () const
 Returns the buffer that contains all print areas in the document. More...
 
ScRangeListTabsGetTitleAreaBuffer () const
 Returns the buffer that contains all print titles in the document. More...
 
XclImpTabInfoGetTabInfo () const
 Returns the buffer that contains the sheet creation order. More...
 
XclImpNameManagerGetNameManager () const
 Returns the buffer that contains internal defined names. More...
 
XclImpLinkManagerGetLinkManager () const
 Returns the link manager. More...
 
XclImpObjectManagerGetObjectManager () const
 Returns the drawing object manager. More...
 
XclImpSheetDrawingGetCurrSheetDrawing () const
 Returns the drawing container of the current sheet. More...
 
XclImpCondFormatManagerGetCondFormatManager () const
 Returns the conditional formatting manager. More...
 
XclImpValidationManagerGetValidationManager () const
 
XclImpAutoFilterBufferGetFilterManager () const
 Returns the filter manager. More...
 
XclImpWebQueryBufferGetWebQueryBuffer () const
 Returns the web query buffer. More...
 
XclImpPivotTableManagerGetPivotTableManager () const
 Returns the pivot table manager. More...
 
XclImpSheetProtectBufferGetSheetProtectBuffer () const
 Returns the sheet protection options of the current sheet. More...
 
XclImpDocProtectBufferGetDocProtectBuffer () const
 Returns the document protection options. More...
 
XclImpPageSettingsGetPageSettings () const
 Returns the page settings of the current sheet. More...
 
XclImpDocViewSettingsGetDocViewSettings () const
 Returns the view settings of the entire document. More...
 
XclImpTabViewSettingsGetTabViewSettings () const
 Returns the view settings of the current sheet. More...
 
bool HasBasic () const
 Returns true, if the document contains a VB project. More...
 
void SetHasBasic ()
 Called to indicate that the document contains a VB project. More...
 
void ReadCodeName (XclImpStream &rStrm, bool bGlobals)
 Reads the CODENAME record and inserts the codename into the document. More...
 
ScDocumentImportGetDocImport ()
 
- Protected Member Functions inherited from XclRoot
 XclRoot (XclRootData &rRootData)
 
 XclRoot (const XclRoot &rRoot)
 
virtual ~XclRoot ()
 
XclRootoperator= (const XclRoot &rRoot)
 
RootDataGetOldRoot () const
 Returns old RootData struct. More...
 
XclBiff GetBiff () const
 Returns the current BIFF version of the importer/exporter. More...
 
XclOutput GetOutput () const
 Returns the current output format of the importer/exporter. More...
 
bool IsImport () const
 Returns true, if currently a document is imported. More...
 
rtl_TextEncoding GetTextEncoding () const
 Returns the text encoding to import/export byte strings. More...
 
LanguageType GetSysLanguage () const
 Returns the system language, i.e. More...
 
LanguageType GetDocLanguage () const
 Returns the document language. More...
 
LanguageType GetUILanguage () const
 Returns the UI language. More...
 
sal_Int16 GetDefApiScript () const
 Returns the default script type, e.g. More...
 
long GetCharWidth () const
 Returns the width of the '0' character (default font) for the current printer (twips). More...
 
bool IsInGlobals () const
 Returns the current Calc sheet index. More...
 
SCTAB GetCurrScTab () const
 Returns the current Calc sheet index. More...
 
sal_Int32 GetHmmFromPixelX (double fPixelX) const
 Calculates the width of the passed number of pixels in 1/100 mm. More...
 
sal_Int32 GetHmmFromPixelY (double fPixelY) const
 Calculates the height of the passed number of pixels in 1/100 mm. More...
 
SfxMediumGetMedium () const
 Returns the medium to import from. More...
 
const OUString & GetDocUrl () const
 Returns the document URL of the imported/exported file. More...
 
const OUString & GetBasePath () const
 Returns the base path of the imported/exported file. More...
 
const OUString & GetUserName () const
 Returns the current user name. More...
 
css::uno::Sequence< css::beans::NamedValue > RequestEncryptionData (::comphelper::IDocPasswordVerifier &rVerifier) const
 Requests and verifies a password from the medium or the user. More...
 
const tools::SvRef< SotStorage > & GetRootStorage () const
 Returns the OLE2 root storage of the imported/exported file. More...
 
bool HasVbaStorage () const
 Returns true, if the document contains a VBA storage. More...
 
tools::SvRef< SotStorageOpenStorage (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName) const
 Tries to open a storage as child of the specified storage for reading or writing. More...
 
tools::SvRef< SotStorageOpenStorage (const OUString &rStrgName) const
 Tries to open a storage as child of the root storage for reading or writing. More...
 
tools::SvRef< SotStorageStreamOpenStream (tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName) const
 Tries to open a new stream in the specified storage for reading or writing. More...
 
tools::SvRef< SotStorageStreamOpenStream (const OUString &rStrmName) const
 Tries to open a new stream in the root storage for reading or writing. More...
 
ScDocumentGetDoc () const
 Returns reference to the destination document (import) or source document (export). More...
 
SfxObjectShellGetDocShell () const
 Returns the object shell of the Calc document. More...
 
ScModelObjGetDocModelObj () const
 Returns the object model of the Calc document. More...
 
OutputDeviceGetPrinter () const
 Returns pointer to the printer of the Calc document. More...
 
ScStyleSheetPoolGetStyleSheetPool () const
 Returns the style sheet pool of the Calc document. More...
 
ScRangeNameGetNamedRanges () const
 Returns the defined names container of the Calc document. More...
 
SdrPageGetSdrPage (SCTAB nScTab) const
 Returns the drawing layer page of the passed sheet, if present. More...
 
SvNumberFormatterGetFormatter () const
 Returns the number formatter of the Calc document. More...
 
DateTime GetNullDate () const
 Returns the null date of the current number formatter. More...
 
sal_uInt16 GetBaseYear () const
 Returns the base year depending on the current null date (1900 or 1904). More...
 
double GetDoubleFromDateTime (const DateTime &rDateTime) const
 Converts a date/time value to a floating-point value. More...
 
DateTime GetDateTimeFromDouble (double fValue) const
 Converts a floating-point value to a date/time value. More...
 
ScEditEngineDefaulterGetEditEngine () const
 Returns the edit engine for import/export of rich strings etc. More...
 
ScHeaderEditEngineGetHFEditEngine () const
 Returns the edit engine for import/export of headers/footers. More...
 
EditEngineGetDrawEditEngine () const
 Returns the edit engine for import/export of drawing text boxes. More...
 
XclFontPropSetHelperGetFontPropSetHelper () const
 Returns the property set helper for fonts. More...
 
XclChPropSetHelperGetChartPropSetHelper () const
 Returns the property set helper for the chart filters. More...
 
ScExtDocOptionsGetExtDocOptions () const
 Returns the extended document options. More...
 
XclTracerGetTracer () const
 Returns the filter tracer. More...
 
const ScAddressGetScMaxPos () const
 Returns the highest possible cell address in a Calc document. More...
 
const ScAddressGetXclMaxPos () const
 Returns the highest possible cell address in an Excel document (using current BIFF version). More...
 
const ScAddressGetMaxPos () const
 Returns the highest possible cell address valid in Calc and Excel (using current BIFF version). More...
 
void SetDocLanguage (LanguageType eLang)
 Sets the document language. More...
 
void SetUILanguage (LanguageType eLang)
 Sets the UI language, i.e. More...
 
void SetTextEncoding (rtl_TextEncoding eTextEnc)
 Sets the text encoding to import/export byte strings. More...
 
void SetCharWidth (const XclFontData &rFontData)
 Sets the width of the '0' character (default font) for the current printer (twips). More...
 
void SetCurrScTab (SCTAB nScTab)
 Sets the current Calc sheet index. More...
 
void IncCurrScTab ()
 Increases the current Calc sheet index by 1. More...
 
- Static Protected Member Functions inherited from XclImpRoot
static OUString GetScAddInName (const OUString &rXclName)
 Returns the Calc add-in function name for an Excel function name. More...
 
- Static Protected Member Functions inherited from XclRoot
static OUString GetDefaultPassword ()
 Returns the default password used for stream encryption. More...
 

Detailed Description

Stores all data of an Excel font and provides import of FONT records.

Definition at line 71 of file xistyle.hxx.

Constructor & Destructor Documentation

XclImpFont::XclImpFont ( const XclImpRoot rRoot)
explicit

Definition at line 189 of file xistyle.cxx.

References SetAllUsedFlags().

XclImpFont::XclImpFont ( const XclImpRoot rRoot,
const XclFontData rFontData 
)
explicit

Constructs a font from font data.

Special handling for font style (bold, italic) in font name, overwrites settings in rFontData.

Definition at line 199 of file xistyle.cxx.

References SetFontData().

Member Function Documentation

void XclImpFont::FillToItemSet ( SfxItemSet rItemSet,
XclFontItemType  eType,
bool  bSkipPoolDefs = false 
) const

Fills all font properties to the item set.

Parameters
rItemSetThe destination item set.
eTypeThe type of Which-IDs.
bSkipPoolDefstrue = Do not put items equal to pool default; false = Put all items.

Definition at line 313 of file xistyle.cxx.

References ATTR_CJK_FONT(), ATTR_CJK_FONT_HEIGHT(), ATTR_CJK_FONT_POSTURE(), ATTR_CJK_FONT_WEIGHT(), ATTR_CTL_FONT(), ATTR_CTL_FONT_HEIGHT(), ATTR_CTL_FONT_POSTURE(), ATTR_CTL_FONT_WEIGHT(), ATTR_FONT(), ATTR_FONT_COLOR(), ATTR_FONT_CONTOUR(), ATTR_FONT_CROSSEDOUT(), ATTR_FONT_HEIGHT(), ATTR_FONT_POSTURE(), ATTR_FONT_SHADOWED(), ATTR_FONT_UNDERLINE(), ATTR_FONT_WEIGHT(), Cell, EE_CHAR_COLOR(), EE_CHAR_ESCAPEMENT(), EE_CHAR_FONTHEIGHT(), EE_CHAR_FONTHEIGHT_CJK(), EE_CHAR_FONTHEIGHT_CTL(), EE_CHAR_FONTINFO(), EE_CHAR_FONTINFO_CJK(), EE_CHAR_FONTINFO_CTL(), EE_CHAR_ITALIC(), EE_CHAR_ITALIC_CJK(), EE_CHAR_ITALIC_CTL(), EE_CHAR_OUTLINE(), EE_CHAR_SHADOW(), EE_CHAR_STRIKEOUT(), EE_CHAR_UNDERLINE(), EE_CHAR_WEIGHT(), EE_CHAR_WEIGHT_CJK(), EE_CHAR_WEIGHT_CTL(), EMPTY_OUSTRING, EXC_POINTS_PER_INCH, FAMILY_MODERN, FAMILY_ROMAN, FAMILY_SWISS, XclFontData::GetFontEncoding(), XclFontData::GetScEscapement(), XclFontData::GetScFamily(), XclFontData::GetScPosture(), XclFontData::GetScStrikeout(), XclFontData::GetScUnderline(), XclFontData::GetScWeight(), ScfTools::GetSystemTextEncoding(), XclRoot::GetTextEncoding(), HeaderFooter, XclFontData::maColor, maData, XclFontData::maName, mbColorUsed, mbEscapemUsed, mbFontNameUsed, mbHasAsian, mbHasCmplx, mbHasWstrn, mbHeightUsed, mbItalicUsed, XclFontData::mbOutline, mbOutlineUsed, XclFontData::mbShadow, mbShadowUsed, mbStrikeUsed, mbUnderlUsed, mbWeightUsed, XclFontData::mnHeight, PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE, SfxItemSet::Put(), and PUTITEM.

Referenced by XclImpCondFormat::ReadCF().

const XclFontData& XclImpFont::GetFontData ( ) const
inline

Returns read-only access to font data.

Definition at line 87 of file xistyle.hxx.

References maData.

Referenced by XclImpFontBuffer::ReadFont(), and XclImpHFConverter::ResetFontData().

rtl_TextEncoding XclImpFont::GetFontEncoding ( ) const

Returns the text encoding for strings used with this font.

Definition at line 236 of file xistyle.cxx.

References XclFontData::GetFontEncoding(), XclRoot::GetTextEncoding(), maData, and mbHasCharSet.

void XclImpFont::GuessScriptType ( )
private

Tests whether the font contains CJK or CTL characters.

This is only a weak guess using preselected characters.

Definition at line 467 of file xistyle.cxx.

References OutputDevice::GetFontCharMap(), XclRoot::GetPrinter(), maData, XclFontData::maName, mbHasAsian, mbHasCmplx, mbHasWstrn, and OutputDevice::SetFont().

Referenced by ReadFont(), and SetFontData().

bool XclImpFont::HasAsianChars ( ) const
inline

Returns true, if this font contains characters for Asian scripts (CJK).

Definition at line 96 of file xistyle.hxx.

References mbHasAsian.

Referenced by XclImpCellAlign::FillToItemSet().

bool XclImpFont::HasCharSet ( ) const
inline

Returns true, if the font character set is valid.

Definition at line 89 of file xistyle.hxx.

References mbHasCharSet.

Referenced by XclImpFontBuffer::ReadFont().

bool XclImpFont::HasEscapement ( ) const
inline

Returns true, if the font contains superscript or subscript.

Definition at line 91 of file xistyle.hxx.

References EXC_FONTESC_NONE, maData, and XclFontData::mnEscapem.

void XclImpFont::ReadCFFontBlock ( XclImpStream rStrm)
void XclImpFont::ReadEfont ( XclImpStream rStrm)

Reads an EFONT record (BIFF2 font color).

Definition at line 274 of file xistyle.cxx.

References ReadFontColor().

void XclImpFont::ReadFont ( XclImpStream rStrm)
void XclImpFont::ReadFontColor ( XclImpStream rStrm)
private

Reads and sets the font color.

Definition at line 452 of file xistyle.cxx.

References XclImpPalette::GetColor(), XclImpRoot::GetPalette(), XclFontData::maColor, maData, and XclImpStream::ReaduInt16().

Referenced by ReadEfont(), ReadFont(), and ReadFontData5().

void XclImpFont::ReadFontData2 ( XclImpStream rStrm)
private
void XclImpFont::ReadFontData5 ( XclImpStream rStrm)
private
void XclImpFont::ReadFontName2 ( XclImpStream rStrm)
private

Reads and sets a byte string as font name.

Definition at line 457 of file xistyle.cxx.

References maData, XclFontData::maName, and XclImpStream::ReadByteString().

Referenced by ReadFont().

void XclImpFont::ReadFontName8 ( XclImpStream rStrm)
private

Reads and sets a Unicode string as font name.

Definition at line 462 of file xistyle.cxx.

References maData, XclFontData::maName, XclImpStream::ReaduInt8(), and XclImpStream::ReadUniString().

Referenced by ReadFont().

void XclImpFont::SetAllUsedFlags ( bool  bUsed)

Sets all font attributes to used or unused.

Definition at line 205 of file xistyle.cxx.

References mbColorUsed, mbEscapemUsed, mbFontNameUsed, mbHeightUsed, mbItalicUsed, mbOutlineUsed, mbShadowUsed, mbStrikeUsed, mbUnderlUsed, and mbWeightUsed.

Referenced by ReadFont(), SetFontData(), and XclImpFont().

void XclImpFont::SetFontData ( const XclFontData rFontData,
bool  bHasCharSet 
)
void XclImpFont::WriteFontProperties ( ScfPropertySet rPropSet,
XclFontPropSetType  eType,
const Color pFontColor = nullptr 
) const

Writes all font properties to the passed property set.

Parameters
pFontColorIf set, overrides internal stored font color.

Definition at line 409 of file xistyle.cxx.

References XclRoot::GetFontPropSetHelper(), maData, mbHasAsian, mbHasCmplx, mbHasWstrn, and XclFontPropSetHelper::WriteFontProperties().

Referenced by XclImpFontBuffer::WriteDefaultCtrlFontProperties().

Member Data Documentation

XclFontData XclImpFont::maData
private
bool XclImpFont::mbColorUsed
private

true = Font height used.

Definition at line 142 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().

bool XclImpFont::mbEscapemUsed
private

true = Weight used.

Definition at line 144 of file xistyle.hxx.

Referenced by FillToItemSet(), and SetAllUsedFlags().

bool XclImpFont::mbFontNameUsed
private

true = Font contains Complex script characters.

Definition at line 140 of file xistyle.hxx.

Referenced by FillToItemSet(), and SetAllUsedFlags().

bool XclImpFont::mbHasAsian
private

true = Font contains Western script characters.

Definition at line 138 of file xistyle.hxx.

Referenced by FillToItemSet(), GuessScriptType(), HasAsianChars(), and WriteFontProperties().

bool XclImpFont::mbHasCharSet
private

All font attributes.

Definition at line 136 of file xistyle.hxx.

Referenced by GetFontEncoding(), HasCharSet(), ReadFontData2(), ReadFontData5(), and SetFontData().

bool XclImpFont::mbHasCmplx
private

true = Font contains Asian script characters.

Definition at line 139 of file xistyle.hxx.

Referenced by FillToItemSet(), GuessScriptType(), and WriteFontProperties().

bool XclImpFont::mbHasWstrn
private

true = Font contains own character set info.

Definition at line 137 of file xistyle.hxx.

Referenced by FillToItemSet(), GuessScriptType(), and WriteFontProperties().

bool XclImpFont::mbHeightUsed
private

true = Font name, family, charset used.

Definition at line 141 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().

bool XclImpFont::mbItalicUsed
private

true = Underline style used.

Definition at line 146 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().

bool XclImpFont::mbOutlineUsed
private

true = Strikeout used.

Definition at line 148 of file xistyle.hxx.

Referenced by FillToItemSet(), and SetAllUsedFlags().

bool XclImpFont::mbShadowUsed
private

true = Outlined used.

Definition at line 149 of file xistyle.hxx.

Referenced by FillToItemSet(), and SetAllUsedFlags().

bool XclImpFont::mbStrikeUsed
private

true = Italic used.

Definition at line 147 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().

bool XclImpFont::mbUnderlUsed
private

true = Escapement type used.

Definition at line 145 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().

bool XclImpFont::mbWeightUsed
private

true = Color used.

Definition at line 143 of file xistyle.hxx.

Referenced by FillToItemSet(), ReadCFFontBlock(), and SetAllUsedFlags().


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