diff options
Diffstat (limited to 'oox/inc/oox/xls/stylesbuffer.hxx')
-rw-r--r-- | oox/inc/oox/xls/stylesbuffer.hxx | 126 |
1 files changed, 73 insertions, 53 deletions
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx index 4fa9c964108e..64a56968aa37 100644 --- a/oox/inc/oox/xls/stylesbuffer.hxx +++ b/oox/inc/oox/xls/stylesbuffer.hxx @@ -29,14 +29,15 @@ #define OOX_XLS_STYLESBUFFER_HXX #include <com/sun/star/awt/FontDescriptor.hpp> -#include <com/sun/star/util/CellProtection.hpp> #include <com/sun/star/table/CellHoriJustify.hpp> #include <com/sun/star/table/CellOrientation.hpp> #include <com/sun/star/table/CellVertJustify.hpp> #include <com/sun/star/table/TableBorder.hpp> -#include "oox/helper/containerhelper.hxx" -#include "oox/helper/graphichelper.hxx" +#include <com/sun/star/util/CellProtection.hpp> #include "oox/drawingml/color.hxx" +#include "oox/helper/graphichelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" #include "oox/xls/numberformatsbuffer.hxx" namespace com { namespace sun { namespace star { @@ -111,11 +112,11 @@ public: void importColor( const AttributeList& rAttribs ); /** Imports a 64-bit color from the passed binary stream. */ - void importColor( RecordInputStream& rStrm ); - /** Imports a 32-bit palette color identifier from the passed OOBIN stream. */ - void importColorId( RecordInputStream& rStrm ); - /** Imports a 32-bit RGBA color value from the passed OOBIN stream. */ - void importColorRgb( RecordInputStream& rStrm ); + void importColor( SequenceInputStream& rStrm ); + /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */ + void importColorId( SequenceInputStream& rStrm ); + /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */ + void importColorRgb( SequenceInputStream& rStrm ); /** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */ void importColorId( BiffInputStream& rStrm, bool b16Bit = true ); @@ -128,7 +129,7 @@ public: // ---------------------------------------------------------------------------- -RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor ); +SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor ); // ============================================================================ @@ -142,9 +143,11 @@ public: /** Appends a new color from the passed attributes. */ void importPaletteColor( const AttributeList& rAttribs ); /** Appends a new color from the passed RGBCOLOR record. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); + /** Imports a color palette from a UNO sequence in the passed any. */ + void importPalette( const ::com::sun::star::uno::Any& rPalette ); /** Rturns the RGB value of the color with the passed index. */ sal_Int32 getColor( sal_Int32 nPaletteIdx ) const; @@ -179,7 +182,7 @@ struct FontModel explicit FontModel(); - void setBinScheme( sal_uInt8 nScheme ); + void setBiff12Scheme( sal_uInt8 nScheme ); void setBiffHeight( sal_uInt16 nHeight ); void setBiffWeight( sal_uInt16 nWeight ); void setBiffUnderline( sal_uInt16 nUnderline ); @@ -259,23 +262,23 @@ public: void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the FONT record from the passed stream. */ - void importFont( RecordInputStream& rStrm ); + void importFont( SequenceInputStream& rStrm ); /** Imports the font name from a DXF record. */ - void importDxfName( RecordInputStream& rStrm ); + void importDxfName( SequenceInputStream& rStrm ); /** Imports the font color from a DXF record. */ - void importDxfColor( RecordInputStream& rStrm ); + void importDxfColor( SequenceInputStream& rStrm ); /** Imports the font scheme from a DXF record. */ - void importDxfScheme( RecordInputStream& rStrm ); + void importDxfScheme( SequenceInputStream& rStrm ); /** Imports the font height from a DXF record. */ - void importDxfHeight( RecordInputStream& rStrm ); + void importDxfHeight( SequenceInputStream& rStrm ); /** Imports the font weight from a DXF record. */ - void importDxfWeight( RecordInputStream& rStrm ); + void importDxfWeight( SequenceInputStream& rStrm ); /** Imports the font underline style from a DXF record. */ - void importDxfUnderline( RecordInputStream& rStrm ); + void importDxfUnderline( SequenceInputStream& rStrm ); /** Imports the font escapement style from a DXF record. */ - void importDxfEscapement( RecordInputStream& rStrm ); + void importDxfEscapement( SequenceInputStream& rStrm ); /** Imports a font style flag from a DXF record. */ - void importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Imports the FONT record from the passed stream. */ void importFont( BiffInputStream& rStrm ); @@ -346,12 +349,12 @@ struct AlignmentModel explicit AlignmentModel(); - /** Sets horizontal alignment from the passed OOBIN or BIFF data. */ - void setBinHorAlign( sal_uInt8 nHorAlign ); - /** Sets vertical alignment from the passed OOBIN or BIFF data. */ - void setBinVerAlign( sal_uInt8 nVerAlign ); - /** Sets rotation from the passed OOBIN or BIFF text orientation. */ - void setBinTextOrient( sal_uInt8 nTextOrient ); + /** Sets horizontal alignment from the passed BIFF data. */ + void setBiffHorAlign( sal_uInt8 nHorAlign ); + /** Sets vertical alignment from the passed BIFF data. */ + void setBiffVerAlign( sal_uInt8 nVerAlign ); + /** Sets rotation from the passed BIFF text orientation. */ + void setBiffTextOrient( sal_uInt8 nTextOrient ); }; // ---------------------------------------------------------------------------- @@ -387,8 +390,8 @@ public: /** Sets all attributes from the alignment element. */ void importAlignment( const AttributeList& rAttribs ); - /** Sets the alignment attributes from the passed OOBIN XF record data. */ - void setBinData( sal_uInt32 nFlags ); + /** Sets the alignment attributes from the passed BIFF12 XF record data. */ + void setBiff12Data( sal_uInt32 nFlags ); /** Sets the alignment attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); /** Sets the alignment attributes from the passed BIFF3 XF record data. */ @@ -453,8 +456,8 @@ public: /** Sets all attributes from the protection element. */ void importProtection( const AttributeList& rAttribs ); - /** Sets the protection attributes from the passed OOBIN XF record data. */ - void setBinData( sal_uInt32 nFlags ); + /** Sets the protection attributes from the passed BIFF12 XF record data. */ + void setBiff12Data( sal_uInt32 nFlags ); /** Sets the protection attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nNumFmt ); /** Sets the protection attributes from the passed BIFF3-BIFF8 XF record data. */ @@ -489,7 +492,7 @@ struct BorderLineModel explicit BorderLineModel( bool bDxf ); - /** Sets the passed OOBIN or BIFF line style. */ + /** Sets the passed BIFF line style. */ void setBiffStyle( sal_Int32 nLineStyle ); /** Sets line style and line color from the passed BIFF data. */ void setBiffData( sal_uInt8 nLineStyle, sal_uInt16 nLineColor ); @@ -548,9 +551,9 @@ public: void importColor( sal_Int32 nElement, const AttributeList& rAttribs ); /** Imports the BORDER record from the passed stream. */ - void importBorder( RecordInputStream& rStrm ); + void importBorder( SequenceInputStream& rStrm ); /** Imports a border from a DXF record from the passed stream. */ - void importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm ); + void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Sets the border attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -605,8 +608,8 @@ struct PatternFillModel explicit PatternFillModel( bool bDxf ); - /** Sets the passed OOBIN or BIFF pattern identifier. */ - void setBinPattern( sal_Int32 nPattern ); + /** Sets the passed BIFF pattern identifier. */ + void setBiffPattern( sal_Int32 nPattern ); /** Sets the pattern and pattern colors from the passed BIFF data. */ void setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillColor, sal_uInt8 nPattern ); }; @@ -628,10 +631,10 @@ struct GradientFillModel explicit GradientFillModel(); - /** Reads OOBIN gradient settings from a FILL or DXF record. */ - void readGradient( RecordInputStream& rStrm ); - /** Reads OOBIN gradient stop settings from a FILL or DXF record. */ - void readGradientStop( RecordInputStream& rStrm, bool bDxf ); + /** Reads BIFF12 gradient settings from a FILL or DXF record. */ + void readGradient( SequenceInputStream& rStrm ); + /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */ + void readGradientStop( SequenceInputStream& rStrm, bool bDxf ); }; // ---------------------------------------------------------------------------- @@ -668,17 +671,17 @@ public: void importColor( const AttributeList& rAttribs, double fPosition ); /** Imports the FILL record from the passed stream. */ - void importFill( RecordInputStream& rStrm ); + void importFill( SequenceInputStream& rStrm ); /** Imports the fill pattern from a DXF record. */ - void importDxfPattern( RecordInputStream& rStrm ); + void importDxfPattern( SequenceInputStream& rStrm ); /** Imports the pattern color from a DXF record. */ - void importDxfFgColor( RecordInputStream& rStrm ); + void importDxfFgColor( SequenceInputStream& rStrm ); /** Imports the background color from a DXF record. */ - void importDxfBgColor( RecordInputStream& rStrm ); + void importDxfBgColor( SequenceInputStream& rStrm ); /** Imports gradient settings from a DXF record. */ - void importDxfGradient( RecordInputStream& rStrm ); + void importDxfGradient( SequenceInputStream& rStrm ); /** Imports gradient stop settings from a DXF record. */ - void importDxfStop( RecordInputStream& rStrm ); + void importDxfStop( SequenceInputStream& rStrm ); /** Sets the fill attributes from the passed BIFF2 XF record data. */ void setBiff2Data( sal_uInt8 nFlags ); @@ -762,7 +765,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the XF record from the passed stream. */ - void importXf( RecordInputStream& rStrm, bool bCellXf ); + void importXf( SequenceInputStream& rStrm, bool bCellXf ); /** Imports the XF record from the passed stream. */ void importXf( BiffInputStream& rStrm ); @@ -823,7 +826,7 @@ public: void importProtection( const AttributeList& rAttribs ); /** Imports the DXF record from the passed stream. */ - void importDxf( RecordInputStream& rStrm ); + void importDxf( SequenceInputStream& rStrm ); /** Imports font, border, and fill settings from the CFRULE record. */ void importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags ); @@ -878,7 +881,7 @@ public: /** Imports passed attributes from the cellStyle element. */ void importCellStyle( const AttributeList& rAttribs ); /** Imports style settings from a CELLSTYLE record. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports style settings from a STYLE record. */ void importStyle( BiffInputStream& rStrm ); @@ -911,7 +914,7 @@ public: /** Appends and returns a new named cell style object. */ CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Imports the CELLSTYLE record from the passed stream. */ - CellStyleRef importCellStyle( RecordInputStream& rStrm ); + CellStyleRef importCellStyle( SequenceInputStream& rStrm ); /** Imports the STYLE record from the passed stream. */ CellStyleRef importStyle( BiffInputStream& rStrm ); @@ -943,6 +946,21 @@ private: // ============================================================================ +struct AutoFormatModel +{ + sal_Int32 mnAutoFormatId; /// Index of predefined autoformatting. + bool mbApplyNumFmt; /// True = apply number format from autoformatting. + bool mbApplyFont; /// True = apply font from autoformatting. + bool mbApplyAlignment; /// True = apply alignment from autoformatting. + bool mbApplyBorder; /// True = apply border from autoformatting. + bool mbApplyFill; /// True = apply fill from autoformatting. + bool mbApplyProtection; /// True = apply protection from autoformatting. + + explicit AutoFormatModel(); +}; + +// ============================================================================ + class StylesBuffer : public WorkbookHelper { public: @@ -977,11 +995,11 @@ public: CellStyleRef importCellStyle( const AttributeList& rAttribs ); /** Appends a new color to the color palette. */ - void importPaletteColor( RecordInputStream& rStrm ); + void importPaletteColor( SequenceInputStream& rStrm ); /** Imports the NUMFMT record from the passed stream. */ - void importNumFmt( RecordInputStream& rStrm ); + void importNumFmt( SequenceInputStream& rStrm ); /** Imports the CELLSTYLE record from the passed stream. */ - void importCellStyle( RecordInputStream& rStrm ); + void importCellStyle( SequenceInputStream& rStrm ); /** Imports the PALETTE record from the passed stream. */ void importPalette( BiffInputStream& rStrm ); @@ -996,6 +1014,9 @@ public: /** Imports the STYLE record from the passed stream. */ void importStyle( BiffInputStream& rStrm ); + /** Imports a color palette from a UNO sequence in the passed any. */ + void importPalette( const ::com::sun::star::uno::Any& rPalette ); + /** Final processing after import of all style settings. */ void finalizeImport(); @@ -1075,4 +1096,3 @@ private: } // namespace oox #endif - |