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>
36#include <attarray.hxx>
37#include <vector>
38
39class ScPatternCache;
40
41namespace oox { class SequenceInputStream; }
42
43namespace oox { class PropertySet;
44 class PropertyMap;
45 class AttributeList; }
46
47namespace oox::xls {
48
49const sal_Int32 OOX_COLOR_WINDOWTEXT3 = 24;
50const sal_Int32 OOX_COLOR_WINDOWBACK3 = 25;
51const sal_Int32 OOX_COLOR_WINDOWTEXT = 64;
52const sal_Int32 OOX_COLOR_WINDOWBACK = 65;
53const sal_Int32 OOX_COLOR_BUTTONBACK = 67;
54const sal_Int32 OOX_COLOR_CHWINDOWTEXT = 77;
55const sal_Int32 OOX_COLOR_CHWINDOWBACK = 78;
56const sal_Int32 OOX_COLOR_CHBORDERAUTO = 79;
57const sal_Int32 OOX_COLOR_NOTEBACK = 80;
58const sal_Int32 OOX_COLOR_NOTETEXT = 81;
59const sal_Int32 OOX_COLOR_FONTAUTO = 0x7FFF;
60
61const sal_Int16 API_LINE_NONE = 0;
62const sal_Int16 API_LINE_HAIR = 1;
63const sal_Int16 API_LINE_THIN = 15;
64const sal_Int16 API_LINE_MEDIUM = 35;
65const sal_Int16 API_LINE_THICK = 50;
66
67const sal_Int16 API_ESCAPE_NONE = 0;
68const sal_Int16 API_ESCAPE_SUPERSCRIPT = 101;
69const sal_Int16 API_ESCAPE_SUBSCRIPT = -101;
70
73
78{
79public:
80 explicit ExcelGraphicHelper( const WorkbookHelper& rHelper );
81
83 virtual ::Color getSchemeColor( sal_Int32 nToken ) const override;
85 virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx ) const override;
86};
87
89{
90public:
92 void setAuto();
94 void setRgb( ::Color nRgbValue, double fTint = 0.0 );
96 void setTheme( sal_Int32 nThemeIdx, double fTint = 0.0 );
98 void setIndexed( sal_Int32 nPaletteIdx, double fTint = 0.0 );
99
101 void importColor( const AttributeList& rAttribs );
102
107
109 bool isAuto() const { return isPlaceHolder(); }
110};
111
113
116{
117public:
119 explicit ColorPalette( const WorkbookHelper& rHelper );
120
122 void importPaletteColor( const AttributeList& rAttribs );
125
127 ::Color getColor( sal_Int32 nPaletteIdx ) const;
128
129private:
131 void appendColor( ::Color nRGBValue );
132
133private:
134 ::std::vector< ::Color > maColors;
136};
137
140{
141 OUString maName;
143 sal_Int32 mnScheme;
144 sal_Int32 mnFamily;
145 sal_Int32 mnCharSet;
146 double mfHeight;
147 sal_Int32 mnUnderline;
148 sal_Int32 mnEscapement;
149 bool mbBold;
150 bool mbItalic;
153 bool mbShadow;
154
155 explicit FontModel();
156
157 void setBiff12Scheme( sal_uInt8 nScheme );
158 void setBiffHeight( sal_uInt16 nHeight );
159 void setBiffWeight( sal_uInt16 nWeight );
160 void setBiffUnderline( sal_uInt16 nUnderline );
161 void setBiffEscapement( sal_uInt16 nEscapement );
162};
163
166{
178
179 explicit ApiFontUsedFlags( bool bAllUsed );
180};
181
184{
185 OUString maName;
186 sal_Int16 mnFamily;
187 sal_Int16 mnTextEnc;
188
189 explicit ApiScriptFontName();
190};
191
194{
198 css::awt::FontDescriptor maDesc;
201 sal_Int16 mnEscapement;
204 bool mbShadow;
205
206 explicit ApiFontData();
207};
208
209class Font : public WorkbookHelper
210{
211public:
212 explicit Font( const WorkbookHelper& rHelper, bool bDxf );
213 explicit Font( const WorkbookHelper& rHelper, FontModel aModel );
214
216 void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
217
235 void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm );
236
239 const FontModel& getModel() const { return maModel; }
240
242 void finalizeImport();
243
245 const css::awt::FontDescriptor& getFontDescriptor() const { return maApiData.maDesc;}
249 bool needsRichTextFormat() const;
250
251 void fillToItemSet( SfxItemSet& rItemSet, bool bEditEngineText, bool bSkipPoolDefs = false ) const;
254 PropertyMap& rPropMap ) const;
257 PropertySet& rPropSet ) const;
258
259private:
263 bool mbDxf;
264};
265
266typedef std::shared_ptr< Font > FontRef;
267
270{
271 sal_Int32 mnHorAlign;
272 sal_Int32 mnVerAlign;
273 sal_Int32 mnTextDir;
274 sal_Int32 mnRotation;
275 sal_Int32 mnIndent;
277 bool mbShrink;
279
280 explicit AlignmentModel();
281
283 void setBiffHorAlign( sal_uInt8 nHorAlign );
285 void setBiffVerAlign( sal_uInt8 nVerAlign );
286};
287
290{
291 css::table::CellHoriJustify meHorJustify;
293 sal_Int32 mnVerJustify;
295 css::table::CellOrientation meOrientation;
297 sal_Int16 mnWritingMode;
298 sal_Int16 mnIndent;
300 bool mbShrink;
301
302 explicit ApiAlignmentData();
303};
304
305bool operator==( const ApiAlignmentData& rLeft, const ApiAlignmentData& rRight );
306
308{
309public:
310 explicit Alignment( const WorkbookHelper& rHelper );
311
313 void importAlignment( const AttributeList& rAttribs );
314
316 void setBiff12Data( sal_uInt32 nFlags );
317
319 void finalizeImport();
320
322 const AlignmentModel& getModel() const { return maModel; }
324 const ApiAlignmentData& getApiData() const { return maApiData; }
325
326 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
327
328private:
334};
335
338{
339 bool mbLocked;
340 bool mbHidden;
341
342 explicit ProtectionModel();
343};
344
347{
348 typedef css::util::CellProtection ApiCellProtection;
349
351
352 explicit ApiProtectionData();
353};
354
355bool operator==( const ApiProtectionData& rLeft, const ApiProtectionData& rRight );
356
358{
359public:
360 explicit Protection( const WorkbookHelper& rHelper );
361
363 void importProtection( const AttributeList& rAttribs );
364
366 void setBiff12Data( sal_uInt32 nFlags );
367
369 void finalizeImport();
370
372 const ApiProtectionData& getApiData() const { return maApiData; }
373
374 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
375private:
378};
379
382{
384 sal_Int32 mnStyle;
385 bool mbUsed;
386
387 explicit BorderLineModel( bool bDxf );
388
390 void setBiffStyle( sal_Int32 nLineStyle );
391};
392
395{
403
404 explicit BorderModel( bool bDxf );
405};
406
409{
410 typedef css::table::BorderLine2 ApiBorderLine;
411
424
425 explicit ApiBorderData();
426
428 bool hasAnyOuterBorder() const;
429};
430
431class Border : public WorkbookHelper
432{
433public:
434 explicit Border( const WorkbookHelper& rHelper, bool bDxf );
435
437 void importBorder( const AttributeList& rAttribs );
439 void importStyle( sal_Int32 nElement, const AttributeList& rAttribs );
441 void importColor( sal_Int32 nElement, const AttributeList& rAttribs );
442
446 void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm );
447
449 void finalizeImport( bool bRTL );
450
452 const ApiBorderData& getApiData() const { return maApiData; }
453
454 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
455
456private:
458 BorderLineModel* getBorderLine( sal_Int32 nElement );
459
462 css::table::BorderLine2& rBorderLine,
463 const BorderLineModel& rModel );
464
465private:
468 bool mbDxf;
469};
470
471typedef std::shared_ptr< Border > BorderRef;
472
475{
479 sal_Int32 mnPattern;
483
484 explicit PatternFillModel( bool bDxf );
485
487 void setBiffPattern( sal_Int32 nPattern );
488};
489
492{
493 typedef ::std::map< double, Color > ColorMap;
494
495 sal_Int32 mnType;
496 double mfAngle;
497 double mfLeft;
498 double mfRight;
499 double mfTop;
500 double mfBottom;
502
503 explicit GradientFillModel();
504
506 void readGradient( SequenceInputStream& rStrm );
508 void readGradientStop( SequenceInputStream& rStrm, bool bDxf );
509};
510
513{
518 bool mbUsed;
519
520 explicit ApiSolidFillData();
521};
522
524class Fill : public WorkbookHelper
525{
526public:
527 explicit Fill( const WorkbookHelper& rHelper, bool bDxf );
528
530 void importPatternFill( const AttributeList& rAttribs );
532 void importFgColor( const AttributeList& rAttribs );
534 void importBgColor( const AttributeList& rAttribs );
536 void importGradientFill( const AttributeList& rAttribs );
538 void importColor( const AttributeList& rAttribs, double fPosition );
539
552
554 void finalizeImport();
555
556 void fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
557
558private:
559 typedef std::shared_ptr< PatternFillModel > PatternModelRef;
560 typedef std::shared_ptr< GradientFillModel > GradientModelRef;
561
565 bool mbDxf;
566};
567
568typedef std::shared_ptr< Fill > FillRef;
569
572{
573 sal_Int32 mnStyleXfId;
574 sal_Int32 mnFontId;
575 sal_Int32 mnNumFmtId;
576 sal_Int32 mnBorderId;
577 sal_Int32 mnFillId;
578 bool mbCellXf;
585
586 explicit XfModel();
587};
588
589bool operator==( const XfModel& rXfModel1, const XfModel& rXfModel2 );
590
598class Xf : public WorkbookHelper
599{
600 friend bool operator==( const Xf& rXf1, const Xf& rXf2 );
601public:
602 struct AttrList
603 {
604 std::vector<ScAttrEntry> maAttrs;
607
608 AttrList(const ScPatternAttr* pDefPatternAttr);
609 };
610
611 explicit Xf( const WorkbookHelper& rHelper );
612
614 void importXf( const AttributeList& rAttribs, bool bCellXf );
616 void importAlignment( const AttributeList& rAttribs );
618 void importProtection( const AttributeList& rAttribs );
619
621 void importXf( SequenceInputStream& rStrm, bool bCellXf );
622
624 void finalizeImport();
625
627 bool isCellXf() const { return maModel.mbCellXf; }
628
630 FontRef getFont() const;
632 const Alignment& getAlignment() const { return maAlignment; }
633
635 AttrList& rAttrs, SCROW nRow1, SCROW nRow2, sal_Int32 nXfId,
636 sal_Int32 nForceScNumFmt, ScPatternCache& rCache );
637
638 void writeToDoc( ScDocumentImport& rDoc, const ScRange& rRange );
639
640 const ::ScPatternAttr& createPattern( bool bSkipPoolDefs = false );
641
642private:
643 typedef ::std::unique_ptr< ::ScPatternAttr > ScPatternAttrPtr;
644
646 sal_uInt32 mnScNumFmt;
647
651 sal_Int32 meRotationRef;
653};
654
655bool operator==( const Xf& rXf1, const Xf& rXf2 );
656
657typedef std::shared_ptr< Xf > XfRef;
658
659class Dxf : public WorkbookHelper
660{
661public:
662 explicit Dxf( const WorkbookHelper& rHelper );
663
665 FontRef const & createFont( bool bAlwaysNew = true );
667 BorderRef const & createBorder( bool bAlwaysNew = true );
669 FillRef const & createFill( bool bAlwaysNew = true );
670
672 void importNumFmt( const AttributeList& rAttribs );
673
676
678 void finalizeImport();
679
680 void fillToItemSet( SfxItemSet& rSet ) const;
681
682private:
685 std::shared_ptr< Alignment >
687 std::shared_ptr< Protection >
691};
692
693typedef std::shared_ptr< Dxf > DxfRef;
694
697{
698 OUString maName;
699 sal_Int32 mnXfId;
700 sal_Int32 mnBuiltinId;
701 sal_Int32 mnLevel;
703 bool mbCustom;
704 bool mbHidden;
705
706 explicit CellStyleModel();
707
709 bool isBuiltin() const;
711 bool isDefaultStyle() const;
712};
713
715{
716public:
717 explicit CellStyle( const WorkbookHelper& rHelper );
718
720 void importCellStyle( const AttributeList& rAttribs );
723
725 void createCellStyle();
728 void finalizeImport( const OUString& rFinalName );
729
731 const CellStyleModel& getModel() const { return maModel; }
733 const OUString& getFinalStyleName() const { return maFinalName; }
735private:
737 OUString maFinalName;
740
741};
742
743typedef std::shared_ptr< CellStyle > CellStyleRef;
744
746{
747public:
748 explicit CellStyleBuffer( const WorkbookHelper& rHelper );
749
751 CellStyleRef importCellStyle( const AttributeList& rAttribs );
754
756 void finalizeImport();
757
759 sal_Int32 getDefaultXfId() const;
761 OUString getDefaultStyleName() const;
763 OUString createCellStyle( sal_Int32 nXfId ) const;
764 ::ScStyleSheet* getCellStyleSheet( sal_Int32 nXfId ) const;
765
766private:
768 void insertCellStyle( CellStyleRef const & xCellStyle );
770 static OUString createCellStyle( const CellStyleRef& rxCellStyle );
771 static ::ScStyleSheet* getCellStyleSheet( const CellStyleRef& rxCellStyle );
772
773private:
776
781};
782
784{
785 sal_Int32 mnAutoFormatId;
792
793 explicit AutoFormatModel();
794};
795
797{
798public:
799 explicit StylesBuffer( const WorkbookHelper& rHelper );
800
804 NumberFormatRef createNumFmt( sal_Int32 nNumFmtId, std::u16string_view aFmtCode );
805 sal_Int32 nextFreeNumFmtId();
817
819 void importPaletteColor( const AttributeList& rAttribs );
821 NumberFormatRef importNumFmt( const AttributeList& rAttribs );
823 CellStyleRef importCellStyle( const AttributeList& rAttribs );
824
831
833 void finalizeImport();
834
836 ::Color getPaletteColor( sal_Int32 nIndex ) const;
838 FontRef getFont( sal_Int32 nFontId ) const;
840 BorderRef getBorder( sal_Int32 nBorderId ) const;
842 XfRef getCellXf( sal_Int32 nXfId ) const;
844 XfRef getStyleXf( sal_Int32 nXfId ) const;
845
847 FontRef getFontFromCellXf( sal_Int32 nXfId ) const;
849 FontRef getDefaultFont() const;
851 const FontModel& getDefaultFontModel() const;
852
854 static bool equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 );
856 static bool equalFills( sal_Int32 nFillId1, sal_Int32 nFillId2 );
857
859 OUString getDefaultStyleName() const;
861 OUString createCellStyle( sal_Int32 nXfId ) const;
862 ::ScStyleSheet* getCellStyleSheet( sal_Int32 nXfId ) const;
864 OUString createDxfStyle( sal_Int32 nDxfId ) const;
865 OUString createExtDxfStyle( sal_Int32 nDxfId ) const;
866
867 void writeFontToItemSet( SfxItemSet& rItemSet, sal_Int32 nFontId, bool bSkipPoolDefs ) const;
868 sal_uInt32 writeNumFmtToItemSet( SfxItemSet& rItemSet, sal_uInt32 nNumFmtId, bool bSkipPoolDefs ) const;
870 void writeBorderToItemSet( SfxItemSet& rItemSet, sal_Int32 nBorderId, bool bSkipPoolDefs ) const;
872 void writeFillToItemSet( SfxItemSet& rItemSet, sal_Int32 nFillId, bool bSkipPoolDefs ) const;
873
875 void writeCellXfToDoc( ScDocumentImport& rDoc, const ScRange& rRange, sal_Int32 nXfId ) const;
876 const RefVector< Dxf >& getExtDxfs() const { return maExtDxfs; }
877
878private:
884 typedef ::std::map< sal_Int32, OUString > DxfStyleMap;
885
897};
898
899} // namespace oox::xls
900
901/* 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
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
NumberFormatRef createNumFmt(sal_Int32 nNumFmtId, std::u16string_view aFmtCode)
Creates a number format.
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.
void applyPatternToAttrList(AttrList &rAttrs, SCROW nRow1, SCROW nRow2, sal_Int32 nXfId, sal_Int32 nForceScNumFmt, ScPatternCache &rCache)
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.
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.
model::ComplexColor maComplexColorBottom
model::ComplexColor maComplexColorLeft
Bottom 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 maTop
Right line format.
model::ComplexColor maComplexColorTop
bool hasAnyOuterBorder() const
Returns true, if any of the outer border lines is visible.
bool mbDiagUsed
True = left/right/top/bottom line format used.
model::ComplexColor maComplexColorRight
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 complex color.
ApiFontData()
True = shadowed chgaracters.
css::awt::FontDescriptor maDesc
Font name for complex scripts.
model::ComplexColor maComplexColor
Font color.
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.
model::ComplexColor maComplexColor
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