24#include <oox/token/namespaces.hxx>
25#include <oox/token/tokens.hxx>
38 switch( getCurrentElement() )
40 case XLS_TOKEN( indexedColors ):
49 switch( getCurrentElement() )
61 mxFont->importAttribs( nElement, rAttribs );
67 if(
mxBorder && (getCurrentElement() == XLS_TOKEN( border )) )
73 if(
mxBorder )
switch( getCurrentElement() )
75 case XLS_TOKEN( border ):
76 mxBorder->importStyle( nElement, rAttribs );
80 if( nElement == XLS_TOKEN(
color ) )
81 mxBorder->importColor( getCurrentElement(), rAttribs );
88 if(
mxFill )
switch( getCurrentElement() )
90 case XLS_TOKEN( fill ):
93 case XLS_TOKEN( patternFill ):
mxFill->importPatternFill( rAttribs );
return this;
94 case XLS_TOKEN( gradientFill ):
mxFill->importGradientFill( rAttribs );
return this;
97 case XLS_TOKEN( patternFill ):
100 case XLS_TOKEN( fgColor ):
mxFill->importFgColor( rAttribs );
break;
101 case XLS_TOKEN( bgColor ):
mxFill->importBgColor( rAttribs );
break;
104 case XLS_TOKEN( gradientFill ):
105 if( nElement == XLS_TOKEN(
stop ) )
111 case XLS_TOKEN(
stop ):
112 if( nElement == XLS_TOKEN(
color ) )
121 if(
mxXf && (getCurrentElement() == XLS_TOKEN( xf )) )
127 if(
mxXf )
switch( getCurrentElement() )
129 case XLS_TOKEN( xf ):
132 case XLS_TOKEN( alignment ):
mxXf->importAlignment( rAttribs );
break;
133 case XLS_TOKEN( protection ):
mxXf->importProtection( rAttribs );
break;
142 if(
mxDxf )
switch( getCurrentElement() )
144 case XLS_TOKEN( dxf ):
147 case XLS_TOKEN( font ):
return new FontContext( *
this,
mxDxf->createFont() );
149 case XLS_TOKEN( fill ):
return new FillContext( *
this,
mxDxf->createFill() );
151 case XLS_TOKEN( numFmt ):
mxDxf->importNumFmt( rAttribs );
break;
153 case XLS_TOKEN( alignment ):
mxDxf->importAlignment( rAttribs );
break;
154 case XLS_TOKEN( protection ):
mxDxf->importProtection( rAttribs );
break;
160 if(
mxExtDxf )
switch( getCurrentElement() )
162 case XLS14_TOKEN( dxf ):
168 case XLS_TOKEN( numFmt ):
mxExtDxf->importNumFmt( rAttribs );
break;
182 switch( getCurrentElement() )
185 if( nElement == XLS_TOKEN( styleSheet ) )
return this;
188 case XLS_TOKEN( styleSheet ):
191 case XLS_TOKEN( colors ):
192 case XLS_TOKEN( numFmts ):
193 case XLS_TOKEN(
fonts ):
194 case XLS_TOKEN( borders ):
195 case XLS_TOKEN( fills ):
196 case XLS_TOKEN( cellXfs ):
197 case XLS_TOKEN( cellStyleXfs ):
198 case XLS_TOKEN( dxfs ):
199 case XLS_TOKEN( cellStyles ):
return this;
203 case XLS_TOKEN( colors ):
206 case XLS_TOKEN( numFmts ):
209 case XLS_TOKEN(
fonts ):
212 case XLS_TOKEN( borders ):
215 case XLS_TOKEN( fills ):
218 case XLS_TOKEN( cellXfs ):
219 if( nElement == XLS_TOKEN( xf ) )
return new XfContext( *
this,
getStyles().createCellXf(),
true );
221 case XLS_TOKEN( cellStyleXfs ):
222 if( nElement == XLS_TOKEN( xf ) )
return new XfContext( *
this,
getStyles().createStyleXf(),
false );
224 case XLS_TOKEN( dxfs ):
225 if( nElement == XLS_TOKEN( dxf ) )
return new DxfContext( *
this,
getStyles().createDxf() );
227 case XLS_TOKEN( cellStyles ):
236 switch( getCurrentElement() )
290 static const RecordInfo spRecInfos[] =
std::optional< double > getDouble(sal_Int32 nAttrToken) const
virtual void onStartElement(const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
IndexedColorsContext(WorkbookFragmentBase &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
CellStyleRef importCellStyle(const AttributeList &rAttribs)
Appends and returns a new named cell style object.
FontRef createFont()
Creates a new empty font object.
BorderRef createBorder()
Creates a new empty border object.
XfRef createCellXf()
Creates a new empty cell formatting object.
NumberFormatRef importNumFmt(const AttributeList &rAttribs)
Inserts a new number format code.
FillRef createFill()
Creates a new empty fill object.
XfRef createStyleXf()
Creates a new empty style formatting object.
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.
StylesFragment(const WorkbookHelper &rHelper, const OUString &rFragmentPath)
virtual void finalizeImport() override
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
Context handler derived from the WorkbookHelper helper class.
Fragment handler derived from the WorkbookHelper helper class.
Helper class to provide access to global workbook data.
StylesBuffer & getStyles() const
Returns all cell formatting objects read from the styles substream.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onStartElement(const AttributeList &rAttribs) override
const sal_Int32 XML_ROOT_CONTEXT
const sal_Int32 BIFF12_ID_MRUCOLORS
const sal_Int32 BIFF12_ID_CELLXFS
const sal_Int32 BIFF12_ID_XF
const sal_Int32 BIFF12_ID_NUMFMT
const sal_Int32 BIFF12_ID_NUMFMTS
const sal_Int32 BIFF12_ID_FILLS
const sal_Int32 BIFF12_ID_TABLESTYLES
const sal_Int32 BIFF12_ID_BORDERS
const sal_Int32 BIFF12_ID_DXF
const sal_Int32 BIFF12_ID_FILL
const sal_Int32 BIFF12_ID_STYLESHEET
const sal_Int32 BIFF12_ID_COLORS
const sal_Int32 BIFF12_ID_CELLSTYLEXFS
const sal_Int32 BIFF12_ID_RGBCOLOR
const sal_Int32 BIFF12_ID_BORDER
const sal_Int32 BIFF12_ID_DXFS
const sal_Int32 BIFF12_ID_CELLSTYLES
const sal_Int32 BIFF12_ID_CELLSTYLE
const sal_Int32 BIFF12_ID_INDEXEDCOLORS
const sal_Int32 BIFF12_ID_FONTS
const sal_Int32 BIFF12_ID_FONT