LibreOffice Module sc (master) 1
stylesbuffer.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 <memory>
23#include <com/sun/star/awt/FontDescriptor.hpp>
24#include <com/sun/star/table/CellHoriJustify.hpp>
25#include <com/sun/star/table/CellOrientation.hpp>
26#include <com/sun/star/table/BorderLine2.hpp>
27#include <com/sun/star/util/CellProtection.hpp>
30#include <oox/helper/refmap.hxx>
33#include <editeng/svxenum.hxx>
34#include <editeng/frmdir.hxx>
35#include <attarray.hxx>
36#include <vector>
37
38namespace oox { class SequenceInputStream; }
39
40namespace oox { class PropertySet;
41 class PropertyMap;
42 class AttributeList; }
43
44namespace oox::xls {
45
46const sal_Int32 OOX_COLOR_WINDOWTEXT3 = 24;
47const sal_Int32 OOX_COLOR_WINDOWBACK3 = 25;
48const sal_Int32 OOX_COLOR_WINDOWTEXT = 64;
49const sal_Int32 OOX_COLOR_WINDOWBACK = 65;
50const sal_Int32 OOX_COLOR_BUTTONBACK = 67;
51const sal_Int32 OOX_COLOR_CHWINDOWTEXT = 77;
52const sal_Int32 OOX_COLOR_CHWINDOWBACK = 78;
53const sal_Int32 OOX_COLOR_CHBORDERAUTO = 79;
54const sal_Int32 OOX_COLOR_NOTEBACK = 80;
55const sal_Int32 OOX_COLOR_NOTETEXT = 81;
56const sal_Int32 OOX_COLOR_FONTAUTO = 0x7FFF;
57
58const sal_Int16 API_LINE_NONE = 0;
59const sal_Int16 API_LINE_HAIR = 1;
60const sal_Int16 API_LINE_THIN = 15;
61const sal_Int16 API_LINE_MEDIUM = 35;
62const sal_Int16 API_LINE_THICK = 50;
63
64const sal_Int16 API_ESCAPE_NONE = 0;
65const sal_Int16 API_ESCAPE_SUPERSCRIPT = 101;
66const sal_Int16 API_ESCAPE_SUBSCRIPT = -101;
67
70
75{
76public:
77 explicit ExcelGraphicHelper( const WorkbookHelper& rHelper );
78
80 virtual ::Color getSchemeColor( sal_Int32 nToken ) const override;
82 virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx ) const override;
83};
84
86{
87public:
89 void setAuto();
91 void setRgb( ::Color nRgbValue, double fTint = 0.0 );
93 void setTheme( sal_Int32 nThemeIdx, double fTint = 0.0 );
95 void setIndexed( sal_Int32 nPaletteIdx, double fTint = 0.0 );
96
98 void importColor( const AttributeList& rAttribs );
99
104
106 bool isAuto() const { return isPlaceHolder(); }
107};
108
110
113{
114public:
116 explicit ColorPalette( const WorkbookHelper& rHelper );
117
119 void importPaletteColor( const AttributeList& rAttribs );
122
124 ::Color getColor( sal_Int32 nPaletteIdx ) const;
125
126private:
128 void appendColor( ::Color nRGBValue );
129
130private:
131 ::std::vector< ::Color > maColors;
133};
134
137{
138 OUString maName;
140 sal_Int32 mnScheme;
141 sal_Int32 mnFamily;
142 sal_Int32 mnCharSet;
143 double mfHeight;
144 sal_Int32 mnUnderline;
145 sal_Int32 mnEscapement;
146 bool mbBold;
147 bool mbItalic;
150 bool mbShadow;
151
152 explicit FontModel();
153
154 void setBiff12Scheme( sal_uInt8 nScheme );
155 void setBiffHeight( sal_uInt16 nHeight );
156 void setBiffWeight( sal_uInt16 nWeight );
157 void setBiffUnderline( sal_uInt16 nUnderline );
158 void setBiffEscapement( sal_uInt16 nEscapement );
159};
160
163{
175
176 explicit ApiFontUsedFlags( bool bAllUsed );
177};
178
181{
182 OUString maName;
183 sal_Int16 mnFamily;
184 sal_Int16 mnTextEnc;
185
186 explicit ApiScriptFontName();
187};
188
191{
195 css::awt::FontDescriptor maDesc;
197 sal_Int16 mnEscapement;
200 bool mbShadow;
201
202 explicit ApiFontData();
203};
204
205class Font : public WorkbookHelper
206{
207public:
208 explicit Font( const WorkbookHelper& rHelper, bool bDxf );
209 explicit Font( const WorkbookHelper& rHelper, const FontModel& rModel );
210
212 void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
213
231 void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm );
232
235 const FontModel& getModel() const { return maModel; }
236
238 void finalizeImport();
239
241 const css::awt::FontDescriptor& getFontDescriptor() const { return maApiData.maDesc;}
245 bool needsRichTextFormat() const;
246
247 void fillToItemSet( SfxItemSet& rItemSet, bool bEditEngineText, bool bSkipPoolDefs = false ) const;
250 PropertyMap& rPropMap ) const;
253 PropertySet& rPropSet ) const;
254
255private:
259 bool mbDxf;
260};
261
262typedef std::shared_ptr< Font > FontRef;
263
266{
267 sal_Int32 mnHorAlign;
268 sal_Int32 mnVerAlign;
269 sal_Int32 mnTextDir;
270 sal_Int32 mnRotation;
271 sal_Int32 mnIndent;
273 bool mbShrink;
275
276 explicit AlignmentModel();
277
279 void setBiffHorAlign( sal_uInt8 nHorAlign );
281 void setBiffVerAlign( sal_uInt8 nVerAlign );
282};
283
286{
287 css::table::CellHoriJustify meHorJustify;
289 sal_Int32 mnVerJustify;
291 css::table::CellOrientation meOrientation;
293 sal_Int16 mnWritingMode;
294 sal_Int16 mnIndent;
296 bool mbShrink;
297
298 explicit ApiAlignmentData();
299};
300
301bool operator==( const ApiAlignmentData& rLeft, const ApiAlignmentData& rRight );
302
304{
305public:
306 explicit Alignment( const WorkbookHelper& rHelper );
307
309 void importAlignment( const AttributeList& rAttribs );
310
312 void setBiff12Data( sal_uInt32 nFlags );
313
315 void finalizeImport();
316
318 const AlignmentModel& getModel() const { return maModel; }
320 const ApiAlignmentData& getApiData() const { return maApiData; }
321
322 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
323
324private:
330};
331
334{
335 bool mbLocked;
336 bool mbHidden;
337
338 explicit ProtectionModel();
339};
340
343{
344 typedef css::util::CellProtection ApiCellProtection;
345
347
348 explicit ApiProtectionData();
349};
350
351bool operator==( const ApiProtectionData& rLeft, const ApiProtectionData& rRight );
352
354{
355public:
356 explicit Protection( const WorkbookHelper& rHelper );
357
359 void importProtection( const AttributeList& rAttribs );
360
362 void setBiff12Data( sal_uInt32 nFlags );
363
365 void finalizeImport();
366
368 const ApiProtectionData& getApiData() const { return maApiData; }
369
370 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
371private:
374};
375
378{
380 sal_Int32 mnStyle;
381 bool mbUsed;
382
383 explicit BorderLineModel( bool bDxf );
384
386 void setBiffStyle( sal_Int32 nLineStyle );
387};
388
391{
399
400 explicit BorderModel( bool bDxf );
401};
402
405{
406 typedef css::table::BorderLine2 ApiBorderLine;
407
416
417 explicit ApiBorderData();
418
420 bool hasAnyOuterBorder() const;
421};
422
423class Border : public WorkbookHelper
424{
425public:
426 explicit Border( const WorkbookHelper& rHelper, bool bDxf );
427
429 void importBorder( const AttributeList& rAttribs );
431 void importStyle( sal_Int32 nElement, const AttributeList& rAttribs );
433 void importColor( sal_Int32 nElement, const AttributeList& rAttribs );
434
438 void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm );
439
441 void finalizeImport( bool bRTL );
442
444 const ApiBorderData& getApiData() const { return maApiData; }
445
446 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
447
448private:
450 BorderLineModel* getBorderLine( sal_Int32 nElement );
451
454 css::table::BorderLine2& rBorderLine,
455 const BorderLineModel& rModel );
456
457private:
460 bool mbDxf;
461};
462
463typedef std::shared_ptr< Border > BorderRef;
464
467{
471 sal_Int32 mnPattern;
475
476 explicit PatternFillModel( bool bDxf );
477
479 void setBiffPattern( sal_Int32 nPattern );
480};
481
484{
485 typedef ::std::map< double, Color > ColorMap;
486
487 sal_Int32 mnType;
488 double mfAngle;
489 double mfLeft;
490 double mfRight;
491 double mfTop;
492 double mfBottom;
494
495 explicit GradientFillModel();
496
498 void readGradient( SequenceInputStream& rStrm );
500 void readGradientStop( SequenceInputStream& rStrm, bool bDxf );
501};
502
505{
509 bool mbUsed;
510
511 explicit ApiSolidFillData();
512};
513
515class Fill : public WorkbookHelper
516{
517public:
518 explicit Fill( const WorkbookHelper& rHelper, bool bDxf );
519
521 void importPatternFill( const AttributeList& rAttribs );
523 void importFgColor( const AttributeList& rAttribs );
525 void importBgColor( const AttributeList& rAttribs );
527 void importGradientFill( const AttributeList& rAttribs );
529 void importColor( const AttributeList& rAttribs, double fPosition );
530
543
545 void finalizeImport();
546
547 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
548
549private:
550 typedef std::shared_ptr< PatternFillModel > PatternModelRef;
551 typedef std::shared_ptr< GradientFillModel > GradientModelRef;
552
556 bool mbDxf;
557};
558
559typedef std::shared_ptr< Fill > FillRef;
560
563{
564 sal_Int32 mnStyleXfId;
565 sal_Int32 mnFontId;
566 sal_Int32 mnNumFmtId;
567 sal_Int32 mnBorderId;
568 sal_Int32 mnFillId;
569 bool mbCellXf;
576
577 explicit XfModel();
578};
579
580bool operator==( const XfModel& rXfModel1, const XfModel& rXfModel2 );
581
589class Xf : public WorkbookHelper
590{
591 friend bool operator==( const Xf& rXf1, const Xf& rXf2 );
592public:
593 struct AttrList
594 {
595 std::vector<ScAttrEntry> maAttrs;
598
599 AttrList(const ScPatternAttr* pDefPatternAttr);
600 };
601
602 explicit Xf( const WorkbookHelper& rHelper );
603
605 void importXf( const AttributeList& rAttribs, bool bCellXf );
607 void importAlignment( const AttributeList& rAttribs );
609 void importProtection( const AttributeList& rAttribs );
610
612 void importXf( SequenceInputStream& rStrm, bool bCellXf );
613
615 void finalizeImport();
616
618 bool isCellXf() const { return maModel.mbCellXf; }
619
621 FontRef getFont() const;
623 const Alignment& getAlignment() const { return maAlignment; }
624
626 AttrList& rAttrs, SCROW nRow1, SCROW nRow2, sal_Int32 nForceScNumFmt );
627
628 void writeToDoc( ScDocumentImport& rDoc, const ScRange& rRange );
629
630 const ::ScPatternAttr& createPattern( bool bSkipPoolDefs = false );
631
632private:
633 typedef ::std::unique_ptr< ::ScPatternAttr > ScPatternAttrPtr;
634
636 sal_uInt32 mnScNumFmt;
637
641 sal_Int32 meRotationRef;
643};
644
645bool operator==( const Xf& rXf1, const Xf& rXf2 );
646
647typedef std::shared_ptr< Xf > XfRef;
648
649class Dxf : public WorkbookHelper
650{
651public:
652 explicit Dxf( const WorkbookHelper& rHelper );
653
655 FontRef const & createFont( bool bAlwaysNew = true );
657 BorderRef const & createBorder( bool bAlwaysNew = true );
659 FillRef const & createFill( bool bAlwaysNew = true );
660
662 void importNumFmt( const AttributeList& rAttribs );
663
666
668 void finalizeImport();
669
670 void fillToItemSet( SfxItemSet& rSet ) const;
671
672private:
675 std::shared_ptr< Alignment >
677 std::shared_ptr< Protection >
681};
682
683typedef std::shared_ptr< Dxf > DxfRef;
684
687{
688 OUString maName;
689 sal_Int32 mnXfId;
690 sal_Int32 mnBuiltinId;
691 sal_Int32 mnLevel;
693 bool mbCustom;
694 bool mbHidden;
695
696 explicit CellStyleModel();
697
699 bool isBuiltin() const;
701 bool isDefaultStyle() const;
702};
703
705{
706public:
707 explicit CellStyle( const WorkbookHelper& rHelper );
708
710 void importCellStyle( const AttributeList& rAttribs );
713
715 void createCellStyle();
718 void finalizeImport( const OUString& rFinalName );
719
721 const CellStyleModel& getModel() const { return maModel; }
723 const OUString& getFinalStyleName() const { return maFinalName; }
725private:
727 OUString maFinalName;
730
731};
732
733typedef std::shared_ptr< CellStyle > CellStyleRef;
734
736{
737public:
738 explicit CellStyleBuffer( const WorkbookHelper& rHelper );
739
741 CellStyleRef importCellStyle( const AttributeList& rAttribs );
744
746 void finalizeImport();
747
749 sal_Int32 getDefaultXfId() const;
751 OUString getDefaultStyleName() const;
753 OUString createCellStyle( sal_Int32 nXfId ) const;
754 ::ScStyleSheet* getCellStyleSheet( sal_Int32 nXfId ) const;
755
756private:
758 void insertCellStyle( CellStyleRef const & xCellStyle );
760 static OUString createCellStyle( const CellStyleRef& rxCellStyle );
761 static ::ScStyleSheet* getCellStyleSheet( const CellStyleRef& rxCellStyle );
762
763private:
766
771};
772
774{
775 sal_Int32 mnAutoFormatId;
782
783 explicit AutoFormatModel();
784};
785
787{
788public:
789 explicit StylesBuffer( const WorkbookHelper& rHelper );
790
794 NumberFormatRef createNumFmt( sal_Int32 nNumFmtId, const OUString& rFmtCode );
795 sal_Int32 nextFreeNumFmtId();
807
809 void importPaletteColor( const AttributeList& rAttribs );
811 NumberFormatRef importNumFmt( const AttributeList& rAttribs );
813 CellStyleRef importCellStyle( const AttributeList& rAttribs );
814
821
823 void finalizeImport();
824
826 ::Color getPaletteColor( sal_Int32 nIndex ) const;
828 FontRef getFont( sal_Int32 nFontId ) const;
830 BorderRef getBorder( sal_Int32 nBorderId ) const;
832 XfRef getCellXf( sal_Int32 nXfId ) const;
834 XfRef getStyleXf( sal_Int32 nXfId ) const;
835
837 FontRef getFontFromCellXf( sal_Int32 nXfId ) const;
839 FontRef getDefaultFont() const;
841 const FontModel& getDefaultFontModel() const;
842
844 static bool equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 );
846 static bool equalFills( sal_Int32 nFillId1, sal_Int32 nFillId2 );
847
849 OUString getDefaultStyleName() const;
851 OUString createCellStyle( sal_Int32 nXfId ) const;
852 ::ScStyleSheet* getCellStyleSheet( sal_Int32 nXfId ) const;
854 OUString createDxfStyle( sal_Int32 nDxfId ) const;
855 OUString createExtDxfStyle( sal_Int32 nDxfId ) const;
856
857 void writeFontToItemSet( SfxItemSet& rItemSet, sal_Int32 nFontId, bool bSkipPoolDefs ) const;
858 sal_uInt32 writeNumFmtToItemSet( SfxItemSet& rItemSet, sal_uInt32 nNumFmtId, bool bSkipPoolDefs ) const;
860 void writeBorderToItemSet( SfxItemSet& rItemSet, sal_Int32 nBorderId, bool bSkipPoolDefs ) const;
862 void writeFillToItemSet( SfxItemSet& rItemSet, sal_Int32 nFillId, bool bSkipPoolDefs ) const;
863
865 void writeCellXfToDoc( ScDocumentImport& rDoc, const ScRange& rRange, sal_Int32 nXfId ) const;
866 const RefVector< Dxf >& getExtDxfs() const { return maExtDxfs; }
867
868private:
874 typedef ::std::map< sal_Int32, OUString > DxfStyleMap;
875
887};
888
889} // namespace oox::xls
890
891/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Accessor class to ScDocument.
bool isPlaceHolder() const
ApiAlignmentData maApiData
Alignment model data.
::SvxCellVerJustify GetScVerAlign() const
::SvxFrameDirection GetScFrameDir() const
::SvxCellHorJustify GetScHorAlign() const
void finalizeImport()
Final processing after import of all style settings.
void setBiff12Data(sal_uInt32 nFlags)
Sets the alignment attributes from the passed BIFF12 XF record data.
Alignment(const WorkbookHelper &rHelper)
const ApiAlignmentData & getApiData() const
Returns the converted API alignment data struct.
void fillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
AlignmentModel maModel
const AlignmentModel & getModel() const
Returns the alignment model structure.
void importAlignment(const AttributeList &rAttribs)
Sets all attributes from the alignment element.
void finalizeImport(bool bRTL)
Final processing after import of all style settings.
const ApiBorderData & getApiData() const
Returns the converted API border data struct.
void importDxfBorder(sal_Int32 nElement, SequenceInputStream &rStrm)
Imports a border from a DXF record from the passed stream.
BorderModel maModel
BorderLineModel * getBorderLine(sal_Int32 nElement)
Returns the border line struct specified by the passed XML token identifier.
Border(const WorkbookHelper &rHelper, bool bDxf)
void importStyle(sal_Int32 nElement, const AttributeList &rAttribs)
Sets border attributes for the border line with the passed element identifier.
void importBorder(const AttributeList &rAttribs)
Sets global border attributes from the border element.
ApiBorderData maApiData
bool convertBorderLine(css::table::BorderLine2 &rBorderLine, const BorderLineModel &rModel)
Converts border line data to an API struct, returns true, if the line is marked as used.
void importColor(sal_Int32 nElement, const AttributeList &rAttribs)
Sets color attributes for the border line with the passed element identifier.
void fillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
void finalizeImport()
Final processing after import of all style settings.
CellStyleRef importCellStyle(const AttributeList &rAttribs)
Appends and returns a new named cell style object.
RefVector< CellStyle > CellStyleVector
OUString getDefaultStyleName() const
Returns the default style sheet for unused cells.
RefMap< sal_Int32, CellStyle > CellStyleXfIdMap
void insertCellStyle(CellStyleRef const &xCellStyle)
Inserts the passed cell style object into the internal maps.
CellStyleBuffer(const WorkbookHelper &rHelper)
CellStyleVector maUserStyles
All built-in cell styles.
CellStyleRef mxDefStyle
All cell styles, mapped by XF identifier.
sal_Int32 getDefaultXfId() const
Returns the XF identifier associated to the default cell style.
OUString createCellStyle(sal_Int32 nXfId) const
Creates the style sheet described by the style XF with the passed identifier.
CellStyleXfIdMap maStylesByXf
All user defined cell styles.
::ScStyleSheet * getCellStyleSheet(sal_Int32 nXfId) const
CellStyleVector maBuiltinStyles
bool mbCreated
Final style name used in API.
CellStyle(const WorkbookHelper &rHelper)
CellStyleModel maModel
void createCellStyle()
Creates the style sheet in the document described by this cell style object.
void finalizeImport(const OUString &rFinalName)
Stores the passed final style name and creates the cell style, if it is user-defined or modified buil...
const OUString & getFinalStyleName() const
Returns the final style name used in the document.
void importCellStyle(const AttributeList &rAttribs)
Imports passed attributes from the cellStyle element.
::ScStyleSheet * mpStyleSheet
True = style sheet created.
const CellStyleModel & getModel() const
Returns the cell style model structure.
::ScStyleSheet * getStyleSheet()
Stores all colors of the color palette.
::Color getColor(sal_Int32 nPaletteIdx) const
Returns the RGB value of the color with the passed index.
::std::vector< ::Color > maColors
size_t mnAppendIndex
List of RGB values.
ColorPalette(const WorkbookHelper &rHelper)
Constructs the color palette with predefined color values.
void importPaletteColor(const AttributeList &rAttribs)
Appends a new color from the passed attributes.
void appendColor(::Color nRGBValue)
Appends the passed color.
void setRgb(::Color nRgbValue, double fTint=0.0)
Sets the color to the passed RGB value.
void setTheme(sal_Int32 nThemeIdx, double fTint=0.0)
Sets the color to the passed theme index.
bool isAuto() const
Returns true, if the color is set to automatic.
void importColorId(SequenceInputStream &rStrm)
Imports a 32-bit palette color identifier from the passed BIFF12 stream.
void setIndexed(sal_Int32 nPaletteIdx, double fTint=0.0)
Sets the color to the passed palette index.
void setAuto()
Sets the color to automatic.
void importColor(const AttributeList &rAttribs)
Imports the color from the passed attribute list.
BorderRef mxBorder
Protection data.
Dxf(const WorkbookHelper &rHelper)
FillRef mxFill
Border data.
FontRef const & createFont(bool bAlwaysNew=true)
Creates a new empty font object.
std::shared_ptr< Protection > mxProtection
Alignment data.
BorderRef const & createBorder(bool bAlwaysNew=true)
Creates a new empty border object.
std::shared_ptr< Alignment > mxAlignment
Number format data.
void fillToItemSet(SfxItemSet &rSet) const
void finalizeImport()
Final processing after import of all style settings.
NumberFormatRef mxNumFmt
Font data.
void importNumFmt(const AttributeList &rAttribs)
Inserts a new number format code.
FillRef const & createFill(bool bAlwaysNew=true)
Creates a new empty fill object.
void importDxf(SequenceInputStream &rStrm)
Imports the DXF record from the passed stream.
Relative character height if escaped.
ExcelGraphicHelper(const WorkbookHelper &rHelper)
virtual ::Color getPaletteColor(sal_Int32 nPaletteIdx) const override
Derived classes may implement to resolve a palette index to an RGB color.
virtual ::Color getSchemeColor(sal_Int32 nToken) const override
Derived classes may implement to resolve a scheme color from the passed XML token identifier.
Contains cell fill attributes, either a pattern fill or a gradient fill.
void importFgColor(const AttributeList &rAttribs)
Sets the pattern color from the fgColor element.
void finalizeImport()
Final processing after import of all style settings.
void fillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
ApiSolidFillData maApiData
void importDxfGradient(SequenceInputStream &rStrm)
Imports gradient settings from a DXF record.
std::shared_ptr< PatternFillModel > PatternModelRef
GradientModelRef mxGradientModel
std::shared_ptr< GradientFillModel > GradientModelRef
void importColor(const AttributeList &rAttribs, double fPosition)
Sets a color from the color element in a gradient fill.
PatternModelRef mxPatternModel
void importDxfFgColor(SequenceInputStream &rStrm)
Imports the pattern color from a DXF record.
Fill(const WorkbookHelper &rHelper, bool bDxf)
void importPatternFill(const AttributeList &rAttribs)
Sets attributes of a patternFill element.
void importBgColor(const AttributeList &rAttribs)
Sets the background color from the bgColor element.
void importFill(SequenceInputStream &rStrm)
Imports the FILL record from the passed stream.
void importDxfStop(SequenceInputStream &rStrm)
Imports gradient stop settings from a DXF record.
void importDxfPattern(SequenceInputStream &rStrm)
Imports the fill pattern from a DXF record.
void importDxfBgColor(SequenceInputStream &rStrm)
Imports the background color from a DXF record.
void importGradientFill(const AttributeList &rAttribs)
Sets attributes of a gradientFill element.
const FontModel & getModel() const
Returns the font model structure.
ApiFontUsedFlags maUsedFlags
void importDxfHeight(SequenceInputStream &rStrm)
Imports the font height from a DXF record.
void importDxfColor(SequenceInputStream &rStrm)
Imports the font color from a DXF record.
void importAttribs(sal_Int32 nElement, const AttributeList &rAttribs)
Sets font formatting attributes for the passed element.
void importDxfName(SequenceInputStream &rStrm)
Imports the font name from a DXF record.
void fillToItemSet(SfxItemSet &rItemSet, bool bEditEngineText, bool bSkipPoolDefs=false) const
void importDxfWeight(SequenceInputStream &rStrm)
Imports the font weight from a DXF record.
void writeToPropertySet(PropertySet &rPropSet) const
Writes all font attributes to the passed property set.
bool needsRichTextFormat() const
Returns true, if the font requires rich text formatting in Calc.
void importDxfFlag(sal_Int32 nElement, SequenceInputStream &rStrm)
Imports a font style flag from a DXF record.
void importDxfScheme(SequenceInputStream &rStrm)
Imports the font scheme from a DXF record.
Font(const WorkbookHelper &rHelper, bool bDxf)
void writeToPropertyMap(PropertyMap &rPropMap) const
Writes all font attributes to the passed property map.
void finalizeImport()
Final processing after import of all style settings.
void importDxfEscapement(SequenceInputStream &rStrm)
Imports the font escapement style from a DXF record.
ApiFontData maApiData
const css::awt::FontDescriptor & getFontDescriptor() const
Returns an API font descriptor with own font information.
FontModel maModel
void importFont(SequenceInputStream &rStrm)
Imports the FONT record from the passed stream.
void importDxfUnderline(SequenceInputStream &rStrm)
Imports the font underline style from a DXF record.
void setBiff12Data(sal_uInt32 nFlags)
Sets the protection attributes from the passed BIFF12 XF record data.
void importProtection(const AttributeList &rAttribs)
Sets all attributes from the protection element.
Protection(const WorkbookHelper &rHelper)
void finalizeImport()
Final processing after import of all style settings.
const ApiProtectionData & getApiData() const
Returns the converted API protection data struct.
ApiProtectionData maApiData
Protection model data.
void fillToItemSet(SfxItemSet &rItemSet, bool bSkipPoolDefs=false) const
ProtectionModel maModel
NumberFormatsBuffer maNumFmts
List of font objects.
CellStyleRef importCellStyle(const AttributeList &rAttribs)
Appends and returns a new named cell style object.
XfRef getStyleXf(sal_Int32 nXfId) const
Returns the specified style format object.
const FontModel & getDefaultFontModel() const
Returns the model of the default application font (used in the "Normal" cell style).
FontRef createFont()
Creates a new empty font object.
::ScStyleSheet * getCellStyleSheet(sal_Int32 nXfId) const
static bool equalFills(sal_Int32 nFillId1, sal_Int32 nFillId2)
Returns true, if the specified fills are equal.
XfVector maCellXfs
List of cell area fill objects.
void writeFillToItemSet(SfxItemSet &rItemSet, sal_Int32 nFillId, bool bSkipPoolDefs) const
Writes the fill attributes of the specified fill data to the passed property map.
void writeCellXfToDoc(ScDocumentImport &rDoc, const ScRange &rRange, sal_Int32 nXfId) const
Writes the cell formatting attributes of the specified XF to the passed property set.
FontRef getFontFromCellXf(sal_Int32 nXfId) const
Returns the font object of the specified cell XF.
RefVector< Xf > XfVector
FontRef getFont(sal_Int32 nFontId) const
Returns the specified font object.
BorderRef createBorder()
Creates a new empty border object.
RefVector< Dxf > DxfVector
NumberFormatRef createNumFmt(sal_Int32 nNumFmtId, const OUString &rFmtCode)
Creates a number format.
static bool equalBorders(sal_Int32 nBorderId1, sal_Int32 nBorderId2)
Returns true, if the specified borders are equal.
OUString createDxfStyle(sal_Int32 nDxfId) const
Creates the style sheet described by the DXF with the passed identifier.
BorderRef getBorder(sal_Int32 nBorderId) const
Returns the specified border object.
RefVector< Font > FontVector
XfRef createCellXf()
Creates a new empty cell formatting object.
RefVector< Border > BorderVector
StylesBuffer(const WorkbookHelper &rHelper)
void writeFontToItemSet(SfxItemSet &rItemSet, sal_Int32 nFontId, bool bSkipPoolDefs) const
DxfStyleMap maDxfStyles
List of differential extlst cell styles.
NumberFormatRef importNumFmt(const AttributeList &rAttribs)
Inserts a new number format code.
BorderVector maBorders
List of all number format codes.
FontVector maFonts
Color palette.
::Color getPaletteColor(sal_Int32 nIndex) const
Returns the palette color with the specified index.
DxfVector maExtDxfs
List of differential cell styles.
FillRef createFill()
Creates a new empty fill object.
sal_uInt32 writeNumFmtToItemSet(SfxItemSet &rItemSet, sal_uInt32 nNumFmtId, bool bSkipPoolDefs) const
::std::map< sal_Int32, OUString > DxfStyleMap
XfVector maStyleXfs
List of cell formats.
XfRef createStyleXf()
Creates a new empty style formatting object.
FontRef getDefaultFont() const
Returns the default application font (used in the "Normal" cell style).
DxfVector maDxfs
All built-in and user defined cell styles.
FillVector maFills
List of cell border objects.
OUString getDefaultStyleName() const
Returns the default style sheet for unused cells.
DxfRef createDxf()
Creates a new empty differential formatting object.
void finalizeImport()
Final processing after import of all style settings.
void importPaletteColor(const AttributeList &rAttribs)
Appends a new color to the color palette.
OUString createExtDxfStyle(sal_Int32 nDxfId) const
const RefVector< Dxf > & getExtDxfs() const
OUString createCellStyle(sal_Int32 nXfId) const
Creates the style sheet described by the style XF with the passed identifier.
CellStyleBuffer maCellStyles
List of cell styles.
XfRef getCellXf(sal_Int32 nXfId) const
Returns the specified cell format object.
RefVector< Fill > FillVector
void writeBorderToItemSet(SfxItemSet &rItemSet, sal_Int32 nBorderId, bool bSkipPoolDefs) const
Writes the specified number format to the passed property map.
Helper class to provide access to global workbook data.
Represents a cell format or a cell style (called XF, extended format).
FontRef getFont() const
Returns the referred font object.
::std::unique_ptr< ::ScPatternAttr > ScPatternAttrPtr
XfModel maModel
Calc number format.
const ::ScPatternAttr & createPattern(bool bSkipPoolDefs=false)
void importXf(const AttributeList &rAttribs, bool bCellXf)
Sets all attributes from the xf element.
friend bool operator==(const Xf &rXf1, const Xf &rXf2)
void importAlignment(const AttributeList &rAttribs)
Sets all attributes from the alignment element.
void importProtection(const AttributeList &rAttribs)
Sets all attributes from the protection element.
sal_uInt32 mnScNumFmt
Calc item set.
::ScStyleSheet * mpStyleSheet
Rotation reference dependent on border.
void finalizeImport()
Final processing after import of all style settings.
Xf(const WorkbookHelper &rHelper)
void writeToDoc(ScDocumentImport &rDoc, const ScRange &rRange)
sal_Int32 meRotationRef
Cell protection data.
Alignment maAlignment
Cell XF or style XF model data.
Protection maProtection
Cell alignment data.
bool isCellXf() const
Returns true, if the XF is a cell XF, and false, if it is a style XF.
ScPatternAttrPtr mpPattern
const Alignment & getAlignment() const
Returns the alignment data of this style.
void applyPatternToAttrList(AttrList &rAttrs, SCROW nRow1, SCROW nRow2, sal_Int32 nForceScNumFmt)
SvxFrameDirection
sal_Int32 nIndex
void SvStream & rStrm
const sal_Int8 API_ESCAPEHEIGHT_NONE
Subscript: lower characters automatically (magic value -101).
const sal_Int16 API_ESCAPE_SUPERSCRIPT
No escapement.
const sal_Int32 OOX_COLOR_NOTETEXT
Note background color.
const sal_Int16 API_LINE_THICK
const sal_Int32 OOX_COLOR_WINDOWTEXT
System window background color (BIFF3-BIFF4).
std::shared_ptr< NumberFormat > NumberFormatRef
bool operator==(const ApiAlignmentData &rLeft, const ApiAlignmentData &rRight)
std::shared_ptr< Font > FontRef
const sal_Int32 OOX_COLOR_WINDOWBACK3
System window text color (BIFF3-BIFF4).
SequenceInputStream & operator>>(SequenceInputStream &rStrm, BinAddress &orPos)
const sal_Int16 API_LINE_MEDIUM
const sal_Int16 API_LINE_THIN
const sal_Int16 API_ESCAPE_SUBSCRIPT
Superscript: raise characters automatically (magic value 101).
const sal_Int32 OOX_COLOR_WINDOWTEXT3
std::shared_ptr< Border > BorderRef
std::shared_ptr< Dxf > DxfRef
const sal_Int16 API_LINE_NONE
Font auto color (system window text color).
std::shared_ptr< Fill > FillRef
const sal_Int32 OOX_COLOR_BUTTONBACK
System window background color (BIFF5+).
const sal_Int32 OOX_COLOR_FONTAUTO
Note text color.
const sal_Int32 OOX_COLOR_WINDOWBACK
System window text color (BIFF5+).
const sal_Int32 OOX_COLOR_NOTEBACK
Automatic frame border (BIFF8 charts).
const sal_Int8 API_ESCAPEHEIGHT_DEFAULT
Relative character height if not escaped.
std::shared_ptr< CellStyle > CellStyleRef
const sal_Int16 API_ESCAPE_NONE
const sal_Int32 OOX_COLOR_CHBORDERAUTO
System window background color (BIFF8 charts).
const sal_Int32 OOX_COLOR_CHWINDOWBACK
System window text color (BIFF8 charts).
const sal_Int16 API_LINE_HAIR
std::shared_ptr< Xf > XfRef
const sal_Int32 OOX_COLOR_CHWINDOWTEXT
System button background color (face color).
std::map< sal_Int32, STLPropertyMapEntry > PropertyMap
DefTokenId nToken
Definition: qproform.cxx:397
static SfxItemSet & rSet
Contains all XML cell alignment attributes, e.g.
sal_Int32 mnIndent
Text rotation angle.
void setBiffVerAlign(sal_uInt8 nVerAlign)
Sets vertical alignment from the passed BIFF data.
bool mbWrapText
Indentation.
AlignmentModel()
True = justify last line in block text.
sal_Int32 mnTextDir
Vertical alignment.
bool mbShrink
True = multi-line text.
bool mbJustLastLine
True = shrink to fit cell size.
sal_Int32 mnVerAlign
Horizontal alignment.
sal_Int32 mnRotation
CTL text direction.
void setBiffHorAlign(sal_uInt8 nHorAlign)
Sets horizontal alignment from the passed BIFF data.
Contains all API cell alignment attributes.
sal_Int32 mnHorJustifyMethod
Horizontal alignment.
Degree100 mnRotation
Normal or stacked text.
css::table::CellOrientation meOrientation
sal_Int16 mnIndent
CTL text direction.
bool mbShrink
True = multi-line text.
css::table::CellHoriJustify meHorJustify
bool mbWrapText
Indentation.
ApiAlignmentData()
True = shrink to fit cell size.
sal_Int32 mnVerJustifyMethod
Vertical alignment.
sal_Int16 mnWritingMode
Text rotation angle.
Contains API attributes of a complete cell border.
css::table::BorderLine2 ApiBorderLine
ApiBorderLine maRight
Left line format.
bool mbBorderUsed
Diagonal bottom-left to top-right line format.
ApiBorderLine maBLtoTR
Diagonal top-left to bottom-right line format.
ApiBorderData()
True = diagonal line format used.
ApiBorderLine maTLtoBR
Bottom line format.
ApiBorderLine maTop
Right line format.
bool hasAnyOuterBorder() const
Returns true, if any of the outer border lines is visible.
bool mbDiagUsed
True = left/right/top/bottom line format used.
ApiBorderLine maBottom
Top line format.
Contains all API font attributes.
::Color mnColor
Font descriptor (height in twips, weight in %).
ApiScriptFontName maLatinFont
sal_Int16 mnEscapement
Font color.
ApiFontData()
True = shadowed chgaracters.
css::awt::FontDescriptor maDesc
Font name for complex scripts.
sal_Int8 mnEscapeHeight
Escapement style.
ApiScriptFontName maAsianFont
Font name for latin scripts.
bool mbShadow
True = outlined characters.
bool mbOutline
Escapement font height.
ApiScriptFontName maCmplxFont
Font name for east-asian scripts.
Contains used flags for all API font attributes.
bool mbShadowUsed
True = outline style is used.
bool mbSchemeUsed
True = font color is used.
bool mbOutlineUsed
True = strike out style is used.
ApiFontUsedFlags(bool bAllUsed)
True = shadow style is used.
bool mbColorUsed
True = font name/family/char set are used.
bool mbStrikeoutUsed
True = font posture (italic) is used.
bool mbEscapementUsed
True = underline style is used.
bool mbHeightUsed
True = font scheme is used.
bool mbPostureUsed
True = font weight (boldness) is used.
bool mbWeightUsed
True = escapement style is used.
bool mbUnderlineUsed
True = font height is used.
Contains all API cell protection attributes.
css::util::CellProtection ApiCellProtection
ApiCellProtection maCellProt
Contains API font name, family, and charset for a script type.
sal_Int16 mnFamily
Font name.
sal_Int16 mnTextEnc
Font family.
ApiScriptFontName()
Font text encoding.
Contains API fill attributes.
bool mbTransparent
Fill color filtering.
ApiSolidFillData()
True = fill data is valid.
bool mbUsed
True = transparent area.
::Color mnFilterColor
Fill color.
bool mbApplyAlignment
True = apply font from autoformatting.
bool mbApplyNumFmt
Index of predefined autoformatting.
bool mbApplyFill
True = apply border from autoformatting.
bool mbApplyBorder
True = apply alignment from autoformatting.
bool mbApplyProtection
True = apply fill from autoformatting.
AutoFormatModel()
True = apply protection from autoformatting.
bool mbApplyFont
True = apply number format from autoformatting.
Contains XML attributes of a single border line.
bool mbUsed
Border line style.
sal_Int32 mnStyle
Borderline color.
void setBiffStyle(sal_Int32 nLineStyle)
Sets the passed BIFF line style.
BorderLineModel(bool bDxf)
True = line format used.
Contains XML attributes of a complete cell border.
bool mbDiagBLtoTR
True = top-left to bottom-right on.
BorderLineModel maBottom
Top line format.
bool mbDiagTLtoBR
Diagonal line format.
BorderLineModel maLeft
BorderModel(bool bDxf)
True = bottom-left to top-right on.
BorderLineModel maDiagonal
Bottom line format.
BorderLineModel maRight
Left line format.
BorderLineModel maTop
Right line format.
Contains attributes of a cell style, e.g.
bool mbHidden
True = customized builtin style.
bool isDefaultStyle() const
Returns true, if this style represents the default document cell style.
sal_Int32 mnXfId
Cell style name.
sal_Int32 mnLevel
Identifier for builtin styles.
CellStyleModel()
True = style not visible in GUI.
bool isBuiltin() const
Returns true, if this style is a builtin style.
bool mbCustom
True = builtin style.
sal_Int32 mnBuiltinId
Formatting for this cell style.
bool mbBuiltin
Level for builtin column/row styles.
Contains all XML font attributes, e.g.
bool mbShadow
True = outlined characters.
FontModel()
True = shadowed chgaracters.
bool mbItalic
True = bold characters.
sal_Int32 mnFamily
Major/minor scheme font.
void setBiff12Scheme(sal_uInt8 nScheme)
bool mbOutline
True = Strike out characters.
void setBiffEscapement(sal_uInt16 nEscapement)
sal_Int32 mnEscapement
Underline style.
sal_Int32 mnCharSet
Font family.
sal_Int32 mnScheme
Font color.
void setBiffUnderline(sal_uInt16 nUnderline)
sal_Int32 mnUnderline
Font height in points.
void setBiffHeight(sal_uInt16 nHeight)
bool mbBold
Escapement style.
double mfHeight
Windows font character set.
Color maColor
Font name.
void setBiffWeight(sal_uInt16 nWeight)
bool mbStrikeout
True = italic characters.
Contains XML gradient fill attributes from the gradientFill element.
double mfRight
Left convergence for type path.
double mfBottom
Top convergence for type path.
double mfLeft
Rotation angle for type linear.
double mfTop
Right convergence for type path.
void readGradient(SequenceInputStream &rStrm)
Reads BIFF12 gradient settings from a FILL or DXF record.
::std::map< double, Color > ColorMap
GradientFillModel()
Gradient colors.
ColorMap maColors
Bottom convergence for type path.
double mfAngle
Gradient type, linear or path.
void readGradientStop(SequenceInputStream &rStrm, bool bDxf)
Reads BIFF12 gradient stop settings from a FILL or DXF record.
Contains XML pattern fill attributes from the patternFill element.
PatternFillModel(bool bDxf)
True = pattern used.
void setBiffPattern(sal_Int32 nPattern)
Sets the passed BIFF pattern identifier.
Color maFilterPatternColor
Pattern foreground color.
Color maFillColor
Pattern foreground for color filter.
bool mbFillColorUsed
True = pattern foreground color used.
sal_Int32 mnPattern
Background fill color.
bool mbPattColorUsed
Pattern identifier (e.g. solid).
bool mbPatternUsed
True = background fill color used.
Contains all XML cell protection attributes, e.g.
ProtectionModel()
True = formula is hidden.
bool mbHidden
True = locked against editing.
Contains all data for a cell format or cell style.
bool mbFontUsed
True = cell XF, false = style XF.
sal_Int32 mnBorderId
Index to number format list.
XfModel()
True = area data used.
bool mbAreaUsed
True = border data used.
sal_Int32 mnNumFmtId
Index to font data list.
bool mbNumFmtUsed
True = font index used.
sal_Int32 mnFillId
Index to list of cell borders.
bool mbAlignUsed
True = number format used.
bool mbCellXf
Index to list of cell areas.
bool mbProtUsed
True = alignment used.
sal_Int32 mnFontId
Index to parent style XF.
bool mbBorderUsed
True = cell protection used.
AttrList(const ScPatternAttr *pDefPatternAttr)
std::vector< ScAttrEntry > maAttrs
const ScPatternAttr * mpDefPattern
SvxCellHorJustify
SvxCellVerJustify
unsigned char sal_uInt8
signed char sal_Int8
sal_Int32 SCROW
Definition: types.hxx:17