109 bool bSkipPoolDefs =
false )
const;
181 sal_uInt16 nFontIdx,
bool bSkipPoolDefs =
false )
const;
186 sal_uInt16 nFontIdx,
const Color* pFontColor =
nullptr )
const;
222 sal_uInt32
GetScFormat( sal_uInt16 nXclNumFmt )
const;
230 bool bSkipPoolDefs =
false )
const;
237 bool bSkipPoolDefs =
false )
const;
275 void FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
277 void FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
304 void FillFromXF5( sal_uInt32 nBorder, sal_uInt32 nArea );
306 void FillFromXF8( sal_uInt32 nBorder1, sal_uInt32 nBorder2 );
309 void FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags );
319 bool bSkipPoolDefs =
false )
const;
342 void FillFromXF8( sal_uInt32 nBorder2, sal_uInt16 nArea );
345 void FillFromCF8( sal_uInt16 nPattern, sal_uInt16 nColor, sal_uInt32 nFlags );
352 bool bSkipPoolDefs =
false )
const;
374{
return !(rLeft == rRight); }
400 ::std::vector<ScAttrEntry>& rAttrs,
SCROW nRow1,
SCROW nRow2,
401 sal_uInt32 nForceScNumFmt);
497 {
return (nXFIndex >=
maXFList.size()) ? nullptr :
maXFList.at(nXFIndex).get(); }
500 {
return (nXFIndex >=
maXFList.size()) ? nullptr :
maXFList.at(nXFIndex).get(); }
548 maXFIndex( rXFIndex )
553 mnScRow1( nFirstScRow ),
554 mnScRow2( nLastScRow ),
555 maXFIndex( rXFIndex )
572 typedef std::vector< std::unique_ptr<XclImpXFRange> >
IndexList;
663 std::vector< std::shared_ptr< XclImpXFRangeColumn > >
665 std::vector< std::pair< XclRange, OUString > >
A wrapper for a UNO property set.
Stores all default colors for a specific BIFF version.
Stores the data of all fonts occurred in an Excel file.
const XclFontData & GetAppFontData() const
Returns the application font data of this file, needed i.e.
const XclImpFontBuffer & operator=(const XclImpFontBuffer &)=delete
delete copy-assignment operator
XclImpFontBuffer(const XclImpFontBuffer &)=delete
delete copy constructor
XclImpFont maFont4
Application font (for column width).
void Initialize()
Clears all buffered data, used to set up for a new sheet.
void WriteDefaultCtrlFontProperties(ScfPropertySet &rPropSet) const
Writes default font properties for form controls to the passed property set.
const XclImpFont * GetFont(sal_uInt16 nFontIndex) const
Returns the object that stores all contents of a FONT record.
void UpdateAppFont(const XclFontData &rFontData, bool bHasCharSet)
Updates the application default font.
void ReadFont(XclImpStream &rStrm)
Reads a FONT record.
void FillToItemSet(SfxItemSet &rItemSet, XclFontItemType eType, sal_uInt16 nFontIdx, bool bSkipPoolDefs=false) const
Fills all font properties from a FONT record to the item set.
XclImpFont maCtrlFont
Built-in font with index 4.
XclFontData maAppFont
List of all FONT records in the Excel file.
std::vector< XclImpFont > maFontList
void ReadEfont(XclImpStream &rStrm)
Reads an EFONT record (BIFF2 font color).
void WriteFontProperties(ScfPropertySet &rPropSet, XclFontPropSetType eType, sal_uInt16 nFontIdx, const Color *pFontColor=nullptr) const
Writes all font properties to the passed property set.
Stores all data of an Excel font and provides import of FONT records.
void SetFontData(const XclFontData &rFontData, bool bHasCharSet)
Sets the passed font data and all used flags to 'used'.
XclImpFont(const XclImpRoot &rRoot)
const XclFontData & GetFontData() const
Returns read-only access to font data.
bool HasAsianChars() const
Returns true, if this font contains characters for Asian scripts (CJK).
bool mbHasCmplx
true = Font contains Asian script characters.
void ReadFont(XclImpStream &rStrm)
Reads a FONT record for all BIFF versions.
bool mbWeightUsed
true = Color used.
rtl_TextEncoding GetFontEncoding() const
Returns the text encoding for strings used with this font.
bool mbUnderlUsed
true = Escapement type used.
void GuessScriptType()
Tests whether the font contains CJK or CTL characters.
bool mbEscapemUsed
true = Weight used.
bool mbItalicUsed
true = Underline style used.
void ReadFontColor(XclImpStream &rStrm)
Reads and sets the font color.
bool mbHasCharSet
All font attributes.
bool mbHeightUsed
true = Font name, family, charset used.
void ReadFontData5(XclImpStream &rStrm)
Reads and sets height, flags, color, boldness, script, family and charset.
void ReadCFFontBlock(XclImpStream &rStrm)
Reads the font block from a CF (conditional format) record.
bool mbHasWstrn
true = Font contains own character set info.
void SetAllUsedFlags(bool bUsed)
Sets all font attributes to used or unused.
void ReadFontData2(XclImpStream &rStrm)
Reads and sets height and flags.
void ReadFontName8(XclImpStream &rStrm)
Reads and sets a Unicode string as font name.
void WriteFontProperties(ScfPropertySet &rPropSet, XclFontPropSetType eType, const Color *pFontColor=nullptr) const
Writes all font properties to the passed property set.
bool mbOutlineUsed
true = Strikeout used.
bool HasCharSet() const
Returns true, if the font character set is valid.
void ReadEfont(XclImpStream &rStrm)
Reads an EFONT record (BIFF2 font color).
bool mbHasAsian
true = Font contains Western script characters.
bool HasEscapement() const
Returns true, if the font contains superscript or subscript.
bool mbColorUsed
true = Font height used.
bool mbStrikeUsed
true = Italic used.
bool mbFontNameUsed
true = Font contains Complex script characters.
void FillToItemSet(SfxItemSet &rItemSet, XclFontItemType eType, bool bSkipPoolDefs=false) const
Fills all font properties to the item set.
bool mbShadowUsed
true = Outlined used.
void ReadFontName2(XclImpStream &rStrm)
Reads and sets a byte string as font name.
Stores all user defined number formats occurred in the file.
void Initialize()
Clears all buffered data, used to set up for a new sheet.
void FillScFmtToItemSet(SfxItemSet &rItemSet, sal_uInt32 nScNumFmt, bool bSkipPoolDefs=false) const
Fills a Calc number format to the passed item set.
sal_uInt16 mnNextXclIdx
Maps Excel format indexes to Calc formats.
sal_uInt16 ReadCFFormat(XclImpStream &rStrm, bool bIFmt)
Read NumFmt from conditional format record.
XclImpNumFmtBuffer(const XclImpRoot &rRoot)
void FillToItemSet(SfxItemSet &rItemSet, sal_uInt16 nXclNumFmt, bool bSkipPoolDefs=false) const
Fills an Excel number format to the passed item set.
void CreateScFormats()
Creates the number formats in the Calc document.
::std::map< sal_uInt16, sal_uLong > XclImpIndexMap
void ReadFormat(XclImpStream &rStrm)
Reads a FORMAT record.
sal_uInt32 GetScFormat(sal_uInt16 nXclNumFmt) const
Returns the format key with the passed Excel index or NUMBERFORMAT_ENTRY_NOT_FOUND on error.
XclImpIndexMap maIndexMap
Stores the default colors for the current BIFF version and the contents of a PALETTE record.
XclImpPalette(const XclImpRoot &rRoot)
void ReadPalette(XclImpStream &rStrm)
Reads a PALETTE record.
const XclImpRoot & mrRoot
Colors read from file.
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Color GetColor(sal_uInt16 nXclIndex) const
Returns the color for a (non-zero-based) Excel palette entry.
::std::vector< Color > ColorVec
Access to global data from other classes.
This class is used to import record oriented streams.
Contains all data of a cell style associated with an XF record.
XclImpStyle(const XclImpRoot &rRoot)
ScStyleSheet * mpStyleSheet
Final name used in the Calc document.
void ReadStyle(XclImpStream &rStrm)
Reads a STYLE record.
OUString maFinalName
True = style not visible in GUI.
const OUString & GetName() const
sal_uInt16 mnXfId
Cell style name.
sal_uInt16 GetXfId() const
bool mbHidden
True = customized builtin style.
bool mbBuiltin
Level for builtin column/row styles.
sal_uInt8 mnLevel
Identifier for builtin styles.
ScStyleSheet * CreateStyleSheet()
Creates a cell style sheet and inserts it into the Calc document.
sal_uInt8 GetLevel() const
sal_uInt8 mnBuiltinId
Formatting for this cell style.
void CreateUserStyle(const OUString &rFinalName)
Creates the Calc style sheet, if this is a user-defined style.
sal_uInt8 GetBuiltinId() const
bool mbCustom
True = builtin style.
Contains all XF records occurred in the file.
sal_uInt16 GetFontIndex(sal_uInt16 nXFIndex) const
Returns the index to the Excel font used in the specified XF record.
const XclImpXF * GetXF(sal_uInt16 nXFIndex) const
XclImpXFBuffer(const XclImpXFBuffer &)=delete
make noncopyable
::std::map< sal_uInt16, XclImpStyle * > XclImpStyleMap
XclImpStyleList maBuiltinStyles
List of contents of all XF record.
void ReadStyle(XclImpStream &rStrm)
Reads a STYLE record.
void Initialize()
Clears all buffered data, used to set up for a new sheet.
const XclImpXFBuffer & operator=(const XclImpXFBuffer &)=delete
XclImpXF * GetXF(sal_uInt16 nXFIndex)
Returns the object that stores all contents of an XF record.
const XclImpFont * GetFont(sal_uInt16 nXFIndex) const
Returns the Excel font used in the specified XF record.
void CreateUserStyles()
Creates all user defined style sheets.
XclImpStyleMap maStylesByXf
List of user defined cell styles.
std::vector< std::unique_ptr< XclImpStyle > > XclImpStyleList
XclImpStyleList maUserStyles
List of built-in cell styles.
void ReadXF(XclImpStream &rStrm)
Reads an XF record.
ScStyleSheet * CreateStyleSheet(sal_uInt16 nXFIndex)
Creates a cell style sheet of the passed XF and inserts it into the Calc document.
std::vector< std::unique_ptr< XclImpXF > > maXFList
Represents an XF record index with additional information.
XclImpXFIndex(sal_uInt16 nXFIndex, bool bBoolCell=false)
sal_uInt16 GetXFIndex() const
bool mbBoolCell
The XF record index.
Contains the XF indexes for every used cell in a single sheet.
void SetBoolXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for boolean cells.
XclImpXFRangeBuffer(const XclImpXFRangeBuffer &)=delete
make noncopyable
void SetColumnDefXF(SCCOL nScCol, sal_uInt16 nXFIndex)
Inserts a new XF index for all cells in a column.
virtual ~XclImpXFRangeBuffer() override
void SetHyperlink(const XclRange &rXclRange, const OUString &rUrl)
Inserts a range of hyperlink cells.
std::vector< std::pair< XclRange, OUString > > maHyperlinks
Array of column XF index buffers.
void SetBlankXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for blank cells.
void Finalize()
Applies styles and cell merging to the current sheet in the document.
void SetXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index.
XclImpXFInsertMode
Insertion mode of an XF index.
@ xlXFModeBlank
Cell with a single Boolean value.
@ xlXFModeBoolCell
Filled cell.
const XclImpXFRangeBuffer & operator=(const XclImpXFRangeBuffer &)=delete
void SetRowDefXF(SCROW nScRow, sal_uInt16 nXFIndex)
Inserts a new XF index for all cells in a row.
ScRangeList maMergeList
Maps URLs to hyperlink cells.
std::vector< std::shared_ptr< XclImpXFRangeColumn > > maColumns
void Initialize()
Clears all buffered data, used to set up for a new sheet.
void SetMerge(SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2)
Inserts a complete merged cell range.
void SetBorderLine(const ScRange &rRange, SCTAB nScTab, SvxBoxItemLine nLine)
Copies border of the last cell of the range to the first cell to keep it visible when the range is me...
Contains the XF indexes for every used cell in a column.
IndexList::iterator end()
std::vector< std::unique_ptr< XclImpXFRange > > IndexList
XclImpXFRangeColumn(const XclImpXFRangeColumn &)=delete
make noncopyable
void SetXF(SCROW nScRow, const XclImpXFIndex &rXFIndex)
Inserts a new (encoded) XF index (first try to expand the last range).
const XclImpXFRangeColumn & operator=(const XclImpXFRangeColumn &)=delete
void Insert(XclImpXFRange *pXFRange, sal_uLong nIndex)
Insert a range into the list at the specified index.
void Find(XclImpXFRange *&rpPrevRange, XclImpXFRange *&rpNextRange, sal_uLong &rnNextIndex, SCROW nScRow)
Finds the previous and next row range from row position nScRow.
void TryConcatPrev(sal_uLong nIndex)
Tries to concatenate a range with its predecessor.
void SetDefaultXF(const XclImpXFIndex &rXFIndex, const XclImpRoot &rRoot)
Inserts a single row range into the list.
IndexList::iterator begin()
Contains an (encoded) XF index for a range of rows in a single column.
bool Contains(SCROW nScRow) const
Returns true, if nScRow is contained in own row range.
bool Expand(SCROW nScRow, const XclImpXFIndex &rXFIndex)
Returns true, if the range has been expanded.
XclImpXFIndex maXFIndex
The last row of an equal-formatted range.
SCROW mnScRow2
The first row of an equal-formatted range.
XclImpXFRange(SCROW nScRow, const XclImpXFIndex &rXFIndex)
Extended XF index.
Contains all data of a XF record and a Calc item set.
const ScPatternAttr & CreatePattern(bool bSkipPoolDefs=false)
Creates a Calc item set containing an item set with all cell properties.
XclImpCellBorder maBorder
All alignment attributes.
bool GetLineBreak() const
XclImpCellProt maProtection
Calc cell style sheet.
sal_uInt16 mnXclFont
Index to number format.
ScStyleSheet * mpStyleSheet
Calc item set.
virtual ~XclImpXF() override
XclImpCellArea maArea
Border line style.
ScPatternAttrPtr mpPattern
void ReadXF8(XclImpStream &rStrm)
void ReadXF3(XclImpStream &rStrm)
void SetUsedFlags(sal_uInt8 nUsedFlags)
Sets all "attribute used" flags according to the passed mask.
sal_uInt8 GetHorAlign() const
void ReadXF2(XclImpStream &rStrm)
sal_uInt16 GetFontIndex() const
void ReadXF(XclImpStream &rStrm)
Reads an XF record.
void ApplyPatternToAttrVector(::std::vector< ScAttrEntry > &rAttrs, SCROW nRow1, SCROW nRow2, sal_uInt32 nForceScNumFmt)
void ReadXF5(XclImpStream &rStrm)
XclImpCellAlign maAlignment
Cell protection flags.
::std::unique_ptr< ScPatternAttr > ScPatternAttrPtr
const XclImpXF & operator=(const XclImpXF &)=delete
XclImpXF(const XclImpXF &)=delete
make noncopyable
void ReadXF4(XclImpStream &rStrm)
void ApplyPattern(SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2, SCTAB nScTab)
Inserts all formatting attributes to the specified area in the Calc document.
sal_uInt16 mnXclNumFmt
Background area style.
static void ApplyPatternForBiff2CellFormat(const XclImpRoot &rRoot, const ScAddress &rScPos, sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3)
Converts formatting information from BIFF2 cell record data directly.
Contains base members for XF record import/export.
Contains all cell alignment attributes.
bool mbLineBreak
Indentation.
Contains background colors and pattern for a cell.
Contains color and line style for each cell border line.
Contains all cell protection attributes.
This struct helps reading and writing Excel fonts.
sal_uInt16 mnEscapem
Boldness: 400=normal, 700=bold.
Extends the XclCellAlign struct for import.
void FillFromCF(sal_uInt16 nAlign, sal_uInt16 nMiscAttrib)
Fills this struct with CF record data.
void FillFromXF8(sal_uInt16 nAlign, sal_uInt16 nMiscAttrib)
Fills this struct with BIFF8 XF record data.
void FillToItemSet(SfxItemSet &rItemSet, const XclImpFont *pFont, bool bSkipPoolDefs=false) const
Inserts items representing this alignment style into the item set.
void FillFromXF4(sal_uInt16 nAlign)
Fills this struct with BIFF4 XF record data.
void FillFromXF3(sal_uInt16 nAlign)
Fills this struct with BIFF3 XF record data.
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
void FillFromXF5(sal_uInt16 nAlign)
Fills this struct with BIFF5/BIFF7 XF record data.
Extends the XclCellArea struct for import.
bool mbPattUsed
true = Background color used.
void FillFromXF5(sal_uInt32 nArea)
Fills this struct with BIFF5/BIFF7 XF record data.
bool mbBackUsed
true = Foreground color used.
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
void FillFromXF3(sal_uInt16 nArea)
Fills this struct with BIFF3/BIFF4 XF record data.
void FillFromXF8(sal_uInt32 nBorder2, sal_uInt16 nArea)
Fills this struct with BIFF8 XF record data.
void FillFromCF8(sal_uInt16 nPattern, sal_uInt16 nColor, sal_uInt32 nFlags)
Fills this struct with BIFF8 CF (conditional format) record data.
void SetUsedFlags(bool bUsed)
Sets colors and pattern state to used or unused.
XclImpCellArea()
true = Pattern used.
void FillToItemSet(SfxItemSet &rItemSet, const XclImpPalette &rPalette, bool bSkipPoolDefs=false) const
Inserts a brush item representing this area style into the item set.
Extends the XclCellBorder struct for import.
void FillFromXF3(sal_uInt32 nBorder)
Fills this struct with BIFF3/BIFF4 XF record data.
XclImpCellBorder()
true = Diagonal line style used.
void FillFromXF5(sal_uInt32 nBorder, sal_uInt32 nArea)
Fills this struct with BIFF5/BIFF7 XF record data.
void FillToItemSet(SfxItemSet &rItemSet, const XclImpPalette &rPalette, bool bSkipPoolDefs=false) const
Inserts a box item representing this border style into the item set.
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
void FillFromCF8(sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags)
Fills this struct with BIFF8 CF (conditional format) record data.
void FillFromXF8(sal_uInt32 nBorder1, sal_uInt32 nBorder2)
Fills this struct with BIFF8 XF record data.
bool HasAnyOuterBorder() const
Returns true, if any of the outer border lines is visible.
void SetUsedFlags(bool bOuterUsed, bool bDiagUsed)
Sets outer line states and diagonal line states to used or unused.
bool mbDiagUsed
true = Bottom line style used.
bool mbRightUsed
true = Left line style used.
bool mbBottomUsed
true = Top line style used.
bool mbTopUsed
true = Right line style used.
Extends the XclCellProt struct for import.
void FillFromXF3(sal_uInt16 nProt)
Fills this struct with BIFF3-BIFF8 XF record data.
void FillFromXF2(sal_uInt8 nNumFmt)
Fills this struct with BIFF2 XF record data.
void FillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
Inserts items representing this protection style into the item set.
A 2D cell range address struct with Excel column and row indexes.
bool operator!=(const XclImpXFIndex &rLeft, const XclImpXFIndex &rRight)
bool operator==(const XclImpXFIndex &rLeft, const XclImpXFIndex &rRight)
XclFontItemType
Enumerates different types of Which-IDs for font items.
XclFontPropSetType
Enumerates different types for objects with font settings (using different property names).
const sal_uInt16 EXC_FONTESC_NONE
const sal_uInt8 EXC_STYLE_USERDEF
"Followed_Hyperlink" style.