LibreOffice Module sc (master) 1
xistyle.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <tools/solar.h>
23#include <vector>
24#include <memory>
25#include <rangelst.hxx>
26#include "xlstyle.hxx"
27#include "xiroot.hxx"
28
29class ScPatternAttr;
30
31struct XclRange;
32struct ScAttrEntry;
33enum class SvxBoxItemLine;
34
35/* ============================================================================
36- Buffers for style records (PALETTE, FONT, FORMAT, XF)
37 and a container for XF indexes for every used cell in a sheet.
38============================================================================ */
39
40// PALETTE record - color information =========================================
41
45{
46public:
47 explicit XclImpPalette( const XclImpRoot& rRoot );
48
50 void Initialize();
51
55 Color GetColor( sal_uInt16 nXclIndex ) const;
56
59
60private:
61 void ExportPalette();
62 typedef ::std::vector< Color > ColorVec;
65};
66
67// FONT record - font information =============================================
68
70class XclImpFont : protected XclImpRoot
71{
72public:
73 explicit XclImpFont( const XclImpRoot& rRoot );
74
78 explicit XclImpFont( const XclImpRoot& rRoot, const XclFontData& rFontData );
79
81 void SetAllUsedFlags( bool bUsed );
83 void SetFontData( const XclFontData& rFontData, bool bHasCharSet );
84
86 const XclFontData& GetFontData() const { return maData; }
88 bool HasCharSet() const { return mbHasCharSet; }
90 bool HasEscapement() const { return maData.mnEscapem != EXC_FONTESC_NONE; }
92 rtl_TextEncoding GetFontEncoding() const;
93
95 bool HasAsianChars() const { return mbHasAsian; }
96
98 void ReadFont( XclImpStream& rStrm );
100 void ReadEfont( XclImpStream& rStrm );
102 void ReadCFFontBlock( XclImpStream& rStrm );
103
108 void FillToItemSet( SfxItemSet& rItemSet, XclFontItemType eType,
109 bool bSkipPoolDefs = false ) const;
112 void WriteFontProperties( ScfPropertySet& rPropSet,
113 XclFontPropSetType eType, const Color* pFontColor = nullptr ) const;
114
115private:
117 void ReadFontData2( XclImpStream& rStrm );
119 void ReadFontData5( XclImpStream& rStrm );
120
122 void ReadFontColor( XclImpStream& rStrm );
123
125 void ReadFontName2( XclImpStream& rStrm );
127 void ReadFontName8( XclImpStream& rStrm );
128
131 void GuessScriptType();
132
133private:
149};
150
153{
154public:
159
160 explicit XclImpFontBuffer( const XclImpRoot& rRoot );
161
163 void Initialize();
164
166 const XclImpFont* GetFont( sal_uInt16 nFontIndex ) const;
168 const XclFontData& GetAppFontData() const { return maAppFont; }
169
171 void ReadFont( XclImpStream& rStrm );
173 void ReadEfont( XclImpStream& rStrm );
174
180 void FillToItemSet( SfxItemSet& rItemSet, XclFontItemType eType,
181 sal_uInt16 nFontIdx, bool bSkipPoolDefs = false ) const;
185 ScfPropertySet& rPropSet, XclFontPropSetType eType,
186 sal_uInt16 nFontIdx, const Color* pFontColor = nullptr ) const;
188 void WriteDefaultCtrlFontProperties( ScfPropertySet& rPropSet ) const;
189
190private:
192 void UpdateAppFont( const XclFontData& rFontData, bool bHasCharSet );
193
194private:
195 std::vector< XclImpFont > maFontList;
199};
200
201// FORMAT record - number formats =============================================
202
205{
206public:
207 explicit XclImpNumFmtBuffer( const XclImpRoot& rRoot );
208
210 void Initialize();
211
214
216 sal_uInt16 ReadCFFormat( XclImpStream& rStrm, bool bIFmt );
217
219 void CreateScFormats();
220
222 sal_uInt32 GetScFormat( sal_uInt16 nXclNumFmt ) const;
223
228 void FillToItemSet(
229 SfxItemSet& rItemSet, sal_uInt16 nXclNumFmt,
230 bool bSkipPoolDefs = false ) const;
236 SfxItemSet& rItemSet, sal_uInt32 nScNumFmt,
237 bool bSkipPoolDefs = false ) const;
238
239private:
240 typedef ::std::map< sal_uInt16, sal_uLong > XclImpIndexMap;
241
243 sal_uInt16 mnNextXclIdx;
244};
245
246// XF, STYLE record - Cell formatting =========================================
247
251{
253 void FillFromXF2( sal_uInt8 nNumFmt );
255 void FillFromXF3( sal_uInt16 nProt );
256
259 void FillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
260};
261
265{
267 void FillFromXF2( sal_uInt8 nFlags );
269 void FillFromXF3( sal_uInt16 nAlign );
271 void FillFromXF4( sal_uInt16 nAlign );
273 void FillFromXF5( sal_uInt16 nAlign );
275 void FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
277 void FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
278
281 void FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFont, bool bSkipPoolDefs = false ) const;
282};
283
287{
293
294 explicit XclImpCellBorder();
295
297 void SetUsedFlags( bool bOuterUsed, bool bDiagUsed );
298
300 void FillFromXF2( sal_uInt8 nFlags );
302 void FillFromXF3( sal_uInt32 nBorder );
304 void FillFromXF5( sal_uInt32 nBorder, sal_uInt32 nArea );
306 void FillFromXF8( sal_uInt32 nBorder1, sal_uInt32 nBorder2 );
307
309 void FillFromCF8( sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags );
310
312 bool HasAnyOuterBorder() const;
313
316 void FillToItemSet(
317 SfxItemSet& rItemSet,
318 const XclImpPalette& rPalette,
319 bool bSkipPoolDefs = false ) const;
320};
321
325{
329
330 explicit XclImpCellArea();
331
333 void SetUsedFlags( bool bUsed );
334
336 void FillFromXF2( sal_uInt8 nFlags );
338 void FillFromXF3( sal_uInt16 nArea );
340 void FillFromXF5( sal_uInt32 nArea );
342 void FillFromXF8( sal_uInt32 nBorder2, sal_uInt16 nArea );
343
345 void FillFromCF8( sal_uInt16 nPattern, sal_uInt16 nColor, sal_uInt32 nFlags );
346
349 void FillToItemSet(
350 SfxItemSet& rItemSet,
351 const XclImpPalette& rPalette,
352 bool bSkipPoolDefs = false ) const;
353};
354
357{
358public:
359 explicit XclImpXFIndex( sal_uInt16 nXFIndex, bool bBoolCell = false ) :
360 mnXFIndex( nXFIndex ), mbBoolCell( bBoolCell ) {}
361
362 sal_uInt16 GetXFIndex() const { return mnXFIndex; }
363 bool IsBoolCell() const { return mbBoolCell; }
364
365private:
366 sal_uInt16 mnXFIndex;
368};
369
370inline bool operator==( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight )
371{ return (rLeft.GetXFIndex() == rRight.GetXFIndex()) && (rLeft.IsBoolCell() == rRight.IsBoolCell()); }
372
373inline bool operator!=( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight )
374{ return !(rLeft == rRight); }
375
377class XclImpXF : public XclXFBase, protected XclImpRoot
378{
379public:
381 XclImpXF(const XclImpXF&) = delete;
382 const XclImpXF& operator=(const XclImpXF&) = delete;
383
384 explicit XclImpXF( const XclImpRoot& rRoot );
385 virtual ~XclImpXF() override;
386
388 void ReadXF( XclImpStream& rStrm );
389
391 sal_uInt16 GetFontIndex() const { return mnXclFont; }
392
396 const ScPatternAttr& CreatePattern( bool bSkipPoolDefs = false );
397
399 ::std::vector<ScAttrEntry>& rAttrs, SCROW nRow1, SCROW nRow2,
400 sal_uInt32 nForceScNumFmt);
401
405 void ApplyPattern(
406 SCCOL nScCol1, SCROW nScRow1,
407 SCCOL nScCol2, SCROW nScRow2,
408 SCTAB nScTab );
409
412 const XclImpRoot& rRoot, const ScAddress& rScPos,
413 sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3 );
414
415private:
416 void ReadXF2( XclImpStream& rStrm );
417 void ReadXF3( XclImpStream& rStrm );
418 void ReadXF4( XclImpStream& rStrm );
419 void ReadXF5( XclImpStream& rStrm );
420 void ReadXF8( XclImpStream& rStrm );
421
425 void SetUsedFlags( sal_uInt8 nUsedFlags );
426
427private:
428 typedef ::std::unique_ptr< ScPatternAttr > ScPatternAttrPtr;
429
432
437 sal_uInt16 mnXclNumFmt;
438 sal_uInt16 mnXclFont;
439};
440
442class XclImpStyle : protected XclImpRoot
443{
444public:
445 explicit XclImpStyle( const XclImpRoot& rRoot );
446
449
450 const OUString& GetName() const { return maName; }
451 sal_uInt16 GetXfId() const { return mnXfId; }
452 bool IsBuiltin() const { return mbBuiltin && (mnBuiltinId != EXC_STYLE_USERDEF); }
454 sal_uInt8 GetLevel() const { return mnLevel; }
455
460 void CreateUserStyle( const OUString& rFinalName );
461
462private:
463 OUString maName;
464 sal_uInt16 mnXfId;
468 bool mbCustom;
469 bool mbHidden;
470
471 OUString maFinalName;
473};
474
477class XclImpXFBuffer : protected XclImpRoot
478{
479public:
482 const XclImpXFBuffer& operator=(const XclImpXFBuffer&) = delete;
483
484 explicit XclImpXFBuffer( const XclImpRoot& rRoot );
485
487 void Initialize();
488
490 void ReadXF( XclImpStream& rStrm );
492 void ReadStyle( XclImpStream& rStrm );
493
495 XclImpXF* GetXF( sal_uInt16 nXFIndex )
496 { return (nXFIndex >= maXFList.size()) ? nullptr : maXFList.at(nXFIndex).get(); }
497
498 const XclImpXF* GetXF( sal_uInt16 nXFIndex ) const
499 { return (nXFIndex >= maXFList.size()) ? nullptr : maXFList.at(nXFIndex).get(); }
500
502 sal_uInt16 GetFontIndex( sal_uInt16 nXFIndex ) const;
504 const XclImpFont* GetFont( sal_uInt16 nXFIndex ) const;
505
507 void CreateUserStyles();
510 ScStyleSheet* CreateStyleSheet( sal_uInt16 nXFIndex );
511
512private:
513 typedef std::vector< std::unique_ptr<XclImpStyle> > XclImpStyleList;
514 typedef ::std::map< sal_uInt16, XclImpStyle* > XclImpStyleMap;
515
516 std::vector< std::unique_ptr<XclImpXF> > maXFList;
520};
521
522// Buffer for XF indexes in cells =============================================
523
526{
527public:
531
532 inline explicit XclImpXFRange( SCROW nScRow, const XclImpXFIndex& rXFIndex );
533 inline explicit XclImpXFRange( SCROW nFirstScRow, SCROW nLastScRow, const XclImpXFIndex& rXFIndex );
534
536 inline bool Contains( SCROW nScRow ) const;
537
539 bool Expand( SCROW nScRow, const XclImpXFIndex& rXFIndex );
541 bool Expand( const XclImpXFRange& rNextRange );
542};
543
544inline XclImpXFRange::XclImpXFRange( SCROW nScRow, const XclImpXFIndex& rXFIndex ) :
545 mnScRow1( nScRow ),
546 mnScRow2( nScRow ),
547 maXFIndex( rXFIndex )
548{
549}
550
551inline XclImpXFRange::XclImpXFRange( SCROW nFirstScRow, SCROW nLastScRow, const XclImpXFIndex& rXFIndex ) :
552 mnScRow1( nFirstScRow ),
553 mnScRow2( nLastScRow ),
554 maXFIndex( rXFIndex )
555{
556}
557
558inline bool XclImpXFRange::Contains( SCROW nScRow ) const
559{
560 return (mnScRow1 <= nScRow) && (nScRow <= mnScRow2);
561}
562
565{
566public:
570
571 typedef std::vector< std::unique_ptr<XclImpXFRange> > IndexList;
572
574
575 IndexList::iterator begin() { return maIndexList.begin(); }
576 IndexList::iterator end() { return maIndexList.end(); }
577
579 void SetDefaultXF( const XclImpXFIndex& rXFIndex, const XclImpRoot& rRoot );
580
582 void SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex );
583
584private:
587 void Find(
588 XclImpXFRange*& rpPrevRange,
589 XclImpXFRange*& rpNextRange,
590 sal_uLong& rnNextIndex,
591 SCROW nScRow );
592
596 void TryConcatPrev( sal_uLong nIndex );
597
599 void Insert(XclImpXFRange* pXFRange, sal_uLong nIndex);
600
601private:
603};
604
607{
608public:
612
613 explicit XclImpXFRangeBuffer( const XclImpRoot& rRoot );
614 virtual ~XclImpXFRangeBuffer() override;
615
617 void Initialize();
618
620 void SetXF( const ScAddress& rScPos, sal_uInt16 nXFIndex );
622 void SetBlankXF( const ScAddress& rScPos, sal_uInt16 nXFIndex );
624 void SetBoolXF( const ScAddress& rScPos, sal_uInt16 nXFIndex );
626 void SetRowDefXF( SCROW nScRow, sal_uInt16 nXFIndex );
628 void SetColumnDefXF( SCCOL nScCol, sal_uInt16 nXFIndex );
629
631 void SetHyperlink( const XclRange& rXclRange, const OUString& rUrl );
632
634 void SetMerge( SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2 );
635
637 void Finalize();
638
639private:
642 {
647 };
648
649private:
651 void SetXF( const ScAddress& rScPos, sal_uInt16 nXFIndex, XclImpXFInsertMode eMode );
652
658 void SetBorderLine( const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine );
659
660private:
661
662 std::vector< std::shared_ptr< XclImpXFRangeColumn > >
664 std::vector< std::pair< XclRange, OUString > >
667};
668
669/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBoxItemLine
A wrapper for a UNO property set.
Definition: fapihelper.hxx:104
Stores all default colors for a specific BIFF version.
Definition: xlstyle.hxx:251
Stores the data of all fonts occurred in an Excel file.
Definition: xistyle.hxx:153
const XclFontData & GetAppFontData() const
Returns the application font data of this file, needed i.e.
Definition: xistyle.hxx:168
const XclImpFontBuffer & operator=(const XclImpFontBuffer &)=delete
delete copy-assignment operator
XclImpFontBuffer(const XclImpFontBuffer &)=delete
delete copy constructor
XclImpFont maFont4
Application font (for column width).
Definition: xistyle.hxx:197
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Definition: xistyle.cxx:547
void WriteDefaultCtrlFontProperties(ScfPropertySet &rPropSet) const
Writes default font properties for form controls to the passed property set.
Definition: xistyle.cxx:611
const XclImpFont * GetFont(sal_uInt16 nFontIndex) const
Returns the object that stores all contents of a FONT record.
Definition: xistyle.cxx:559
void UpdateAppFont(const XclFontData &rFontData, bool bHasCharSet)
Updates the application default font.
Definition: xistyle.cxx:616
void ReadFont(XclImpStream &rStrm)
Reads a FONT record.
Definition: xistyle.cxx:578
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.
Definition: xistyle.cxx:596
XclImpFont maCtrlFont
Built-in font with index 4.
Definition: xistyle.hxx:198
XclFontData maAppFont
List of all FONT records in the Excel file.
Definition: xistyle.hxx:196
std::vector< XclImpFont > maFontList
Definition: xistyle.hxx:195
void ReadEfont(XclImpStream &rStrm)
Reads an EFONT record (BIFF2 font color).
Definition: xistyle.cxx:590
void WriteFontProperties(ScfPropertySet &rPropSet, XclFontPropSetType eType, sal_uInt16 nFontIdx, const Color *pFontColor=nullptr) const
Writes all font properties to the passed property set.
Definition: xistyle.cxx:604
Stores all data of an Excel font and provides import of FONT records.
Definition: xistyle.hxx:71
void SetFontData(const XclFontData &rFontData, bool bHasCharSet)
Sets the passed font data and all used flags to 'used'.
Definition: xistyle.cxx:215
XclImpFont(const XclImpRoot &rRoot)
Definition: xistyle.cxx:193
const XclFontData & GetFontData() const
Returns read-only access to font data.
Definition: xistyle.hxx:86
bool HasAsianChars() const
Returns true, if this font contains characters for Asian scripts (CJK).
Definition: xistyle.hxx:95
bool mbHasCmplx
true = Font contains Asian script characters.
Definition: xistyle.hxx:138
void ReadFont(XclImpStream &rStrm)
Reads a FONT record for all BIFF versions.
Definition: xistyle.cxx:248
bool mbWeightUsed
true = Color used.
Definition: xistyle.hxx:142
rtl_TextEncoding GetFontEncoding() const
Returns the text encoding for strings used with this font.
Definition: xistyle.cxx:240
bool mbUnderlUsed
true = Escapement type used.
Definition: xistyle.hxx:144
void GuessScriptType()
Tests whether the font contains CJK or CTL characters.
Definition: xistyle.cxx:471
bool mbEscapemUsed
true = Weight used.
Definition: xistyle.hxx:143
bool mbItalicUsed
true = Underline style used.
Definition: xistyle.hxx:145
void ReadFontColor(XclImpStream &rStrm)
Reads and sets the font color.
Definition: xistyle.cxx:456
bool mbHasCharSet
All font attributes.
Definition: xistyle.hxx:135
bool mbHeightUsed
true = Font name, family, charset used.
Definition: xistyle.hxx:140
void ReadFontData5(XclImpStream &rStrm)
Reads and sets height, flags, color, boldness, script, family and charset.
Definition: xistyle.cxx:435
void ReadCFFontBlock(XclImpStream &rStrm)
Reads the font block from a CF (conditional format) record.
Definition: xistyle.cxx:283
bool mbHasWstrn
true = Font contains own character set info.
Definition: xistyle.hxx:136
void SetAllUsedFlags(bool bUsed)
Sets all font attributes to used or unused.
Definition: xistyle.cxx:209
void ReadFontData2(XclImpStream &rStrm)
Reads and sets height and flags.
Definition: xistyle.cxx:420
void ReadFontName8(XclImpStream &rStrm)
Reads and sets a Unicode string as font name.
Definition: xistyle.cxx:466
void WriteFontProperties(ScfPropertySet &rPropSet, XclFontPropSetType eType, const Color *pFontColor=nullptr) const
Writes all font properties to the passed property set.
Definition: xistyle.cxx:413
bool mbOutlineUsed
true = Strikeout used.
Definition: xistyle.hxx:147
bool HasCharSet() const
Returns true, if the font character set is valid.
Definition: xistyle.hxx:88
void ReadEfont(XclImpStream &rStrm)
Reads an EFONT record (BIFF2 font color).
Definition: xistyle.cxx:278
bool mbHasAsian
true = Font contains Western script characters.
Definition: xistyle.hxx:137
XclFontData maData
Definition: xistyle.hxx:134
bool HasEscapement() const
Returns true, if the font contains superscript or subscript.
Definition: xistyle.hxx:90
bool mbColorUsed
true = Font height used.
Definition: xistyle.hxx:141
bool mbStrikeUsed
true = Italic used.
Definition: xistyle.hxx:146
bool mbFontNameUsed
true = Font contains Complex script characters.
Definition: xistyle.hxx:139
void FillToItemSet(SfxItemSet &rItemSet, XclFontItemType eType, bool bSkipPoolDefs=false) const
Fills all font properties to the item set.
Definition: xistyle.cxx:317
bool mbShadowUsed
true = Outlined used.
Definition: xistyle.hxx:148
void ReadFontName2(XclImpStream &rStrm)
Reads and sets a byte string as font name.
Definition: xistyle.cxx:461
Stores all user defined number formats occurred in the file.
Definition: xistyle.hxx:205
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Definition: xistyle.cxx:637
void FillScFmtToItemSet(SfxItemSet &rItemSet, sal_uInt32 nScNumFmt, bool bSkipPoolDefs=false) const
Fills a Calc number format to the passed item set.
Definition: xistyle.cxx:739
sal_uInt16 mnNextXclIdx
Maps Excel format indexes to Calc formats.
Definition: xistyle.hxx:243
sal_uInt16 ReadCFFormat(XclImpStream &rStrm, bool bIFmt)
Read NumFmt from conditional format record.
Definition: xistyle.cxx:681
XclImpNumFmtBuffer(const XclImpRoot &rRoot)
Definition: xistyle.cxx:630
void FillToItemSet(SfxItemSet &rItemSet, sal_uInt16 nXclNumFmt, bool bSkipPoolDefs=false) const
Fills an Excel number format to the passed item set.
Definition: xistyle.cxx:731
void CreateScFormats()
Creates the number formats in the Calc document.
Definition: xistyle.cxx:700
::std::map< sal_uInt16, sal_uLong > XclImpIndexMap
Definition: xistyle.hxx:240
void ReadFormat(XclImpStream &rStrm)
Reads a FORMAT record.
Definition: xistyle.cxx:644
sal_uInt32 GetScFormat(sal_uInt16 nXclNumFmt) const
Returns the format key with the passed Excel index or NUMBERFORMAT_ENTRY_NOT_FOUND on error.
Definition: xistyle.cxx:725
XclImpIndexMap maIndexMap
Definition: xistyle.hxx:242
Stores the default colors for the current BIFF version and the contents of a PALETTE record.
Definition: xistyle.hxx:45
XclImpPalette(const XclImpRoot &rRoot)
Definition: xistyle.cxx:147
void ExportPalette()
Definition: xistyle.cxx:124
void ReadPalette(XclImpStream &rStrm)
Reads a PALETTE record.
Definition: xistyle.cxx:168
const XclImpRoot & mrRoot
Colors read from file.
Definition: xistyle.hxx:64
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Definition: xistyle.cxx:152
Color GetColor(sal_uInt16 nXclIndex) const
Returns the color for a (non-zero-based) Excel palette entry.
Definition: xistyle.cxx:157
ColorVec maColorTable
Definition: xistyle.hxx:63
::std::vector< Color > ColorVec
Definition: xistyle.hxx:62
Access to global data from other classes.
Definition: xiroot.hxx:129
This class is used to import record oriented streams.
Definition: xistream.hxx:278
Contains all data of a cell style associated with an XF record.
Definition: xistyle.hxx:443
XclImpStyle(const XclImpRoot &rRoot)
Definition: xistyle.cxx:1466
ScStyleSheet * mpStyleSheet
Final name used in the Calc document.
Definition: xistyle.hxx:472
void ReadStyle(XclImpStream &rStrm)
Reads a STYLE record.
Definition: xistyle.cxx:1478
OUString maFinalName
True = style not visible in GUI.
Definition: xistyle.hxx:471
const OUString & GetName() const
Definition: xistyle.hxx:450
sal_uInt16 mnXfId
Cell style name.
Definition: xistyle.hxx:464
sal_uInt16 GetXfId() const
Definition: xistyle.hxx:451
bool IsBuiltin() const
Definition: xistyle.hxx:452
bool mbHidden
True = customized builtin style.
Definition: xistyle.hxx:469
bool mbBuiltin
Level for builtin column/row styles.
Definition: xistyle.hxx:467
sal_uInt8 mnLevel
Identifier for builtin styles.
Definition: xistyle.hxx:466
ScStyleSheet * CreateStyleSheet()
Creates a cell style sheet and inserts it into the Calc document.
Definition: xistyle.cxx:1514
sal_uInt8 GetLevel() const
Definition: xistyle.hxx:454
sal_uInt8 mnBuiltinId
Formatting for this cell style.
Definition: xistyle.hxx:465
void CreateUserStyle(const OUString &rFinalName)
Creates the Calc style sheet, if this is a user-defined style.
Definition: xistyle.cxx:1553
OUString maName
Definition: xistyle.hxx:463
sal_uInt8 GetBuiltinId() const
Definition: xistyle.hxx:453
bool mbCustom
True = builtin style.
Definition: xistyle.hxx:468
Contains all XF records occurred in the file.
Definition: xistyle.hxx:478
sal_uInt16 GetFontIndex(sal_uInt16 nXFIndex) const
Returns the index to the Excel font used in the specified XF record.
Definition: xistyle.cxx:1591
const XclImpXF * GetXF(sal_uInt16 nXFIndex) const
Definition: xistyle.hxx:498
XclImpXFBuffer(const XclImpXFBuffer &)=delete
make noncopyable
::std::map< sal_uInt16, XclImpStyle * > XclImpStyleMap
Definition: xistyle.hxx:514
XclImpStyleList maBuiltinStyles
List of contents of all XF record.
Definition: xistyle.hxx:517
void ReadStyle(XclImpStream &rStrm)
Reads a STYLE record.
Definition: xistyle.cxx:1580
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Definition: xistyle.cxx:1565
const XclImpXFBuffer & operator=(const XclImpXFBuffer &)=delete
XclImpXF * GetXF(sal_uInt16 nXFIndex)
Returns the object that stores all contents of an XF record.
Definition: xistyle.hxx:495
const XclImpFont * GetFont(sal_uInt16 nXFIndex) const
Returns the Excel font used in the specified XF record.
Definition: xistyle.cxx:1597
void CreateUserStyles()
Creates all user defined style sheets.
Definition: xistyle.cxx:1613
XclImpStyleMap maStylesByXf
List of user defined cell styles.
Definition: xistyle.hxx:519
std::vector< std::unique_ptr< XclImpStyle > > XclImpStyleList
Definition: xistyle.hxx:513
XclImpStyleList maUserStyles
List of built-in cell styles.
Definition: xistyle.hxx:518
void ReadXF(XclImpStream &rStrm)
Reads an XF record.
Definition: xistyle.cxx:1573
ScStyleSheet * CreateStyleSheet(sal_uInt16 nXFIndex)
Creates a cell style sheet of the passed XF and inserts it into the Calc document.
Definition: xistyle.cxx:1681
std::vector< std::unique_ptr< XclImpXF > > maXFList
Definition: xistyle.hxx:516
Represents an XF record index with additional information.
Definition: xistyle.hxx:357
bool IsBoolCell() const
Definition: xistyle.hxx:363
XclImpXFIndex(sal_uInt16 nXFIndex, bool bBoolCell=false)
Definition: xistyle.hxx:359
sal_uInt16 mnXFIndex
Definition: xistyle.hxx:366
sal_uInt16 GetXFIndex() const
Definition: xistyle.hxx:362
bool mbBoolCell
The XF record index.
Definition: xistyle.hxx:367
Contains the XF indexes for every used cell in a single sheet.
Definition: xistyle.hxx:607
void SetBoolXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for boolean cells.
Definition: xistyle.cxx:1936
XclImpXFRangeBuffer(const XclImpXFRangeBuffer &)=delete
make noncopyable
void SetColumnDefXF(SCCOL nScCol, sal_uInt16 nXFIndex)
Inserts a new XF index for all cells in a column.
Definition: xistyle.cxx:1947
virtual ~XclImpXFRangeBuffer() override
Definition: xistyle.cxx:1884
void SetHyperlink(const XclRange &rXclRange, const OUString &rUrl)
Inserts a range of hyperlink cells.
Definition: xistyle.cxx:1974
std::vector< std::pair< XclRange, OUString > > maHyperlinks
Array of column XF index buffers.
Definition: xistyle.hxx:665
void SetBlankXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for blank cells.
Definition: xistyle.cxx:1931
void Finalize()
Applies styles and cell merging to the current sheet in the document.
Definition: xistyle.cxx:1985
void SetXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index.
Definition: xistyle.cxx:1926
XclImpXFInsertMode
Insertion mode of an XF index.
Definition: xistyle.hxx:642
@ xlXFModeBlank
Cell with a single Boolean value.
Definition: xistyle.hxx:645
@ xlXFModeRow
Blank cell.
Definition: xistyle.hxx:646
@ xlXFModeBoolCell
Filled cell.
Definition: xistyle.hxx:644
const XclImpXFRangeBuffer & operator=(const XclImpXFRangeBuffer &)=delete
void SetRowDefXF(SCROW nScRow, sal_uInt16 nXFIndex)
Inserts a new XF index for all cells in a row.
Definition: xistyle.cxx:1941
ScRangeList maMergeList
Maps URLs to hyperlink cells.
Definition: xistyle.hxx:666
std::vector< std::shared_ptr< XclImpXFRangeColumn > > maColumns
Definition: xistyle.hxx:663
void Initialize()
Clears all buffered data, used to set up for a new sheet.
Definition: xistyle.cxx:1888
void SetMerge(SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2)
Inserts a complete merged cell range.
Definition: xistyle.cxx:1979
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...
Definition: xistyle.cxx:1958
Contains the XF indexes for every used cell in a column.
Definition: xistyle.hxx:565
IndexList::iterator end()
Definition: xistyle.hxx:576
std::vector< std::unique_ptr< XclImpXFRange > > IndexList
Definition: xistyle.hxx:571
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).
Definition: xistyle.cxx:1729
const XclImpXFRangeColumn & operator=(const XclImpXFRangeColumn &)=delete
void Insert(XclImpXFRange *pXFRange, sal_uLong nIndex)
Insert a range into the list at the specified index.
Definition: xistyle.cxx:1795
void Find(XclImpXFRange *&rpPrevRange, XclImpXFRange *&rpNextRange, sal_uLong &rnNextIndex, SCROW nScRow)
Finds the previous and next row range from row position nScRow.
Definition: xistyle.cxx:1800
void TryConcatPrev(sal_uLong nIndex)
Tries to concatenate a range with its predecessor.
Definition: xistyle.cxx:1867
void SetDefaultXF(const XclImpXFIndex &rXFIndex, const XclImpRoot &rRoot)
Inserts a single row range into the list.
Definition: xistyle.cxx:1719
IndexList maIndexList
Definition: xistyle.hxx:602
IndexList::iterator begin()
Definition: xistyle.hxx:575
Contains an (encoded) XF index for a range of rows in a single column.
Definition: xistyle.hxx:526
bool Contains(SCROW nScRow) const
Returns true, if nScRow is contained in own row range.
Definition: xistyle.hxx:558
bool Expand(SCROW nScRow, const XclImpXFIndex &rXFIndex)
Returns true, if the range has been expanded.
Definition: xistyle.cxx:1689
XclImpXFIndex maXFIndex
The last row of an equal-formatted range.
Definition: xistyle.hxx:530
SCROW mnScRow1
Definition: xistyle.hxx:528
SCROW mnScRow2
The first row of an equal-formatted range.
Definition: xistyle.hxx:529
XclImpXFRange(SCROW nScRow, const XclImpXFIndex &rXFIndex)
Extended XF index.
Definition: xistyle.hxx:544
Contains all data of a XF record and a Calc item set.
Definition: xistyle.hxx:378
const ScPatternAttr & CreatePattern(bool bSkipPoolDefs=false)
Creates a Calc item set containing an item set with all cell properties.
Definition: xistyle.cxx:1245
XclImpCellBorder maBorder
All alignment attributes.
Definition: xistyle.hxx:435
XclImpCellProt maProtection
Calc cell style sheet.
Definition: xistyle.hxx:433
sal_uInt16 mnXclFont
Index to number format.
Definition: xistyle.hxx:438
ScStyleSheet * mpStyleSheet
Calc item set.
Definition: xistyle.hxx:431
virtual ~XclImpXF() override
Definition: xistyle.cxx:1108
XclImpCellArea maArea
Border line style.
Definition: xistyle.hxx:436
ScPatternAttrPtr mpPattern
Definition: xistyle.hxx:430
void ReadXF8(XclImpStream &rStrm)
Definition: xistyle.cxx:1207
void ReadXF3(XclImpStream &rStrm)
Definition: xistyle.cxx:1132
void SetUsedFlags(sal_uInt8 nUsedFlags)
Sets all "attribute used" flags according to the passed mask.
Definition: xistyle.cxx:1449
sal_uInt8 GetHorAlign() const
Definition: xistyle.hxx:390
void ReadXF2(XclImpStream &rStrm)
Definition: xistyle.cxx:1112
sal_uInt16 GetFontIndex() const
Definition: xistyle.hxx:391
void ReadXF(XclImpStream &rStrm)
Reads an XF record.
Definition: xistyle.cxx:1232
void ApplyPatternToAttrVector(::std::vector< ScAttrEntry > &rAttrs, SCROW nRow1, SCROW nRow2, sal_uInt32 nForceScNumFmt)
Definition: xistyle.cxx:1339
void ReadXF5(XclImpStream &rStrm)
Definition: xistyle.cxx:1184
XclImpCellAlign maAlignment
Cell protection flags.
Definition: xistyle.hxx:434
::std::unique_ptr< ScPatternAttr > ScPatternAttrPtr
Definition: xistyle.hxx:428
const XclImpXF & operator=(const XclImpXF &)=delete
XclImpXF(const XclImpXF &)=delete
make noncopyable
void ReadXF4(XclImpStream &rStrm)
Definition: xistyle.cxx:1158
void ApplyPattern(SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2, SCTAB nScTab)
Inserts all formatting attributes to the specified area in the Calc document.
Definition: xistyle.cxx:1411
sal_uInt16 mnXclNumFmt
Background area style.
Definition: xistyle.hxx:437
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.
Definition: xistyle.cxx:1427
Contains base members for XF record import/export.
Definition: xlstyle.hxx:563
void SvStream & rStrm
sal_uIntPtr sal_uLong
Contains all cell alignment attributes.
Definition: xlstyle.hxx:488
sal_uInt8 mnHorAlign
Definition: xlstyle.hxx:489
Contains background colors and pattern for a cell.
Definition: xlstyle.hxx:544
Contains color and line style for each cell border line.
Definition: xlstyle.hxx:523
Contains all cell protection attributes.
Definition: xlstyle.hxx:477
This struct helps reading and writing Excel fonts.
Definition: xlstyle.hxx:286
sal_uInt16 mnEscapem
Boldness: 400=normal, 700=bold.
Definition: xlstyle.hxx:292
Extends the XclCellAlign struct for import.
Definition: xistyle.hxx:265
void FillFromCF(sal_uInt16 nAlign, sal_uInt16 nMiscAttrib)
Fills this struct with CF record data.
Definition: xistyle.cxx:803
void FillFromXF8(sal_uInt16 nAlign, sal_uInt16 nMiscAttrib)
Fills this struct with BIFF8 XF record data.
Definition: xistyle.cxx:792
void FillToItemSet(SfxItemSet &rItemSet, const XclImpFont *pFont, bool bSkipPoolDefs=false) const
Inserts items representing this alignment style into the item set.
Definition: xistyle.cxx:814
void FillFromXF4(sal_uInt16 nAlign)
Fills this struct with BIFF4 XF record data.
Definition: xistyle.cxx:777
void FillFromXF3(sal_uInt16 nAlign)
Fills this struct with BIFF3 XF record data.
Definition: xistyle.cxx:771
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
Definition: xistyle.cxx:766
void FillFromXF5(sal_uInt16 nAlign)
Fills this struct with BIFF5/BIFF7 XF record data.
Definition: xistyle.cxx:784
Extends the XclCellArea struct for import.
Definition: xistyle.hxx:325
bool mbPattUsed
true = Background color used.
Definition: xistyle.hxx:328
void FillFromXF5(sal_uInt32 nArea)
Fills this struct with BIFF5/BIFF7 XF record data.
Definition: xistyle.cxx:1040
bool mbBackUsed
true = Foreground color used.
Definition: xistyle.hxx:327
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
Definition: xistyle.cxx:1024
void FillFromXF3(sal_uInt16 nArea)
Fills this struct with BIFF3/BIFF4 XF record data.
Definition: xistyle.cxx:1032
void FillFromXF8(sal_uInt32 nBorder2, sal_uInt16 nArea)
Fills this struct with BIFF8 XF record data.
Definition: xistyle.cxx:1048
void FillFromCF8(sal_uInt16 nPattern, sal_uInt16 nColor, sal_uInt32 nFlags)
Fills this struct with BIFF8 CF (conditional format) record data.
Definition: xistyle.cxx:1056
void SetUsedFlags(bool bUsed)
Sets colors and pattern state to used or unused.
Definition: xistyle.cxx:1019
XclImpCellArea()
true = Pattern used.
Definition: xistyle.cxx:1014
void FillToItemSet(SfxItemSet &rItemSet, const XclImpPalette &rPalette, bool bSkipPoolDefs=false) const
Inserts a brush item representing this area style into the item set.
Definition: xistyle.cxx:1077
Extends the XclCellBorder struct for import.
Definition: xistyle.hxx:287
void FillFromXF3(sal_uInt32 nBorder)
Fills this struct with BIFF3/BIFF4 XF record data.
Definition: xistyle.cxx:871
XclImpCellBorder()
true = Diagonal line style used.
Definition: xistyle.cxx:850
void FillFromXF5(sal_uInt32 nBorder, sal_uInt32 nArea)
Fills this struct with BIFF5/BIFF7 XF record data.
Definition: xistyle.cxx:884
void FillToItemSet(SfxItemSet &rItemSet, const XclImpPalette &rPalette, bool bSkipPoolDefs=false) const
Inserts a box item representing this border style into the item set.
Definition: xistyle.cxx:981
void FillFromXF2(sal_uInt8 nFlags)
Fills this struct with BIFF2 XF record data.
Definition: xistyle.cxx:861
void FillFromCF8(sal_uInt16 nLineStyle, sal_uInt32 nLineColor, sal_uInt32 nFlags)
Fills this struct with BIFF8 CF (conditional format) record data.
Definition: xistyle.cxx:917
void FillFromXF8(sal_uInt32 nBorder1, sal_uInt32 nBorder2)
Fills this struct with BIFF8 XF record data.
Definition: xistyle.cxx:897
bool HasAnyOuterBorder() const
Returns true, if any of the outer border lines is visible.
Definition: xistyle.cxx:934
void SetUsedFlags(bool bOuterUsed, bool bDiagUsed)
Sets outer line states and diagonal line states to used or unused.
Definition: xistyle.cxx:855
bool mbDiagUsed
true = Bottom line style used.
Definition: xistyle.hxx:292
bool mbRightUsed
true = Left line style used.
Definition: xistyle.hxx:289
bool mbBottomUsed
true = Top line style used.
Definition: xistyle.hxx:291
bool mbTopUsed
true = Right line style used.
Definition: xistyle.hxx:290
Extends the XclCellProt struct for import.
Definition: xistyle.hxx:251
void FillFromXF3(sal_uInt16 nProt)
Fills this struct with BIFF3-BIFF8 XF record data.
Definition: xistyle.cxx:755
void FillFromXF2(sal_uInt8 nNumFmt)
Fills this struct with BIFF2 XF record data.
Definition: xistyle.cxx:749
void FillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
Inserts items representing this protection style into the item set.
Definition: xistyle.cxx:761
A 2D cell range address struct with Excel column and row indexes.
Definition: xladdress.hxx:59
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
bool operator!=(const XclImpXFIndex &rLeft, const XclImpXFIndex &rRight)
Definition: xistyle.hxx:373
bool operator==(const XclImpXFIndex &rLeft, const XclImpXFIndex &rRight)
Definition: xistyle.hxx:370
XclFontItemType
Enumerates different types of Which-IDs for font items.
Definition: xlstyle.hxx:388
XclFontPropSetType
Enumerates different types for objects with font settings (using different property names).
Definition: xlstyle.hxx:396
const sal_uInt16 EXC_FONTESC_NONE
Definition: xlstyle.hxx:125
const sal_uInt8 EXC_STYLE_USERDEF
"Followed_Hyperlink" style.
Definition: xlstyle.hxx:234