diff options
118 files changed, 817 insertions, 780 deletions
diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.cxx b/dbaccess/source/filter/xml/xmlAutoStyle.cxx index c9e328867b7a..52b141358fdc 100644 --- a/dbaccess/source/filter/xml/xmlAutoStyle.cxx +++ b/dbaccess/source/filter/xml/xmlAutoStyle.cxx @@ -28,7 +28,7 @@ namespace dbaxml void OXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -36,7 +36,7 @@ void OXMLAutoStylePoolP::exportStyleAttributes( ) const { SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if ( nFamily == XML_STYLE_FAMILY_TABLE_COLUMN ) + if ( nFamily == XmlStyleFamily::TABLE_COLUMN ) { rtl::Reference< XMLPropertySetMapper > aPropMapper = rODBExport.GetColumnStylesPropertySetMapper(); for (auto const& property : rProperties) diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.hxx b/dbaccess/source/filter/xml/xmlAutoStyle.hxx index c8316cd7f1db..7287d4ef4320 100644 --- a/dbaccess/source/filter/xml/xmlAutoStyle.hxx +++ b/dbaccess/source/filter/xml/xmlAutoStyle.hxx @@ -32,7 +32,7 @@ namespace dbaxml virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx index 50e56df9ef41..07dcc09ed7f8 100644 --- a/dbaccess/source/filter/xml/xmlColumn.cxx +++ b/dbaccess/source/filter/xml/xmlColumn.cxx @@ -124,7 +124,7 @@ void OXMLColumn::endFastElement(sal_Int32 ) if ( pAutoStyles ) { OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>( - dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName))); + dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,m_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -136,7 +136,7 @@ void OXMLColumn::endFastElement(sal_Int32 ) const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles(); if ( pAutoStyles ) { - OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast<const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName))); + OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast<const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,m_sCellStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -153,7 +153,7 @@ void OXMLColumn::endFastElement(sal_Int32 ) const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles(); if ( pAutoStyles ) { - OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName))); + OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,m_sCellStyleName))); if ( pAutoStyle ) { // we also have to do this on the table to import text-properties diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index d88d0fa8b15e..20aac7489ede 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -235,25 +235,25 @@ ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext, OUString m_xRowExportHelper = new OSpecialHandleXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper()); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_TABLE_TABLE, + XmlStyleFamily::TABLE_TABLE, OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME ), m_xExportHelper.get(), OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX )); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_TABLE_COLUMN, + XmlStyleFamily::TABLE_COLUMN, OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME ), m_xColumnExportHelper.get(), OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX )); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_TABLE_CELL, + XmlStyleFamily::TABLE_CELL, OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME ), m_xCellExportHelper.get(), OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX )); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_TABLE_ROW, + XmlStyleFamily::TABLE_ROW, OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME ), m_xRowExportHelper.get(), OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX )); @@ -1134,15 +1134,15 @@ void ODBExport::exportTables(bool _bExportContext) void ODBExport::exportAutoStyle(XPropertySet* _xProp) { - typedef std::pair<TPropertyStyleMap*,sal_uInt16> TEnumMapperPair; + typedef std::pair<TPropertyStyleMap*,XmlStyleFamily> TEnumMapperPair; typedef std::pair< rtl::Reference < SvXMLExportPropertyMapper> , TEnumMapperPair> TExportPropMapperPair; Reference<XColumnsSupplier> xSup(_xProp,UNO_QUERY); if ( xSup.is() ) { const TExportPropMapperPair pExportHelper[] = { - TExportPropMapperPair(m_xExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_TABLE )) - // ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL)) - ,TExportPropMapperPair(m_xRowExportHelper,TEnumMapperPair(&m_aRowAutoStyleNames,XML_STYLE_FAMILY_TABLE_ROW)) + TExportPropMapperPair(m_xExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XmlStyleFamily::TABLE_TABLE )) + // ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XmlStyleFamily::TABLE_CELL)) + ,TExportPropMapperPair(m_xRowExportHelper,TEnumMapperPair(&m_aRowAutoStyleNames,XmlStyleFamily::TABLE_ROW)) }; std::vector< XMLPropertyState > aPropertyStates; @@ -1188,8 +1188,8 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) else { // here I know I have a column const TExportPropMapperPair pExportHelper[] = { - TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN )) - ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL)) + TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XmlStyleFamily::TABLE_COLUMN )) + ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XmlStyleFamily::TABLE_CELL)) }; for (const auto & i : pExportHelper) { @@ -1219,7 +1219,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) } } - if ( XML_STYLE_FAMILY_TABLE_CELL == i.second.second ) + if ( XmlStyleFamily::TABLE_CELL == i.second.second ) std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), std::back_inserter( aPropStates )); if ( !aPropStates.empty() ) i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, aPropStates ) ); @@ -1247,10 +1247,10 @@ void ODBExport::ExportAutoStyles_() if ( getExportFlags() & SvXMLExportFlags::CONTENT ) { collectComponentStyles(); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW); exportDataStyles(); } } diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx index 50a1bbedcdd7..7027e0f0d4a2 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.cxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx @@ -48,7 +48,7 @@ using namespace xmloff::token; OTableStyleContext::OTableStyleContext( ODBFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) :XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, false ) ,pStyles(&rStyles) ,m_nNumberFormat(-1) @@ -66,25 +66,25 @@ void OTableStyleContext::FillPropertySet( { if ( !IsDefaultStyle() ) { - if ( GetFamily() == XML_STYLE_FAMILY_TABLE_TABLE ) + if ( GetFamily() == XmlStyleFamily::TABLE_TABLE ) { if ( !sPageStyle.isEmpty() ) { AddProperty(CTF_DB_MASTERPAGENAME, Any(sPageStyle)); } } - else if ( GetFamily() == XML_STYLE_FAMILY_TABLE_COLUMN ) + else if ( GetFamily() == XmlStyleFamily::TABLE_COLUMN ) { if ((m_nNumberFormat == -1) && !m_sDataStyleName.isEmpty()) { SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext* >(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true))); + XmlStyleFamily::DATA_STYLE, m_sDataStyleName, true))); if ( !pStyle ) { OTableStylesContext* pMyStyles = dynamic_cast<OTableStylesContext* >(GetOwnImport().GetAutoStyles()); if ( pMyStyles ) pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext* >(pMyStyles-> - FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true))); + FindStyleChildContext(XmlStyleFamily::DATA_STYLE, m_sDataStyleName, true))); else { OSL_FAIL("not possible to get style"); } @@ -159,7 +159,7 @@ void OTableStylesContext::EndElement() rtl::Reference < SvXMLImportPropertyMapper > OTableStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper = SvXMLStylesContext::GetImportPropertyMapper(nFamily); @@ -167,27 +167,28 @@ rtl::Reference < SvXMLImportPropertyMapper > { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if ( !m_xTableImpPropMapper.is() ) m_xTableImpPropMapper = new SvXMLImportPropertyMapper( const_cast<OTableStylesContext*>(this)->GetOwnImport().GetTableStylesPropertySetMapper(), const_cast<SvXMLImport&>(GetImport()) ); xMapper = m_xTableImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if ( !m_xColumnImpPropMapper.is() ) m_xColumnImpPropMapper = new SvXMLImportPropertyMapper( const_cast<OTableStylesContext*>(this)->GetOwnImport().GetColumnStylesPropertySetMapper(), const_cast<SvXMLImport&>(GetImport()) ); xMapper = m_xColumnImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if ( !m_xCellImpPropMapper.is() ) m_xCellImpPropMapper = new SvXMLImportPropertyMapper( const_cast<OTableStylesContext*>(this)->GetOwnImport().GetCellStylesPropertySetMapper(), const_cast<SvXMLImport&>(GetImport()) ); xMapper = m_xCellImpPropMapper; } break; + default: break; } } @@ -195,7 +196,7 @@ rtl::Reference < SvXMLImportPropertyMapper > } SvXMLStyleContext *OTableStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily, nPrefix, @@ -205,35 +206,36 @@ SvXMLStyleContext *OTableStylesContext::CreateStyleStyleChildContext( { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_TABLE: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_CELL: pStyle = new OTableStyleContext( GetOwnImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; + default: break; } } return pStyle; } -OUString OTableStylesContext::GetServiceName( sal_uInt16 nFamily ) const +OUString OTableStylesContext::GetServiceName( XmlStyleFamily nFamily ) const { OUString sServiceName = SvXMLStylesContext::GetServiceName(nFamily); if (sServiceName.isEmpty()) { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: sServiceName = XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME; break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: sServiceName = XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME; break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: sServiceName = XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME; break; - + default: break; } } return sServiceName; @@ -245,14 +247,14 @@ sal_Int32 OTableStylesContext::GetIndex(const sal_Int16 nContextID) { if (m_nNumberFormatIndex == -1) m_nNumberFormatIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_COLUMN)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_COLUMN)->getPropertySetMapper()->FindEntryIndex(nContextID); return m_nNumberFormatIndex; } else if ( nContextID == CTF_DB_MASTERPAGENAME ) { if (m_nMasterPageNameIndex == -1) m_nMasterPageNameIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_TABLE)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_TABLE)->getPropertySetMapper()->FindEntryIndex(nContextID); return m_nMasterPageNameIndex; } else diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx index 4d36a34eb82b..d0a1a4151d63 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.hxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx @@ -57,7 +57,7 @@ namespace dbaxml OTableStyleContext( ODBFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~OTableStyleContext() override; @@ -85,7 +85,7 @@ namespace dbaxml // Create a style context. virtual SvXMLStyleContext *CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -99,8 +99,8 @@ namespace dbaxml virtual void EndElement() override; virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const override; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const override; + XmlStyleFamily nFamily ) const override; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override; sal_Int32 GetIndex(const sal_Int16 nContextID); }; diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx index 77861056ce94..fb12f83f24ae 100644 --- a/dbaccess/source/filter/xml/xmlTable.cxx +++ b/dbaccess/source/filter/xml/xmlTable.cxx @@ -178,7 +178,7 @@ void OXMLTable::endFastElement(sal_Int32 ) const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles(); if ( pAutoStyles ) { - OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName))); + OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_TABLE,m_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(m_xTable); diff --git a/include/xmloff/SchXMLImportHelper.hxx b/include/xmloff/SchXMLImportHelper.hxx index 9cdb3f0566ee..7d6fa466880f 100644 --- a/include/xmloff/SchXMLImportHelper.hxx +++ b/include/xmloff/SchXMLImportHelper.hxx @@ -112,7 +112,7 @@ public: const SvXMLTokenMap& GetSeriesAttrTokenMap(); const SvXMLTokenMap& GetRegEquationAttrTokenMap(); - static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; } + static XmlStyleFamily GetChartFamilyID() { return XmlStyleFamily::SCH_CHART_ID; } /** @param bPushLastChartType If </sal_False>, in case a new chart type has to be added (because it does not exist yet), it is appended at the diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx index 15f754d04db9..96ae15ce8cde 100644 --- a/include/xmloff/XMLShapeStyleContext.hxx +++ b/include/xmloff/XMLShapeStyleContext.hxx @@ -48,7 +48,7 @@ public: const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, SvXMLStylesContext& rStyles, - sal_uInt16 nFamily); + XmlStyleFamily nFamily); virtual ~XMLShapeStyleContext() override; SvXMLImportContextRef CreateChildContext( diff --git a/include/xmloff/XMLTextMasterStylesContext.hxx b/include/xmloff/XMLTextMasterStylesContext.hxx index 7264ba2a58ff..12975af36469 100644 --- a/include/xmloff/XMLTextMasterStylesContext.hxx +++ b/include/xmloff/XMLTextMasterStylesContext.hxx @@ -31,12 +31,12 @@ protected: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; - virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + virtual SvXMLStyleContext *CreateStyleStyleChildContext( XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; - virtual bool InsertStyleFamily( sal_uInt16 nFamily ) const override; + virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override; public: diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx index f44449e1a41b..cf5d5ca24e90 100644 --- a/include/xmloff/XMLTextShapeStyleContext.hxx +++ b/include/xmloff/XMLTextShapeStyleContext.hxx @@ -39,7 +39,7 @@ public: XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~XMLTextShapeStyleContext() override; virtual SvXMLImportContextRef CreateChildContext( diff --git a/include/xmloff/families.hxx b/include/xmloff/families.hxx index 5f88b0f471c4..13aee189e44e 100644 --- a/include/xmloff/families.hxx +++ b/include/xmloff/families.hxx @@ -23,76 +23,80 @@ used in the SvXMLAutoStylePoolP. */ -// Misc (Pool) -// reserved: 0..99 -#define XML_STYLE_FAMILY_DATA_STYLE 0 -#define XML_STYLE_FAMILY_PAGE_MASTER 1 #define XML_STYLE_FAMILY_PAGE_MASTER_NAME "page-layout" #define XML_STYLE_FAMILY_PAGE_MASTER_PREFIX "pm" -#define XML_STYLE_FAMILY_MASTER_PAGE 2 - -// Text -// reserved: 100..199 -#define XML_STYLE_FAMILY_TEXT_PARAGRAPH 100 -#define XML_STYLE_FAMILY_TEXT_TEXT 101 -#define XML_STYLE_FAMILY_TEXT_LIST 102 -#define XML_STYLE_FAMILY_TEXT_OUTLINE 103 -#define XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG 105 -#define XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG 106 -#define XML_STYLE_FAMILY_TEXT_SECTION 107 -#define XML_STYLE_FAMILY_TEXT_FRAME 108 // export only -#define XML_STYLE_FAMILY_TEXT_RUBY 109 -#define XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG 110 -#define XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG 111 - -// Table -// reserved: 200..299 -#define XML_STYLE_FAMILY_TABLE_TABLE 200 #define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME "table" #define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX "ta" -#define XML_STYLE_FAMILY_TABLE_COLUMN 202 #define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME "table-column" #define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX "co" -#define XML_STYLE_FAMILY_TABLE_ROW 203 #define XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME "table-row" #define XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX "ro" -#define XML_STYLE_FAMILY_TABLE_CELL 204 #define XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME "table-cell" #define XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX "ce" -#define XML_STYLE_FAMILY_TABLE_TEMPLATE_ID 205 - -// Impress/Draw -// reserved: 300..399 -#define XML_STYLE_FAMILY_SD_GRAPHICS_ID 300 #define XML_STYLE_FAMILY_SD_GRAPHICS_NAME "graphic" #define XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX "gr" - -#define XML_STYLE_FAMILY_SD_PRESENTATION_ID 301 #define XML_STYLE_FAMILY_SD_PRESENTATION_NAME "presentation" #define XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX "pr" -// families for derived from SvXMLStyleContext -#define XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID 302 -#define XML_STYLE_FAMILY_SD_PAGEMASTERSTYLECONEXT_ID 306 -#define XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID 303 -// family for draw pool -#define XML_STYLE_FAMILY_SD_POOL_ID 304 #define XML_STYLE_FAMILY_SD_POOL_NAME "default" -// family for presentation drawpage properties -#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID 305 #define XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME "drawing-page" #define XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX "dp" +#define XML_STYLE_FAMILY_SCH_CHART_NAME "chart" +#define XML_STYLE_FAMILY_SCH_CHART_PREFIX "ch" +#define XML_STYLE_FAMILY_CONTROL_PREFIX "ctrl" + +enum class XmlStyleFamily +{ +// Misc (Pool) +// reserved: 0..99 + DATA_STYLE = 0, + PAGE_MASTER = 1, + MASTER_PAGE = 2, + +// Text +// reserved: 100..199 + TEXT_PARAGRAPH = 100, + TEXT_TEXT = 101, + TEXT_LIST = 102, + TEXT_OUTLINE = 103, + TEXT_FOOTNOTECONFIG = 105, + TEXT_ENDNOTECONFIG = 106, + TEXT_SECTION = 107, + TEXT_FRAME = 108, // export only + TEXT_RUBY = 109, + TEXT_BIBLIOGRAPHYCONFIG = 110, + TEXT_LINENUMBERINGCONFIG = 111, -#define XML_STYLE_FAMILY_SD_GRADIENT_ID 306 -#define XML_STYLE_FAMILY_SD_HATCH_ID 307 -#define XML_STYLE_FAMILY_SD_FILL_IMAGE_ID 308 -#define XML_STYLE_FAMILY_SD_MARKER_ID 309 -#define XML_STYLE_FAMILY_SD_STROKE_DASH_ID 310 +// Table +// reserved: 200..299 + TABLE_TABLE = 200, + TABLE_COLUMN = 202, + TABLE_ROW = 203, + TABLE_CELL = 204, + TABLE_TEMPLATE_ID = 205, + +// Impress/Draw +// reserved: 300..399 + SD_GRAPHICS_ID = 300, + + SD_PRESENTATION_ID = 301, +// families for derived from SvXMLStyleContext + SD_PAGEMASTERCONEXT_ID = 302, + SD_PAGEMASTERSTYLECONEXT_ID = 306, + SD_PRESENTATIONPAGELAYOUT_ID = 303, +// family for draw pool + SD_POOL_ID = 304, +// family for presentation drawpage properties + SD_DRAWINGPAGE_ID = 305, + + SD_GRADIENT_ID = 306, + SD_HATCH_ID = 307, + SD_FILL_IMAGE_ID = 308, + SD_MARKER_ID = 309, + SD_STROKE_DASH_ID = 310, // Chart // reserved: 400..499 -#define XML_STYLE_FAMILY_SCH_CHART_ID 400 -#define XML_STYLE_FAMILY_SCH_CHART_NAME "chart" -#define XML_STYLE_FAMILY_SCH_CHART_PREFIX "ch" + SCH_CHART_ID = 400, // Math // reserved: 500..599 @@ -100,8 +104,9 @@ // Forms/Controls // reserved 600..649 -#define XML_STYLE_FAMILY_CONTROL_ID 600 -#define XML_STYLE_FAMILY_CONTROL_PREFIX "ctrl" + CONTROL_ID = 600, + +}; #endif // INCLUDED_XMLOFF_FAMILIES_HXX diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx index db1700cb9e2f..dced149b4289 100644 --- a/include/xmloff/prstylei.hxx +++ b/include/xmloff/prstylei.hxx @@ -89,7 +89,7 @@ public: XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false ); virtual ~XMLPropStyleContext() override; diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 67a57899f30c..e91ff36ec071 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -130,12 +130,12 @@ struct ImplXMLShapeExportInfo { OUString msStyleName; OUString msTextStyleName; - sal_Int32 mnFamily; + XmlStyleFamily mnFamily; XmlShapeType meShapeType; css::uno::Reference< css::drawing::XShape > xCustomShapeReplacement; - ImplXMLShapeExportInfo() : mnFamily( XML_STYLE_FAMILY_SD_GRAPHICS_ID ), meShapeType( XmlShapeTypeNotYetSet ) {} + ImplXMLShapeExportInfo() : mnFamily( XmlStyleFamily::SD_GRAPHICS_ID ), meShapeType( XmlShapeTypeNotYetSet ) {} }; /** a vector for shape style and type cache information */ diff --git a/include/xmloff/styleexp.hxx b/include/xmloff/styleexp.hxx index 4024740d25b4..db7f11616863 100644 --- a/include/xmloff/styleexp.hxx +++ b/include/xmloff/styleexp.hxx @@ -48,6 +48,7 @@ namespace com { namespace sun { namespace star class SvXMLExportPropertyMapper; class SvXMLAutoStylePoolP; class SvXMLExport; +enum class XmlStyleFamily; class XMLOFF_DLLPUBLIC XMLStyleExport : public salhelper::SimpleReferenceObject { @@ -96,13 +97,13 @@ public: void exportStyleFamily( const OUString& rFamily, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper, - bool bUsed, sal_uInt16 nFamily, + bool bUsed, XmlStyleFamily nFamily, const OUString* pPrefix = nullptr); void exportStyleFamily( const char *pFamily, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper, - bool bUsed, sal_uInt16 nFamily, + bool bUsed, XmlStyleFamily nFamily, const OUString* pPrefix = nullptr); }; diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index b85f78f1dbfe..a46b3e6e5974 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -375,17 +375,17 @@ public: /// add autostyle for specified family void Add( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, MultiPropertySetHelper& rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > & rPropSet ); void Add( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, const css::uno::Reference< css::beans::XPropertySet > & rPropSet, const XMLPropertyState** pAddState = nullptr, bool bDontSeek = false ); /// find style name for specified family and parent OUString Find( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, const css::uno::Reference< css::beans::XPropertySet > & rPropSet, const OUString& rParent, const XMLPropertyState** pAddState = nullptr ) const; diff --git a/include/xmloff/txtstyli.hxx b/include/xmloff/txtstyli.hxx index 5ac0f410d005..e1704e1e4a4a 100644 --- a/include/xmloff/txtstyli.hxx +++ b/include/xmloff/txtstyli.hxx @@ -57,7 +57,7 @@ public: XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle = false ); ~XMLTextStyleContext() override; diff --git a/include/xmloff/xmlaustp.hxx b/include/xmloff/xmlaustp.hxx index 6902dd9aa106..4f754c170f25 100644 --- a/include/xmloff/xmlaustp.hxx +++ b/include/xmloff/xmlaustp.hxx @@ -34,6 +34,7 @@ class SvXMLAttributeList; class SvXMLExport; class SvXMLUnitConverter; struct XMLPropertyState; +enum class XmlStyleFamily; namespace com { namespace sun { namespace star { namespace uno { template<typename A> class Sequence; } @@ -56,7 +57,7 @@ protected: virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, @@ -66,7 +67,7 @@ protected: // this method is executed after Properties Export, so you can e.g. export a map or so on virtual void exportStyleContent( const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, @@ -86,18 +87,18 @@ public: for family numbers see families.hxx */ // TODO: Remove this ugly method as soon as possible - void AddFamily( sal_Int32 nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, const OUString& aStrPrefix ); - void AddFamily( sal_Int32 nFamily, const OUString& rStrName, + void AddFamily( XmlStyleFamily nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, const OUString& aStrPrefix ); + void AddFamily( XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference< SvXMLExportPropertyMapper >& rMapper, const OUString& rStrPrefix, bool bAsFamily = true ); - void SetFamilyPropSetMapper( sal_Int32 nFamily, + void SetFamilyPropSetMapper( XmlStyleFamily nFamily, const rtl::Reference< SvXMLExportPropertyMapper >& rMapper ); /// Register a name that must not be used as a generated name. - void RegisterName( sal_Int32 nFamily, const OUString& rName ); + void RegisterName( XmlStyleFamily nFamily, const OUString& rName ); /// Register a name that may only be used through AddNamed - void RegisterDefinedName(sal_Int32 nFamily, const OUString& rName); + void RegisterDefinedName(XmlStyleFamily nFamily, const OUString& rName); /// retrieve the registered names (names + families) void GetRegisteredNames( @@ -110,19 +111,19 @@ public: css::uno::Sequence<OUString> const & aNames ); /// Add an item set to the pool and return its generated name. - OUString Add( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ); - OUString Add( sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false ); - bool Add( OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ); + OUString Add( XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties ); + OUString Add( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false ); + bool Add( OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ); /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc). - bool AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent, + bool AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ); /// Find an item set's name. - OUString Find( sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const; + OUString Find( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const; /** Export all item sets ofs a certain class in the order in that they have been added. */ - void exportXML( sal_Int32 nFamily ) const; + void exportXML( XmlStyleFamily nFamily ) const; void ClearEntries(); diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 69ba1099fefc..1970f8a5c288 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -421,10 +421,10 @@ public: css::uno::Reference< css::embed::XStorage > const & GetSourceStorage() const; - void AddStyleDisplayName( sal_uInt16 nFamily, + void AddStyleDisplayName( XmlStyleFamily nFamily, const OUString& rName, const OUString& rDisplayName ); - OUString GetStyleDisplayName( sal_uInt16 nFamily, + OUString GetStyleDisplayName( XmlStyleFamily nFamily, const OUString& rName ) const; ProgressBarHelper* GetProgressBarHelper(); diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index 84a35e431d53..fc38f53097f0 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -25,6 +25,7 @@ #include <xmloff/dllapi.h> #include <sal/types.h> #include <xmloff/xmlictxt.hxx> +#include <xmloff/families.hxx> #include <memory> class SvXMLStylesContext_Impl; @@ -64,7 +65,7 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext OUString maFollow; // Will be moved to XMLPropStyle soon!!!! bool mbHidden; - sal_uInt16 mnFamily; + XmlStyleFamily mnFamily; bool mbValid : 1; // Set this to false in CreateAndInsert // if the style shouldn't be processed @@ -79,7 +80,7 @@ protected: const OUString& rLocalName, const OUString& rValue ); - void SetFamily( sal_uInt16 nSet ) { mnFamily = nSet; } + void SetFamily( XmlStyleFamily nSet ) { mnFamily = nSet; } void SetAutoName( const OUString& rName ) { maAutoName = rName; } public: @@ -88,13 +89,13 @@ public: SvXMLStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, - sal_uInt16 nFamily=0, + XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle = false ); SvXMLStyleContext( SvXMLImport& rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, - sal_uInt16 nFamily=0, + XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle = false ); virtual ~SvXMLStyleContext() override; @@ -108,7 +109,7 @@ public: const OUString& GetParentName() const { return maParentName; } const OUString& GetFollow() const { return maFollow; } - sal_uInt16 GetFamily() const { return mnFamily; } + XmlStyleFamily GetFamily() const { return mnFamily; } bool IsValid() const { return mbValid; } void SetValid( bool b ) { mbValid = b; } @@ -181,16 +182,16 @@ protected: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); - virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + virtual SvXMLStyleContext *CreateStyleStyleChildContext( XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); - virtual bool InsertStyleFamily( sal_uInt16 nFamily ) const; + virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const; public: @@ -222,19 +223,19 @@ public: void AddStyle(SvXMLStyleContext& rNew); const SvXMLStyleContext *FindStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, const OUString& rName, bool bCreateIndex = false ) const; - static sal_uInt16 GetFamily( const OUString& rFamily ); + static XmlStyleFamily GetFamily( const OUString& rFamily ); virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const; + XmlStyleFamily nFamily ) const; virtual css::uno::Reference< css::container::XNameContainer > - GetStylesContainer( sal_uInt16 nFamily ) const; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const; + GetStylesContainer( XmlStyleFamily nFamily ) const; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const; css::uno::Reference< css::style::XAutoStyleFamily > - GetAutoStyles( sal_uInt16 nFamily ) const; + GetAutoStyles( XmlStyleFamily nFamily ) const; void CopyAutoStylesToDoc(); void CopyStylesToDoc( bool bOverwrite, bool bFinish = true ); void FinishStyles( bool bOverwrite ); diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.cxx b/reportdesign/source/filter/xml/xmlAutoStyle.cxx index f3855b704df8..0c4ad550a3f4 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.cxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.cxx @@ -28,7 +28,7 @@ namespace rptxml void OXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -36,7 +36,7 @@ void OXMLAutoStylePoolP::exportStyleAttributes( ) const { SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if ( nFamily == XML_STYLE_FAMILY_TABLE_CELL ) + if ( nFamily == XmlStyleFamily::TABLE_CELL ) { rtl::Reference< XMLPropertySetMapper > aPropMapper = rORptExport.GetCellStylePropertyMapper(); for (const auto& rProp : rProperties) diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.hxx b/reportdesign/source/filter/xml/xmlAutoStyle.hxx index bb4b25f699ef..0a52a2233466 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.hxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.hxx @@ -33,7 +33,7 @@ namespace rptxml virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index 74a23667863f..395c3afbd610 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -216,7 +216,7 @@ void OXMLCell::endFastElement(sal_Int32) m_xComponent = xFixedLine.get(); m_pContainer->getSection()->add(m_xComponent.get()); m_pContainer->addCell(m_xComponent); - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(GetImport().GetAutoStyles()->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,m_sStyleName))); if ( pAutoStyle ) { uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet(); diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx index 13e6b0767578..8796c3c66bad 100644 --- a/reportdesign/source/filter/xml/xmlColumn.cxx +++ b/reportdesign/source/filter/xml/xmlColumn.cxx @@ -125,7 +125,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo); - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -135,7 +135,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) } else { - pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName))); + pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 0c3ad1e70ce3..a980e05d90ac 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -289,16 +289,16 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin const OUString& sFamily( GetXMLToken(XML_PARAGRAPH) ); OUString aPrefix( 'P'); - GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, + GetAutoStylePool()->AddFamily( XmlStyleFamily::TEXT_PARAGRAPH, sFamily, m_xParaPropMapper, aPrefix ); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, m_xCellStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, m_xColumnStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, m_xRowStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, m_xTableStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX); } @@ -492,7 +492,7 @@ static void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::ve } } -void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames) +void ORptExport::collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames) { ::std::vector< XMLPropertyState > aPropertyStates; aPropertyStates.emplace_back(0); @@ -507,7 +507,7 @@ void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_I } } -void ORptExport::collectStyleNames(sal_Int32 _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames) +void ORptExport::collectStyleNames(XmlStyleFamily _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames) { ::std::vector< XMLPropertyState > aPropertyStates; aPropertyStates.emplace_back(0); @@ -607,9 +607,9 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp) lcl_calculate(aColumnPos,aRowPos,aInsert->second); TGridStyleMap::iterator aPos = m_aColumnStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first; - collectStyleNames(XML_STYLE_FAMILY_TABLE_COLUMN,aColumnPos,aPos->second); + collectStyleNames(XmlStyleFamily::TABLE_COLUMN,aColumnPos,aPos->second); aPos = m_aRowStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first; - collectStyleNames(XML_STYLE_FAMILY_TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second); + collectStyleNames(XmlStyleFamily::TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second); sal_Int32 x1 = 0; sal_Int32 y1 = 0; @@ -1155,7 +1155,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted { ::std::vector< XMLPropertyState > aPropertyStates( m_xParaPropMapper->Filter(_xProp) ); if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TEXT_PARAGRAPH, aPropertyStates )); } ::std::vector< XMLPropertyState > aPropertyStates( m_xCellStylesExportPropertySetMapper->Filter(_xProp) ); Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY); @@ -1255,14 +1255,14 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted } if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_CELL, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TABLE_CELL, aPropertyStates )); } void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp) { ::std::vector< XMLPropertyState > aPropertyStates( m_xTableStylesExportPropertySetMapper->Filter(_xProp.get()) ); if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_TABLE, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XmlStyleFamily::TABLE_TABLE, aPropertyStates )); } void ORptExport::SetBodyAttributes() @@ -1346,10 +1346,10 @@ void ORptExport::ExportAutoStyles_() if ( getExportFlags() & SvXMLExportFlags::CONTENT ) { collectComponentStyles(); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL); exportDataStyles(); GetShapeExport()->exportAutoStyles(); } diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index f45b8e65171d..363910bf6cec 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -128,8 +128,8 @@ private: void exportAutoStyle(const Reference<XSection>& _xProp); void exportReportComponentAutoStyles(const Reference<XSection>& _xProp); void collectComponentStyles(); - void collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames); - void collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames); + void collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames); + void collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames); void exportParagraph(const Reference< XReportControlModel >& _xReportElement); bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula); void exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups); diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 9aee4a698f94..2372db278137 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -255,7 +255,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const OUString& _sStyleName, { if ( !_xProp.is() || _sStyleName.isEmpty() || !_pAutoStyles ) return; - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(_pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,_sStyleName))); if ( pAutoStyle ) { css::awt::FontDescriptor aFont; diff --git a/reportdesign/source/filter/xml/xmlRow.cxx b/reportdesign/source/filter/xml/xmlRow.cxx index 72a4a69cec55..7183f7062f56 100644 --- a/reportdesign/source/filter/xml/xmlRow.cxx +++ b/reportdesign/source/filter/xml/xmlRow.cxx @@ -132,7 +132,7 @@ void OXMLRow::EndElement() }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo); - XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName)); + XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,m_sStyleName)); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -142,7 +142,7 @@ void OXMLRow::EndElement() } else { - pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,m_sStyleName)); + pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,m_sStyleName)); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index cf22621347bf..0d8ad1e260a5 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -70,7 +70,7 @@ public: OControlStyleContext::OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, false/*bDefaultStyle*/ ), pStyles(&rStyles), m_nNumberFormat(-1), @@ -90,18 +90,18 @@ void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPr { if ( !IsDefaultStyle() ) { - if ( GetFamily() == XML_STYLE_FAMILY_TABLE_CELL ) + if ( GetFamily() == XmlStyleFamily::TABLE_CELL ) { if ((m_nNumberFormat == -1) && !m_sDataStyleName.isEmpty()) { SvXMLNumFormatContext* pStyle = const_cast< SvXMLNumFormatContext*>(dynamic_cast<const SvXMLNumFormatContext*>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName))); + XmlStyleFamily::DATA_STYLE, m_sDataStyleName))); if ( !pStyle ) { OReportStylesContext* pMyStyles = dynamic_cast< OReportStylesContext *>(m_rImport.GetAutoStyles()); if ( pMyStyles ) pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext *>(pMyStyles-> - FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true))); + FindStyleChildContext(XmlStyleFamily::DATA_STYLE, m_sDataStyleName, true))); else { OSL_FAIL("not possible to get style"); } @@ -181,7 +181,7 @@ void OReportStylesContext::EndElement() rtl::Reference < SvXMLImportPropertyMapper > OReportStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper(SvXMLStylesContext::GetImportPropertyMapper(nFamily)); @@ -190,7 +190,7 @@ rtl::Reference < SvXMLImportPropertyMapper > ORptFilter& rImport = GetOwnImport(); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( !m_xCellImpPropMapper.is() ) { @@ -202,7 +202,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = m_xCellImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( !m_xColumnImpPropMapper.is() ) m_xColumnImpPropMapper = @@ -211,14 +211,14 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = m_xColumnImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( !m_xRowImpPropMapper.is() ) m_xRowImpPropMapper =new OSpecialHanldeXMLImportPropertyMapper( rImport.GetRowStylesPropertySetMapper(), m_rImport ); xMapper = m_xRowImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( !m_xTableImpPropMapper.is() ) { @@ -237,14 +237,14 @@ rtl::Reference < SvXMLImportPropertyMapper > } SvXMLStyleContext *OReportStylesContext::CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: // There are no writer specific defaults for graphic styles! pStyle = new XMLGraphicsDefaultStyle( GetImport(), nPrefix, rLocalName, xAttrList, *this ); @@ -260,7 +260,7 @@ SvXMLStyleContext *OReportStylesContext::CreateDefaultStyleStyleChildContext( } SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily, nPrefix, @@ -270,10 +270,10 @@ SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_TABLE: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: + case XmlStyleFamily::TABLE_CELL: pStyle = new OControlStyleContext( GetOwnImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; @@ -287,7 +287,7 @@ SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( } Reference < XNameContainer > - OReportStylesContext::GetStylesContainer( sal_uInt16 nFamily ) const + OReportStylesContext::GetStylesContainer( XmlStyleFamily nFamily ) const { Reference < XNameContainer > xStyles(SvXMLStylesContext::GetStylesContainer(nFamily)); if (!xStyles.is()) @@ -295,7 +295,7 @@ Reference < XNameContainer > OUString sName; switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( m_xTableStyles.is() ) xStyles.set(m_xTableStyles); @@ -303,7 +303,7 @@ Reference < XNameContainer > sName = "TableStyles"; } break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( m_xCellStyles.is() ) xStyles.set(m_xCellStyles); @@ -311,7 +311,7 @@ Reference < XNameContainer > sName = "CellStyles"; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( m_xColumnStyles.is() ) xStyles.set(m_xColumnStyles); @@ -319,7 +319,7 @@ Reference < XNameContainer > sName = "ColumnStyles"; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( m_xRowStyles.is() ) xStyles.set(m_xRowStyles); @@ -327,7 +327,7 @@ Reference < XNameContainer > sName = "RowStyles"; } break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: xStyles = const_cast<SvXMLImport *>(&GetImport())->GetTextImport()->GetFrameStyles(); break; default: @@ -345,16 +345,16 @@ Reference < XNameContainer > xStyles.set(xFamilies->getByName( sName ), uno::UNO_QUERY); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: m_xTableStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: m_xCellStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: m_xColumnStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: m_xRowStyles.set(xStyles); break; default: @@ -368,23 +368,23 @@ Reference < XNameContainer > } -OUString OReportStylesContext::GetServiceName( sal_uInt16 nFamily ) const +OUString OReportStylesContext::GetServiceName( XmlStyleFamily nFamily ) const { OUString sServiceName = SvXMLStylesContext::GetServiceName(nFamily); if (sServiceName.isEmpty()) { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: sServiceName = g_sTableStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: sServiceName = g_sColumnStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: sServiceName = g_sRowStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: sServiceName = g_sCellStyleFamilyName; break; default: @@ -401,7 +401,7 @@ sal_Int32 OReportStylesContext::GetIndex(const sal_Int16 nContextID) { if (m_nNumberFormatIndex == -1) m_nNumberFormatIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); return m_nNumberFormatIndex; } return -1; diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx index a75f290fd4cb..8b8cf3781e92 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.hxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx @@ -57,7 +57,7 @@ namespace rptxml OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~OControlStyleContext() override; @@ -95,13 +95,13 @@ namespace rptxml // Create a style context. virtual SvXMLStyleContext *CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -117,10 +117,10 @@ namespace rptxml virtual void EndElement() override; virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const override; + XmlStyleFamily nFamily ) const override; virtual css::uno::Reference< css::container::XNameContainer > - GetStylesContainer( sal_uInt16 nFamily ) const override; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const override; + GetStylesContainer( XmlStyleFamily nFamily ) const override; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override; sal_Int32 GetIndex(const sal_Int16 nContextID); }; diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index a960beaf442e..a2f0ab6d7e81 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -163,7 +163,7 @@ void OXMLTable::endFastElement(sal_Int32 ) const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles(); if ( pAutoStyles ) { - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_TABLE,m_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(m_xSection.get()); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index f7160a765014..b9d6827620b7 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -674,7 +674,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > RptXMLDocumentBodyCont const SvXMLStylesContext* pAutoStyles = rImport.GetAutoStyles(); if (pAutoStyles) { - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER, "pm1"))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::PAGE_MASTER, "pm1"))); if (pAutoStyle) { pAutoStyle->FillPropertySet(rImport.getReportDefinition().get()); diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx index 5b2265c1d5a1..9d36ee9b52c7 100644 --- a/sc/inc/sheetdata.hxx +++ b/sc/inc/sheetdata.hxx @@ -28,6 +28,7 @@ #include "address.hxx" class SvXMLNamespaceMap; +enum class XmlStyleFamily; struct ScStreamEntry { @@ -134,7 +135,7 @@ public: void AddTableStyle( const OUString& rName, const ScAddress& rCellPos ); void HandleNoteStyles( const OUString& rStyleName, const OUString& rTextName, const ScAddress& rCellPos ); - void AddNoteContentStyle( sal_uInt16 nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); + void AddNoteContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); void AddTextStyle( const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index c8796d9f691a..98f91eae5811 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -74,9 +74,9 @@ void ScSheetSaveData::HandleNoteStyles( const OUString& rStyleName, const OUStri maNoteStyles.push_back( aNewEntry ); } -void ScSheetSaveData::AddNoteContentStyle( sal_uInt16 nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ) +void ScSheetSaveData::AddNoteContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ) { - if ( nFamily == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) + if ( nFamily == XmlStyleFamily::TEXT_PARAGRAPH ) maNoteParaStyles.emplace_back( rName, rCellPos, rSelection ); else maNoteTextStyles.emplace_back( rName, rCellPos, rSelection ); diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index d84b297b5084..55b6df72510c 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -173,7 +173,7 @@ void ScXMLAnnotationContext::SetShape( const uno::Reference< drawing::XShape >& mrAnnotationData.maTextStyle = rTextStyle; } -void ScXMLAnnotationContext::AddContentStyle( sal_uInt16 nFamily, const OUString& rName, const ESelection& rSelection ) +void ScXMLAnnotationContext::AddContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ESelection& rSelection ) { mrAnnotationData.maContentStyles.emplace_back( nFamily, rName, rSelection ); } diff --git a/sc/source/filter/xml/xmlannoi.hxx b/sc/source/filter/xml/xmlannoi.hxx index 22f8576d2b3f..55fd7f8a909a 100644 --- a/sc/source/filter/xml/xmlannoi.hxx +++ b/sc/source/filter/xml/xmlannoi.hxx @@ -27,16 +27,17 @@ #include <vector> class ScXMLImport; +enum class XmlStyleFamily; namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } } namespace com { namespace sun { namespace star { namespace drawing { class XShapes; } } } } struct ScXMLAnnotationStyleEntry { - sal_uInt16 const mnFamily; - OUString const maName; - ESelection const maSelection; + XmlStyleFamily mnFamily; + OUString maName; + ESelection maSelection; - ScXMLAnnotationStyleEntry( sal_uInt16 nFam, const OUString& rNam, const ESelection& rSel ) : + ScXMLAnnotationStyleEntry( XmlStyleFamily nFam, const OUString& rNam, const ESelection& rSel ) : mnFamily( nFam ), maName( rNam ), maSelection( rSel ) @@ -89,7 +90,7 @@ public: const css::uno::Reference< css::drawing::XShapes >& rxShapes, const OUString& rStyleName, const OUString& rTextStyle ); - void AddContentStyle( sal_uInt16 nFamily, const OUString& rName, const ESelection& rSelection ); + void AddContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ESelection& rSelection ); private: ScXMLAnnotationData& mrAnnotationData; diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 918a103158e8..7baff729c77b 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -352,7 +352,7 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, cons // Style name for text span corresponds with the name of an automatic style. const XMLPropStyleContext* pStyle = dynamic_cast<const XMLPropStyleContext*>( - pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TEXT_TEXT, rStyleName)); + pAutoStyles->FindStyleChildContext(XmlStyleFamily::TEXT_TEXT, rStyleName)); if (!pStyle) // No style by that name found. diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx index 96af8cd7f39a..8e372b2ae7f3 100644 --- a/sc/source/filter/xml/xmlcoli.cxx +++ b/sc/source/filter/xml/xmlcoli.cxx @@ -111,7 +111,7 @@ void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 /*nElement*/ ) if ( pStyles ) { XMLTableStyleContext* pStyle = const_cast<XMLTableStyleContext*>(static_cast<const XMLTableStyleContext *>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_TABLE_COLUMN, sStyleName, true))); + XmlStyleFamily::TABLE_COLUMN, sStyleName, true))); if (pStyle) { pStyle->FillPropertySet(xColumnProperties); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 4049cdb4a244..59e8088d4acf 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -379,13 +379,13 @@ ScXMLExport::ScXMLExport( xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); xTableStylesExportPropertySetMapper = new ScXMLTableExportPropertyMapper(xTableStylesPropertySetMapper); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, xCellStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, xColumnStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, xRowStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, xTableStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX); if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) @@ -394,7 +394,7 @@ ScXMLExport::ScXMLExport( // should not conflict with user-defined styles since this name is // used for a table style which is not available in the UI. sExternalRefTabStyleName = "ta_extref"; - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_TABLE, sExternalRefTabStyleName); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_TABLE, sExternalRefTabStyleName); sAttrName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_NAME)); sAttrStyleName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_STYLE_NAME)); @@ -905,7 +905,7 @@ void ScXMLExport::ExportExternalRefCacheStyles() OUString aName; sal_Int32 nIndex; - if (GetAutoStylePool()->Add(aName, XML_STYLE_FAMILY_TABLE_CELL, aDefaultStyle, aProps)) + if (GetAutoStylePool()->Add(aName, XmlStyleFamily::TABLE_CELL, aDefaultStyle, aProps)) { pCellStyles->AddStyleName(aName, nIndex); } @@ -1266,7 +1266,7 @@ void ScXMLExport::ExportCellTextAutoStyles(sal_Int32 nTable) std::vector<XMLPropertyState> aPropStates; toXMLPropertyStates(aPropStates, rSecAttrs, xMapper, rAttrMap); if (!aPropStates.empty()) - xStylePool->Add(XML_STYLE_FAMILY_TEXT_TEXT, OUString(), aPropStates); + xStylePool->Add(XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates); } } @@ -1847,7 +1847,7 @@ void ScXMLExport::RegisterDefinedStyleNames( const uno::Reference< css::sheet::X auto xAutoStylePool = GetAutoStylePool(); for (const auto& rFormatInfo : pFormatData->maIDToName) { - xAutoStylePool->RegisterDefinedName(XML_STYLE_FAMILY_TABLE_CELL, rFormatInfo.second); + xAutoStylePool->RegisterDefinedName(XmlStyleFamily::TABLE_CELL, rFormatInfo.second); } } @@ -1998,7 +1998,7 @@ void ScXMLExport::ExportStyles_( bool bUsed ) exportDataStyles(); aStylesExp->exportStyleFamily(OUString("CellStyles"), - OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME), xCellStylesExportPropertySetMapper, false, XML_STYLE_FAMILY_TABLE_CELL); + OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME), xCellStylesExportPropertySetMapper, false, XmlStyleFamily::TABLE_CELL); SvXMLExport::ExportStyles_(bUsed); } @@ -2079,9 +2079,9 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x sal_Int32 nIndex; if (pOldName) { - if (GetAutoStylePool()->AddNamed(*pOldName, XML_STYLE_FAMILY_TABLE_CELL, sStyleName, aPropStates)) + if (GetAutoStylePool()->AddNamed(*pOldName, XmlStyleFamily::TABLE_CELL, sStyleName, aPropStates)) { - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_CELL, *pOldName); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_CELL, *pOldName); // add to pCellStyles, so the name is found for normal sheets pCellStyles->AddStyleName(*pOldName, nIndex); } @@ -2098,13 +2098,13 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x if (itr != pFormatData->maIDToName.end()) { sName = itr->second; - bAdded = GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TABLE_CELL, sStyleName, aPropStates); + bAdded = GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TABLE_CELL, sStyleName, aPropStates); if (bAdded) - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_CELL, sName); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_CELL, sName); } } bool bIsAutoStyle(true); - if (bAdded || GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_CELL, sStyleName, aPropStates)) + if (bAdded || GetAutoStylePool()->Add(sName, XmlStyleFamily::TABLE_CELL, sStyleName, aPropStates)) { pCellStyles->AddStyleName(sName, nIndex); } @@ -2165,9 +2165,9 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>& OUString sParent; if (pOldName) { - if (GetAutoStylePool()->AddNamed(*pOldName, XML_STYLE_FAMILY_TABLE_COLUMN, sParent, aPropStates)) + if (GetAutoStylePool()->AddNamed(*pOldName, XmlStyleFamily::TABLE_COLUMN, sParent, aPropStates)) { - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_COLUMN, *pOldName); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_COLUMN, *pOldName); // add to pColumnStyles, so the name is found for normal sheets rIndex = pColumnStyles->AddStyleName(*pOldName); } @@ -2175,7 +2175,7 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>& else { OUString sName; - if (GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_COLUMN, sParent, aPropStates)) + if (GetAutoStylePool()->Add(sName, XmlStyleFamily::TABLE_COLUMN, sParent, aPropStates)) { rIndex = pColumnStyles->AddStyleName(sName); } @@ -2194,9 +2194,9 @@ void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRo OUString sParent; if (pOldName) { - if (GetAutoStylePool()->AddNamed(*pOldName, XML_STYLE_FAMILY_TABLE_ROW, sParent, aPropStates)) + if (GetAutoStylePool()->AddNamed(*pOldName, XmlStyleFamily::TABLE_ROW, sParent, aPropStates)) { - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_ROW, *pOldName); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_ROW, *pOldName); // add to pRowStyles, so the name is found for normal sheets rIndex = pRowStyles->AddStyleName(*pOldName); } @@ -2204,7 +2204,7 @@ void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRo else { OUString sName; - if (GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_ROW, sParent, aPropStates)) + if (GetAutoStylePool()->Add(sName, XmlStyleFamily::TABLE_ROW, sParent, aPropStates)) { rIndex = pRowStyles->AddStyleName(sName); } @@ -2338,8 +2338,8 @@ void ScXMLExport::collectAutoStyles() { std::vector<XMLPropertyState> aPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties)); OUString sName( rTableEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TABLE_TABLE, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_TABLE, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TABLE_TABLE, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_TABLE, sName); } } } @@ -2372,16 +2372,16 @@ void ScXMLExport::collectAutoStyles() { std::vector<XMLPropertyState> aPropStates(xShapeMapper->Filter(xShapeProperties)); OUString sName( rNoteEntry.maStyleName ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_SD_GRAPHICS_ID, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_SD_GRAPHICS_ID, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::SD_GRAPHICS_ID, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::SD_GRAPHICS_ID, sName); } if ( !rNoteEntry.maTextStyle.isEmpty() ) { std::vector<XMLPropertyState> aPropStates( GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(xShapeProperties)); OUString sName( rNoteEntry.maTextStyle ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName); } } } @@ -2412,8 +2412,8 @@ void ScXMLExport::collectAutoStyles() { std::vector<XMLPropertyState> aPropStates(xParaPropMapper->Filter(xParaProp)); OUString sName( rNoteParaEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_PARAGRAPH, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_PARAGRAPH, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName); } } } @@ -2445,8 +2445,8 @@ void ScXMLExport::collectAutoStyles() std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(xCursorProp)); OUString sName( rNoteTextEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); } } } @@ -2486,8 +2486,8 @@ void ScXMLExport::collectAutoStyles() std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(xCursorProp)); OUString sName( rTextEntry.maName ); - GetAutoStylePool()->AddNamed(sName, XML_STYLE_FAMILY_TEXT_TEXT, OUString(), aPropStates); - GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TEXT_TEXT, sName); + GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates); + GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName); xPrevCursorProp = xCursorProp; aPrevPos = aPos; } @@ -2518,7 +2518,7 @@ void ScXMLExport::collectAutoStyles() if(!aPropStates.empty()) { OUString sName; - GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_TABLE, OUString(), aPropStates); + GetAutoStylePool()->Add(sName, XmlStyleFamily::TABLE_TABLE, OUString(), aPropStates); aTableStyles.push_back(sName); } } @@ -2641,11 +2641,11 @@ void ScXMLExport::ExportAutoStyles_() if (getExportFlags() & SvXMLExportFlags::CONTENT) { - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE); exportAutoDataStyles(); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL); GetShapeExport()->exportAutoStyles(); GetFormExport()->exportAutoStyles( ); @@ -3123,7 +3123,7 @@ void flushParagraph( std::vector<XMLPropertyState> aPropStates; const SvxFieldData* pField = toXMLPropertyStates(aPropStates, rSec.maAttributes, xMapper, rAttrMap); - OUString aStyleName = xStylePool->Find(XML_STYLE_FAMILY_TEXT_TEXT, OUString(), aPropStates); + OUString aStyleName = xStylePool->Find(XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates); writeContent(rExport, aStyleName, aContent, pField); } } @@ -5250,7 +5250,7 @@ ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) { xRowStylesPropertySetMapper = new XMLPropertySetMapper(aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); - GetAutoStylePool()->SetFamilyPropSetMapper( XML_STYLE_FAMILY_TABLE_ROW, + GetAutoStylePool()->SetFamilyPropSetMapper( XmlStyleFamily::TABLE_ROW, xRowStylesExportPropertySetMapper ); } } diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx index a442f1418dc2..c8748eb7cf0e 100644 --- a/sc/source/filter/xml/xmlexternaltabi.cxx +++ b/sc/source/filter/xml/xmlexternaltabi.cxx @@ -246,7 +246,7 @@ ScXMLExternalRefCellContext::ScXMLExternalRefCellContext( { XMLTableStylesContext* pStyles = static_cast<XMLTableStylesContext*>(mrScImport.GetAutoStyles()); const XMLTableStyleContext* pStyle = static_cast<const XMLTableStyleContext*>( - pStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL, it.toString(), true)); + pStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL, it.toString(), true)); if (pStyle) mnNumberFormat = const_cast<XMLTableStyleContext*>(pStyle)->GetNumberFormat(); } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 4fda0e3c5583..6d751eaa1313 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1288,7 +1288,7 @@ void ScXMLImport::SetStyleToRanges() XMLTableStyleContext* pStyle = nullptr; if ( pStyles ) pStyle = const_cast<XMLTableStyleContext*>(static_cast<const XMLTableStyleContext *>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_TABLE_CELL, sPrevStyleName, true))); + XmlStyleFamily::TABLE_CELL, sPrevStyleName, true))); if (pStyle) { pStyle->FillPropertySet(xProperties); @@ -1321,7 +1321,7 @@ void ScXMLImport::SetStyleToRanges() } else { - xProperties->setPropertyValue(gsCellStyle, uno::makeAny(GetStyleDisplayName( XML_STYLE_FAMILY_TABLE_CELL, sPrevStyleName ))); + xProperties->setPropertyValue(gsCellStyle, uno::makeAny(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName ))); sal_Int32 nNumberFormat(GetStyleNumberFormats()->GetStyleNumberFormat(sPrevStyleName)); bool bInsert(nNumberFormat == -1); SetType(xProperties, nNumberFormat, nPrevCellType, sPrevCurrency); diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index e4d364f40d44..b5edafe287d9 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -165,7 +165,7 @@ void SAL_CALL ScXMLTableRowContext::endFastElement(sal_Int32 /*nElement*/) if ( pStyles ) { XMLTableStyleContext* pStyle(const_cast<XMLTableStyleContext*>(static_cast<const XMLTableStyleContext *>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_TABLE_ROW, sStyleName, true)))); + XmlStyleFamily::TABLE_ROW, sStyleName, true)))); if (pStyle) { pStyle->FillPropertySet(xRowProperties); diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index a8ca7bbdce59..5283b97f24a7 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -605,7 +605,7 @@ void ScXMLTableExportPropertyMapper::handleSpecialItem( void ScXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -613,7 +613,7 @@ void ScXMLAutoStylePoolP::exportStyleAttributes( ) const { SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if (nFamily == XML_STYLE_FAMILY_TABLE_CELL) + if (nFamily == XmlStyleFamily::TABLE_CELL) { for(const auto& rProperty : rProperties) { @@ -640,7 +640,7 @@ void ScXMLAutoStylePoolP::exportStyleAttributes( } } } - else if (nFamily == XML_STYLE_FAMILY_TABLE_TABLE) + else if (nFamily == XmlStyleFamily::TABLE_TABLE) { for(const auto& rProperty : rProperties) { @@ -667,7 +667,7 @@ void ScXMLAutoStylePoolP::exportStyleAttributes( void ScXMLAutoStylePoolP::exportStyleContent( const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -675,7 +675,7 @@ void ScXMLAutoStylePoolP::exportStyleContent( ) const { SvXMLAutoStylePoolP::exportStyleContent( rHandler, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if (nFamily == XML_STYLE_FAMILY_TABLE_CELL) + if (nFamily == XmlStyleFamily::TABLE_CELL) { for(const auto& rProperty : rProperties) { diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx index 36a42737cf24..3ddb5e9c215a 100644 --- a/sc/source/filter/xml/xmlstyle.hxx +++ b/sc/source/filter/xml/xmlstyle.hxx @@ -185,7 +185,7 @@ class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, @@ -194,7 +194,7 @@ class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP virtual void exportStyleContent( const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 1d7656083233..7baf38fae5d1 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -372,7 +372,7 @@ ScXMLMapContext::ScXMLMapContext(SvXMLImport& rImport, sal_uInt16 nPrfx, if( IsXMLToken(aLocalName, XML_CONDITION ) ) msCondition = rValue; else if( IsXMLToken(aLocalName, XML_APPLY_STYLE_NAME ) ) - msApplyStyle = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TABLE_CELL, rValue); + msApplyStyle = GetImport().GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, rValue); else if ( IsXMLToken(aLocalName, XML_BASE_CELL_ADDRESS ) ) msBaseCell = rValue; } @@ -426,7 +426,7 @@ void XMLTableStyleContext::SetAttribute( sal_uInt16 nPrefixKey, XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle ) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, bDefaultStyle ), sDataStyleName(), pStyles(&rStyles), @@ -529,21 +529,21 @@ void XMLTableStyleContext::FillPropertySet( { if (!IsDefaultStyle()) { - if (GetFamily() == XML_STYLE_FAMILY_TABLE_CELL) + if (GetFamily() == XmlStyleFamily::TABLE_CELL) { if (!bParentSet) { - AddProperty(CTF_SC_CELLSTYLE, uno::makeAny(GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TABLE_CELL, GetParentName() ))); + AddProperty(CTF_SC_CELLSTYLE, uno::makeAny(GetImport().GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, GetParentName() ))); bParentSet = true; } sal_Int32 nNumFmt = GetNumberFormat(); if (nNumFmt >= 0) AddProperty(CTF_SC_NUMBERFORMAT, uno::makeAny(nNumFmt)); } - else if (GetFamily() == XML_STYLE_FAMILY_TABLE_TABLE) + else if (GetFamily() == XmlStyleFamily::TABLE_TABLE) { if (!sPageStyle.isEmpty()) - AddProperty(CTF_SC_MASTERPAGENAME, uno::makeAny(GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, sPageStyle ))); + AddProperty(CTF_SC_MASTERPAGENAME, uno::makeAny(GetImport().GetStyleDisplayName( XmlStyleFamily::MASTER_PAGE, sPageStyle ))); } } XMLPropStyleContext::FillPropertySet(rPropSet); @@ -551,7 +551,7 @@ void XMLTableStyleContext::FillPropertySet( void XMLTableStyleContext::SetDefaults() { - if ((GetFamily() == XML_STYLE_FAMILY_TABLE_CELL) && GetImport().GetModel().is()) + if ((GetFamily() == XmlStyleFamily::TABLE_CELL) && GetImport().GetModel().is()) { uno::Reference <lang::XMultiServiceFactory> xMultiServiceFactory(GetImport().GetModel(), uno::UNO_QUERY); if (xMultiServiceFactory.is()) @@ -600,14 +600,14 @@ sal_Int32 XMLTableStyleContext::GetNumberFormat() if (nNumberFormat < 0 && !sDataStyleName.isEmpty()) { const SvXMLNumFormatContext* pStyle = static_cast<const SvXMLNumFormatContext*>( - pStyles->FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, sDataStyleName, true)); + pStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, sDataStyleName, true)); if (!pStyle) { XMLTableStylesContext* pMyStyles = static_cast<XMLTableStylesContext*>(GetScImport().GetStyles()); if (pMyStyles) pStyle = static_cast<const SvXMLNumFormatContext*>( - pMyStyles->FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, sDataStyleName, true)); + pMyStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, sDataStyleName, true)); else { OSL_FAIL("not possible to get style"); @@ -620,12 +620,12 @@ sal_Int32 XMLTableStyleContext::GetNumberFormat() } SvXMLStyleContext *XMLTableStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle; // use own wrapper for text and paragraph, to record style usage - if (nFamily == XML_STYLE_FAMILY_TEXT_PARAGRAPH || nFamily == XML_STYLE_FAMILY_TEXT_TEXT) + if (nFamily == XmlStyleFamily::TEXT_PARAGRAPH || nFamily == XmlStyleFamily::TEXT_TEXT) pStyle = new ScCellTextStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); else @@ -636,13 +636,14 @@ SvXMLStyleContext *XMLTableStylesContext::CreateStyleStyleChildContext( { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_CELL: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: + case XmlStyleFamily::TABLE_TABLE: pStyle = new XMLTableStyleContext( GetScImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; + default: break; } } @@ -650,7 +651,7 @@ SvXMLStyleContext *XMLTableStylesContext::CreateStyleStyleChildContext( } SvXMLStyleContext *XMLTableStylesContext::CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle(SvXMLStylesContext::CreateDefaultStyleStyleChildContext( nFamily, nPrefix, @@ -660,14 +661,15 @@ SvXMLStyleContext *XMLTableStylesContext::CreateDefaultStyleStyleChildContext( { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: pStyle = new XMLTableStyleContext( GetScImport(), nPrefix, rLocalName, xAttrList, *this, nFamily, true); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: pStyle = new XMLGraphicsDefaultStyle( GetScImport(), nPrefix, rLocalName, xAttrList, *this); break; + default: break; } } @@ -705,7 +707,7 @@ void XMLTableStylesContext::EndElement() rtl::Reference < SvXMLImportPropertyMapper > XMLTableStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper(SvXMLStylesContext::GetImportPropertyMapper(nFamily)); @@ -713,7 +715,7 @@ rtl::Reference < SvXMLImportPropertyMapper > { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( !xCellImpPropMapper.is() ) { @@ -724,7 +726,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = xCellImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( !xColumnImpPropMapper.is() ) const_cast<XMLTableStylesContext *>(this)->xColumnImpPropMapper = @@ -732,7 +734,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = xColumnImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( !xRowImpPropMapper.is() ) const_cast<XMLTableStylesContext *>(this)->xRowImpPropMapper = @@ -740,7 +742,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = xRowImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( !xTableImpPropMapper.is() ) const_cast<XMLTableStylesContext *>(this)->xTableImpPropMapper = @@ -748,6 +750,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = xTableImpPropMapper; } break; + default: break; } } @@ -755,7 +758,7 @@ rtl::Reference < SvXMLImportPropertyMapper > } uno::Reference < XNameContainer > - XMLTableStylesContext::GetStylesContainer( sal_uInt16 nFamily ) const + XMLTableStylesContext::GetStylesContainer( XmlStyleFamily nFamily ) const { uno::Reference < XNameContainer > xStyles(SvXMLStylesContext::GetStylesContainer(nFamily)); if (!xStyles.is()) @@ -763,7 +766,7 @@ uno::Reference < XNameContainer > OUString sName; switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( xTableStyles.is() ) xStyles.set(xTableStyles); @@ -771,7 +774,7 @@ uno::Reference < XNameContainer > sName = "TableStyles"; } break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( xCellStyles.is() ) xStyles.set(xCellStyles); @@ -779,7 +782,7 @@ uno::Reference < XNameContainer > sName = "CellStyles"; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( xColumnStyles.is() ) xStyles.set(xColumnStyles); @@ -787,7 +790,7 @@ uno::Reference < XNameContainer > sName = "ColumnStyles"; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( xRowStyles.is() ) xStyles.set(xRowStyles); @@ -795,6 +798,7 @@ uno::Reference < XNameContainer > sName = "RowStyles"; } break; + default: break; } if( !xStyles.is() && !sName.isEmpty() && GetScImport().GetModel().is() ) { @@ -816,18 +820,19 @@ uno::Reference < XNameContainer > } switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: const_cast<XMLTableStylesContext *>(this)->xTableStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: const_cast<XMLTableStylesContext *>(this)->xCellStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: const_cast<XMLTableStylesContext *>(this)->xColumnStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: const_cast<XMLTableStylesContext *>(this)->xRowStyles.set(xStyles); break; + default: break; } } } @@ -836,25 +841,26 @@ uno::Reference < XNameContainer > return xStyles; } -OUString XMLTableStylesContext::GetServiceName( sal_uInt16 nFamily ) const +OUString XMLTableStylesContext::GetServiceName( XmlStyleFamily nFamily ) const { OUString sServiceName(SvXMLStylesContext::GetServiceName(nFamily)); if (sServiceName.isEmpty()) { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: sServiceName = gsColumnStyleServiceName; break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: sServiceName = gsRowStyleServiceName; break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: sServiceName = gsCellStyleServiceName; break; - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: sServiceName = gsTableStyleServiceName; break; + default: break; } } return sServiceName; @@ -866,28 +872,28 @@ sal_Int32 XMLTableStylesContext::GetIndex(const sal_Int16 nContextID) { if (nCellStyleIndex == -1) nCellStyleIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); return nCellStyleIndex; } else if (nContextID == CTF_SC_NUMBERFORMAT) { if (nNumberFormatIndex == -1) nNumberFormatIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); return nNumberFormatIndex; } else if (nContextID == CTF_SC_IMPORT_MAP) { if (nConditionalFormatIndex == -1) nConditionalFormatIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); return nConditionalFormatIndex; } else if (nContextID == CTF_SC_MASTERPAGENAME) { if (nMasterPageNameIndex == -1) nMasterPageNameIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_TABLE)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_TABLE)->getPropertySetMapper()->FindEntryIndex(nContextID); return nMasterPageNameIndex; } else @@ -895,7 +901,7 @@ sal_Int32 XMLTableStylesContext::GetIndex(const sal_Int16 nContextID) } -bool ScXMLMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const +bool ScXMLMasterStylesContext::InsertStyleFamily( XmlStyleFamily ) const { return true; } @@ -918,7 +924,7 @@ SvXMLStyleContext *ScXMLMasterStylesContext::CreateStyleChildContext( if( (XML_NAMESPACE_STYLE == nPrefix) && IsXMLToken(rLocalName, XML_MASTER_PAGE) && - InsertStyleFamily( XML_STYLE_FAMILY_MASTER_PAGE ) ) + InsertStyleFamily( XmlStyleFamily::MASTER_PAGE ) ) pContext = new ScMasterPageContext( GetImport(), nPrefix, rLocalName, xAttrList, !GetImport().GetTextImport()->IsInsertMode() ); @@ -929,7 +935,7 @@ SvXMLStyleContext *ScXMLMasterStylesContext::CreateStyleChildContext( } SvXMLStyleContext *ScXMLMasterStylesContext::CreateStyleStyleChildContext( - sal_uInt16 /* nFamily */, + XmlStyleFamily /* nFamily */, sal_uInt16 /* nPrefix */, const OUString& /* rLocalName */, const uno::Reference< XAttributeList > & /* xAttrList */ ) @@ -1010,7 +1016,7 @@ void ScMasterPageContext::Finish( bool bOverwrite ) ScCellTextStyleContext::ScCellTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference<xml::sax::XAttributeList> & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) : XMLTextStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, false/*bDefaultStyle*/ ), nLastSheet(-1) { diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index efd463d5713d..8031e5f90ad0 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -89,7 +89,7 @@ public: XMLTableStyleContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle = false ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle = false ); virtual ~XMLTableStyleContext() override; virtual SvXMLImportContextRef CreateChildContext( @@ -140,13 +140,13 @@ protected: // Create a style context. virtual SvXMLStyleContext *CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -158,10 +158,10 @@ public: virtual void EndElement() override; virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const override; + XmlStyleFamily nFamily ) const override; virtual css::uno::Reference< css::container::XNameContainer > - GetStylesContainer( sal_uInt16 nFamily ) const override; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const override; + GetStylesContainer( XmlStyleFamily nFamily ) const override; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override; sal_Int32 GetIndex(const sal_Int16 nContextID); }; @@ -173,11 +173,11 @@ protected: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; - virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + virtual SvXMLStyleContext *CreateStyleStyleChildContext( XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; - virtual bool InsertStyleFamily( sal_uInt16 nFamily ) const override; + virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override; public: @@ -225,7 +225,7 @@ public: ScCellTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~ScCellTextStyleContext() override; // override FillPropertySet to store style information diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 0402cc89a481..b2f1013816f8 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -147,7 +147,7 @@ void ScMyTables::SetTableStyle(const OUString& sStyleName) if ( pStyles ) { XMLTableStyleContext* pStyle = const_cast<XMLTableStyleContext*>(static_cast<const XMLTableStyleContext *>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_TABLE_TABLE, sStyleName, true))); + XmlStyleFamily::TABLE_TABLE, sStyleName, true))); if ( pStyle ) { pStyle->FillPropertySet(xProperties); diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index cb97973995ee..8bee69b3d4f4 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -274,7 +274,7 @@ public: SwXMLTextStyleContext_Impl( SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, - sal_uInt16 nFamily, + XmlStyleFamily nFamily, SvXMLStylesContext& rStyles ); virtual SvXMLImportContextRef CreateChildContext( @@ -288,7 +288,7 @@ public: uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create() { - if( pConditions && XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() ) + if( pConditions && XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() ) { uno::Reference< lang::XMultiServiceFactory > xFactory( GetImport().GetModel(), uno::UNO_QUERY ); @@ -312,7 +312,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) { - if( pConditions && XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() && xNewStyle.is() ) + if( pConditions && XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() && xNewStyle.is() ) { CommandStruct const*const pCommands = SwCondCollItem::GetCmds(); @@ -355,7 +355,7 @@ SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) SwXMLTextStyleContext_Impl::SwXMLTextStyleContext_Impl( SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, - sal_uInt16 nFamily, + XmlStyleFamily nFamily, SvXMLStylesContext& rStyles ) : XMLTextStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ) { @@ -425,7 +425,7 @@ public: const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, SvXMLStylesContext& rStylesC, - sal_uInt16 nFamily); + XmlStyleFamily nFamily); virtual void CreateAndInsert( bool bOverwrite ) override; @@ -492,16 +492,16 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext( SfxItemPool& rItemPool = pDoc->GetAttrPool(); switch( GetFamily() ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: pItemSet.reset( new SfxItemSet( rItemPool, aTableSetRange ) ); break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: pItemSet.reset( new SfxItemSet( rItemPool, svl::Items<RES_FRM_SIZE, RES_FRM_SIZE>{} ) ); break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: pItemSet.reset( new SfxItemSet( rItemPool, aTableLineSetRange ) ); break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: pItemSet.reset( new SfxItemSet( rItemPool, aTableBoxSetRange ) ); break; default: @@ -526,7 +526,7 @@ SwXMLItemSetStyleContext_Impl::SwXMLItemSetStyleContext_Impl( SwXMLImport& rImpo sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, SvXMLStylesContext& rStylesC, - sal_uInt16 nFamily ) : + XmlStyleFamily nFamily ) : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily ), pTextStyle( nullptr ), rStyles( rStylesC ), @@ -569,7 +569,7 @@ SvXMLImportContextRef SwXMLItemSetStyleContext_Impl::CreateChildContext( pTmp->AddAttribute( aStr, GetName() ); uno::Reference <xml::sax::XAttributeList> xTmpAttrList = pTmp; pTextStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix, - rLocalName, xTmpAttrList, XML_STYLE_FAMILY_TEXT_PARAGRAPH, rStyles ); + rLocalName, xTmpAttrList, XmlStyleFamily::TEXT_PARAGRAPH, rStyles ); pTextStyle->StartElement( xTmpAttrList ); rStyles.AddStyle( *pTextStyle ); } @@ -594,7 +594,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() // #i40788# - first determine the display name of the page style, // then map this name to the corresponding user interface name. - OUString sName = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, + OUString sName = GetImport().GetStyleDisplayName( XmlStyleFamily::MASTER_PAGE, sMasterPageName ); SwStyleNameMapper::FillUIName( sName, sName, @@ -684,19 +684,19 @@ protected: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; - virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily, + virtual SvXMLStyleContext *CreateStyleStyleChildContext( XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override; virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override; // HACK virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const override; + XmlStyleFamily nFamily ) const override; virtual uno::Reference < container::XNameContainer > - GetStylesContainer( sal_uInt16 nFamily ) const override; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const override; + GetStylesContainer( XmlStyleFamily nFamily ) const override; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override; // HACK public: @@ -706,7 +706,7 @@ public: SwXMLImport& rImport, bool bAuto ); - virtual bool InsertStyleFamily( sal_uInt16 nFamily ) const override; + virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override; virtual void EndElement() override; }; @@ -731,30 +731,30 @@ SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleChildContext( sal_uInt16 } SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: pStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix, rLocalName, xAttrList, nFamily, *this ); break; - case XML_STYLE_FAMILY_TABLE_TABLE: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_TABLE: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: + case XmlStyleFamily::TABLE_CELL: // Distinguish real and automatic styles. if (IsAutomaticStyle()) pStyle = new SwXMLItemSetStyleContext_Impl(GetSwImport(), nPrefix, rLocalName, xAttrList, *this, nFamily); - else if (nFamily == XML_STYLE_FAMILY_TABLE_CELL) // Real cell styles are used for table-template import. + else if (nFamily == XmlStyleFamily::TABLE_CELL) // Real cell styles are used for table-template import. pStyle = new XMLPropStyleContext(GetSwImport(), nPrefix, rLocalName, xAttrList, *this, nFamily); else SAL_WARN("sw.xml", "Context does not exists for non automatic table, column or row style."); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: // As long as there are no element items, we can use the text // style class. pStyle = new XMLTextShapeStyleContext( GetImport(), nPrefix, @@ -772,21 +772,21 @@ SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext( } SvXMLStyleContext *SwXMLStylesContext_Impl::CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: - case XML_STYLE_FAMILY_TABLE_TABLE: - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TEXT_PARAGRAPH: + case XmlStyleFamily::TABLE_TABLE: + case XmlStyleFamily::TABLE_ROW: pStyle = new XMLTextStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily, true ); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: // There are no writer specific defaults for graphic styles! pStyle = new XMLGraphicsDefaultStyle( GetImport(), nPrefix, rLocalName, xAttrList, *this ); @@ -809,7 +809,7 @@ SwXMLStylesContext_Impl::SwXMLStylesContext_Impl( { } -bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const +bool SwXMLStylesContext_Impl::InsertStyleFamily( XmlStyleFamily nFamily ) const { const SwXMLImport& rSwImport = GetSwImport(); const SfxStyleFamily nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); @@ -817,23 +817,23 @@ bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const bool bIns = true; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: bIns = bool(nStyleFamilyMask & SfxStyleFamily::Para); break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: bIns = bool(nStyleFamilyMask & SfxStyleFamily::Char); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: bIns = bool(nStyleFamilyMask & SfxStyleFamily::Frame); break; - case XML_STYLE_FAMILY_TEXT_LIST: + case XmlStyleFamily::TEXT_LIST: bIns = bool(nStyleFamilyMask & SfxStyleFamily::Pseudo); break; - case XML_STYLE_FAMILY_TEXT_OUTLINE: - case XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG: - case XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG: - case XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG: - case XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG: + case XmlStyleFamily::TEXT_OUTLINE: + case XmlStyleFamily::TEXT_FOOTNOTECONFIG: + case XmlStyleFamily::TEXT_ENDNOTECONFIG: + case XmlStyleFamily::TEXT_LINENUMBERINGCONFIG: + case XmlStyleFamily::TEXT_BIBLIOGRAPHYCONFIG: bIns = !(rSwImport.IsInsertMode() || rSwImport.IsStylesOnlyMode() || rSwImport.IsBlockMode()); break; @@ -846,16 +846,16 @@ bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const } rtl::Reference < SvXMLImportPropertyMapper > SwXMLStylesContext_Impl::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper; - if( nFamily == XML_STYLE_FAMILY_TABLE_TABLE ) + if( nFamily == XmlStyleFamily::TABLE_TABLE ) xMapper = XMLTextImportHelper::CreateTableDefaultExtPropMapper( const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() ); - else if( nFamily == XML_STYLE_FAMILY_TABLE_ROW ) + else if( nFamily == XmlStyleFamily::TABLE_ROW ) xMapper = XMLTextImportHelper::CreateTableRowDefaultExtPropMapper( const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() ); - else if( nFamily == XML_STYLE_FAMILY_TABLE_CELL ) + else if( nFamily == XmlStyleFamily::TABLE_CELL ) xMapper = XMLTextImportHelper::CreateTableCellExtPropMapper( const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() ); else @@ -864,12 +864,12 @@ rtl::Reference < SvXMLImportPropertyMapper > SwXMLStylesContext_Impl::GetImportP } uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesContainer( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { uno::Reference < container::XNameContainer > xStyles; - if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily ) + if( XmlStyleFamily::SD_GRAPHICS_ID == nFamily ) xStyles = const_cast<SvXMLImport *>(&GetImport())->GetTextImport()->GetFrameStyles(); - else if( XML_STYLE_FAMILY_TABLE_CELL == nFamily ) + else if( XmlStyleFamily::TABLE_CELL == nFamily ) xStyles = const_cast<SvXMLImport *>(&GetImport())->GetTextImport()->GetCellStyles(); if (!xStyles.is()) @@ -878,11 +878,11 @@ uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesC return xStyles; } -OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const +OUString SwXMLStylesContext_Impl::GetServiceName( XmlStyleFamily nFamily ) const { - if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily ) + if( XmlStyleFamily::SD_GRAPHICS_ID == nFamily ) return "com.sun.star.style.FrameStyle"; - else if( XML_STYLE_FAMILY_TABLE_CELL == nFamily ) + else if( XmlStyleFamily::TABLE_CELL == nFamily ) return "com.sun.star.style.CellStyle"; return SvXMLStylesContext::GetServiceName( nFamily ); @@ -898,7 +898,7 @@ namespace { class SwXMLMasterStylesContext_Impl : public XMLTextMasterStylesContext { protected: - virtual bool InsertStyleFamily( sal_uInt16 nFamily ) const override; + virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override; SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); } const SwXMLImport& GetSwImport() const @@ -920,13 +920,13 @@ SwXMLMasterStylesContext_Impl::SwXMLMasterStylesContext_Impl( { } -bool SwXMLMasterStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const +bool SwXMLMasterStylesContext_Impl::InsertStyleFamily( XmlStyleFamily nFamily ) const { bool bIns; const SwXMLImport& rSwImport = GetSwImport(); const SfxStyleFamily nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); - if( XML_STYLE_FAMILY_MASTER_PAGE == nFamily ) + if( XmlStyleFamily::MASTER_PAGE == nFamily ) bIns = bool(nStyleFamilyMask & SfxStyleFamily::Page); else bIns = XMLTextMasterStylesContext::InsertStyleFamily( nFamily ); @@ -1014,7 +1014,7 @@ void SwXMLImport::UpdateTextCollConditions( SwDoc *pDoc ) } bool SwXMLImport::FindAutomaticStyle( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, const OUString& rName, const SfxItemSet **ppItemSet ) const { @@ -1029,14 +1029,14 @@ bool SwXMLImport::FindAutomaticStyle( { if( ppItemSet ) { - if( XML_STYLE_FAMILY_TABLE_TABLE == pStyle->GetFamily() && + if( XmlStyleFamily::TABLE_TABLE == pStyle->GetFamily() && pStyle->HasMasterPageName() && !pStyle->IsPageDescConnected() ) pStyle->ConnectPageDesc(); (*ppItemSet) = pStyle->GetItemSet(); // resolve data style name late - if( XML_STYLE_FAMILY_TABLE_CELL == pStyle->GetFamily() && + if( XmlStyleFamily::TABLE_CELL == pStyle->GetFamily() && pStyle->ResolveDataStyleName() ) { (*ppItemSet) = pStyle->GetItemSet(); diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 485bf87e764e..ec3f00f60caa 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -269,7 +269,7 @@ protected: virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -284,7 +284,7 @@ public: void SwXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -293,7 +293,7 @@ void SwXMLAutoStylePoolP::exportStyleAttributes( { SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap); - if( XML_STYLE_FAMILY_TEXT_PARAGRAPH == nFamily ) + if( XmlStyleFamily::TEXT_PARAGRAPH == nFamily ) { for( const auto& rProperty : rProperties ) { diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 3373607993c3..01b22fef1c3a 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -150,11 +150,11 @@ SwXMLBodyContext_Impl::SwXMLBodyContext_Impl( SwXMLImport& rImport ) : rImport.GetTextImport()->GetTextStyles()); if (!xStyles->hasByName("Default")) { // this old name was used before LO 4.0 - rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, "Default", sDefault); + rImport.AddStyleDisplayName(XmlStyleFamily::TEXT_TEXT, "Default", sDefault); } if (!xStyles->hasByName("Default_20_Style")) { // this new name contains a space which is converted to _20_ on export - rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, "Default_20_Style", sDefault); + rImport.AddStyleDisplayName(XmlStyleFamily::TEXT_TEXT, "Default_20_Style", sDefault); } bool isEncoded(false); OUString const defaultEncoded( @@ -162,7 +162,7 @@ SwXMLBodyContext_Impl::SwXMLBodyContext_Impl( SwXMLImport& rImport ) : if (isEncoded && defaultEncoded != "Default_20_Style" && !xStyles->hasByName(defaultEncoded)) { // new name may contain a space which is converted to _20_ on export - rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, defaultEncoded, sDefault); + rImport.AddStyleDisplayName(XmlStyleFamily::TEXT_TEXT, defaultEncoded, sDefault); } } diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index b06f43d0168a..4b62c408b97b 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -149,13 +149,13 @@ public: SvXMLImportContext *CreateTableItemImportContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - sal_uInt16 nSubFamily, SfxItemSet& rItemSet ); + XmlStyleFamily nSubFamily, SfxItemSet& rItemSet ); const SvXMLTokenMap& GetDocElemTokenMap(); const SvXMLTokenMap& GetTableElemTokenMap(); const SvXMLTokenMap& GetTableCellAttrTokenMap(); - bool FindAutomaticStyle( sal_uInt16 nFamily, + bool FindAutomaticStyle( XmlStyleFamily nFamily, const OUString& rName, const SfxItemSet **ppItemSet ) const; void MergeListsAtDocumentInsertPosition(SwDoc *pDoc); diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx index 097786f3b576..9c1c8abb0885 100644 --- a/sw/source/filter/xml/xmlitemi.cxx +++ b/sw/source/filter/xml/xmlitemi.cxx @@ -337,25 +337,26 @@ SvXMLImportContext *SwXMLImport::CreateTableItemImportContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList, - sal_uInt16 nFamily, + XmlStyleFamily nFamily, SfxItemSet& rItemSet ) { SvXMLItemMapEntriesRef xItemMap; switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: xItemMap = m_xTableItemMap; break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: xItemMap = m_xTableColItemMap; break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: xItemMap = m_xTableRowItemMap; break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: xItemMap = m_xTableCellItemMap; break; + default: break; } m_pTableItemMapper->setMapEntries( xItemMap ); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index d49f23a76ff6..184047f4b622 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -779,7 +779,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl( const SfxPoolItem *pItem; const SfxItemSet *pAutoItemSet = nullptr; if( GetSwImport().FindAutomaticStyle( - XML_STYLE_FAMILY_TABLE_COLUMN, + XmlStyleFamily::TABLE_COLUMN, aStyleName, &pAutoItemSet ) && pAutoItemSet && SfxItemState::SET == pAutoItemSet->GetItemState( RES_FRM_SIZE, false, @@ -1988,7 +1988,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( const SfxItemSet *pAutoItemSet = nullptr; if( pCell->GetStartNode() && !sStyleName.isEmpty() && GetSwImport().FindAutomaticStyle( - XML_STYLE_FAMILY_TABLE_CELL, sStyleName, &pAutoItemSet ) ) + XmlStyleFamily::TABLE_CELL, sStyleName, &pAutoItemSet ) ) { if( pAutoItemSet ) pBoxFormat2->SetFormatAttr( *pAutoItemSet ); @@ -2150,7 +2150,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, if( 1 == (nBottomRow - nTopRow) && !rStyleName.isEmpty() && GetSwImport().FindAutomaticStyle( - XML_STYLE_FAMILY_TABLE_ROW, rStyleName, &pAutoItemSet ) ) + XmlStyleFamily::TABLE_ROW, rStyleName, &pAutoItemSet ) ) { if( pAutoItemSet ) pFrameFormat->SetFormatAttr( *pAutoItemSet ); @@ -2623,7 +2623,7 @@ void SwXMLTableContext::MakeTable() const SfxItemSet *pAutoItemSet = nullptr; if( !m_aStyleName.isEmpty() && rSwImport.FindAutomaticStyle( - XML_STYLE_FAMILY_TABLE_TABLE, m_aStyleName, &pAutoItemSet ) && + XmlStyleFamily::TABLE_TABLE, m_aStyleName, &pAutoItemSet ) && pAutoItemSet ) { const SfxPoolItem *pItem; diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 13f41c7b45f9..7645de3723ac 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -229,7 +229,7 @@ void SwXMLTextParagraphExport::_collectTextEmbeddedAutoStyles( lcl_addAspect( rObjRef, aStates, GetAutoFramePropMapper()->getPropertySetMapper() ); - Add( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, aStates ); + Add( XmlStyleFamily::TEXT_FRAME, rPropSet, aStates ); const XMLPropertyState **pStates = aStates; while( *pStates ) @@ -299,7 +299,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( lcl_addAspect( rObjRef, aStates, GetAutoFramePropMapper()->getPropertySetMapper() ); - const OUString sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, + const OUString sAutoStyle = Find( XmlStyleFamily::TEXT_FRAME, rPropSet, sStyle, aStates ); const XMLPropertyState **pStates = aStates; while( *pStates ) diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx index 9ebbd37f3375..d5f69b2fe7c4 100644 --- a/sw/source/uibase/config/StoredChapterNumbering.cxx +++ b/sw/source/uibase/config/StoredChapterNumbering.cxx @@ -275,7 +275,7 @@ public: { OUString name; OUString displayName; - sal_uInt16 nFamily(0); + XmlStyleFamily nFamily(XmlStyleFamily::DATA_STYLE); sax_fastparser::FastAttributeList *pAttribList = sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); @@ -284,14 +284,14 @@ public: if (aIter.getToken() == (XML_NAMESPACE_STYLE | XML_FAMILY)) { if (IsXMLToken(aIter.toString(), XML_TEXT)) - nFamily = XML_STYLE_FAMILY_TEXT_TEXT; + nFamily = XmlStyleFamily::TEXT_TEXT; else if (IsXMLToken(aIter.toString(), XML_NAME)) name = aIter.toString(); else if (IsXMLToken(aIter.toString(), XML_DISPLAY_NAME)) displayName = aIter.toString(); } - if (nFamily && !name.isEmpty() && !displayName.isEmpty()) + if (nFamily != XmlStyleFamily::DATA_STYLE && !name.isEmpty() && !displayName.isEmpty()) { rImport.AddStyleDisplayName(nFamily, name, displayName); } diff --git a/xmloff/inc/PageMasterStyleMap.hxx b/xmloff/inc/PageMasterStyleMap.hxx index e3df3350720d..2230cfacb7d9 100644 --- a/xmloff/inc/PageMasterStyleMap.hxx +++ b/xmloff/inc/PageMasterStyleMap.hxx @@ -88,7 +88,7 @@ // Need own entries for PageMasterStyleMap since these get *filtered* // at export time using CTF_PM_FLAGMASK and XML_PM_CTF_START as detector // to find the first entry for header/footer (!), see -// SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER +// SvXMLAutoStylePoolP_Impl::exportXML, look for XmlStyleFamily::PAGE_MASTER #define CTF_PM_REPEAT_OFFSET_X (XML_PM_CTF_START + 0x0037) #define CTF_PM_REPEAT_OFFSET_Y (XML_PM_CTF_START + 0x0038) #define CTF_PM_FILLGRADIENTNAME (XML_PM_CTF_START + 0x0039) diff --git a/xmloff/inc/SchXMLAutoStylePoolP.hxx b/xmloff/inc/SchXMLAutoStylePoolP.hxx index 55d862ea102b..6e8beb7714f4 100644 --- a/xmloff/inc/SchXMLAutoStylePoolP.hxx +++ b/xmloff/inc/SchXMLAutoStylePoolP.hxx @@ -29,7 +29,7 @@ class SchXMLAutoStylePoolP final : public SvXMLAutoStylePoolP virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, diff --git a/xmloff/inc/StyleMap.hxx b/xmloff/inc/StyleMap.hxx index 80564882cdde..b6b3249e1eae 100644 --- a/xmloff/inc/StyleMap.hxx +++ b/xmloff/inc/StyleMap.hxx @@ -26,13 +26,15 @@ #include <boost/functional/hash.hpp> #include <unordered_map> +enum class XmlStyleFamily; + struct StyleNameKey_Impl { - sal_uInt16 const m_nFamily; - OUString const m_aName; + XmlStyleFamily m_nFamily; + OUString m_aName; - StyleNameKey_Impl( sal_uInt16 nFamily, - const OUString& rName ) : + StyleNameKey_Impl( XmlStyleFamily nFamily, + const OUString& rName ) : m_nFamily( nFamily ), m_aName( rName ) { diff --git a/xmloff/inc/XMLChartStyleContext.hxx b/xmloff/inc/XMLChartStyleContext.hxx index 2e8ba9685c8d..f9c44de4ae12 100644 --- a/xmloff/inc/XMLChartStyleContext.hxx +++ b/xmloff/inc/XMLChartStyleContext.hxx @@ -39,7 +39,7 @@ public: SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~XMLChartStyleContext() override; /// is called after all styles have been read to apply styles diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index 27edb47004d2..f2b3788ff17f 100644 --- a/xmloff/qa/unit/uxmloff.cxx +++ b/xmloff/qa/unit/uxmloff.cxx @@ -75,13 +75,13 @@ void Test::testAutoStylePool() rtl::Reference< XMLChartExportPropertyMapper > xExportPropMapper( new XMLChartExportPropertyMapper( xSetMapper, *pExport ) ); - xPool->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, + xPool->AddFamily( XmlStyleFamily::TEXT_PARAGRAPH, GetXMLToken( XML_PARAGRAPH ), xExportPropMapper.get(), OUString( "Bob" ) ); std::vector< XMLPropertyState > aProperties; - OUString aName = xPool->Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aProperties ); + OUString aName = xPool->Add( XmlStyleFamily::TEXT_PARAGRAPH, "", aProperties ); // not that interesting but worth checking bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr); @@ -91,7 +91,7 @@ void Test::testAutoStylePool() CPPUNIT_ASSERT_EQUAL_MESSAGE( "style / naming changed", OUString("Bob1"), aName ); // find ourselves again: - OUString aSameName = xPool->Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aProperties ); + OUString aSameName = xPool->Find( XmlStyleFamily::TEXT_PARAGRAPH, "", aProperties ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "same style not found", aName, aSameName ); } diff --git a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx index bcb6c6e3b041..f4296bc484dd 100644 --- a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx +++ b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx @@ -34,7 +34,7 @@ SchXMLAutoStylePoolP::~SchXMLAutoStylePoolP() void SchXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -44,7 +44,7 @@ void SchXMLAutoStylePoolP::exportStyleAttributes( SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if( nFamily == XML_STYLE_FAMILY_SCH_CHART_ID ) + if( nFamily == XmlStyleFamily::SCH_CHART_ID ) { for( const auto& rProp : rProperties ) { diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 7329d3d16d81..b2339ab46622 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -996,7 +996,7 @@ void SchXMLExportHelper_Impl::exportAutoStyles() mrExport.exportAutoDataStyles(); // export chart auto styles - mrAutoStylePool.exportXML( XML_STYLE_FAMILY_SCH_CHART_ID ); + mrAutoStylePool.exportXML( XmlStyleFamily::SCH_CHART_ID ); // export auto styles for additional shapes mrExport.GetShapeExport()->exportAutoStyles(); @@ -1020,26 +1020,26 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( { // register chart auto-style family mrAutoStylePool.AddFamily( - XML_STYLE_FAMILY_SCH_CHART_ID, + XmlStyleFamily::SCH_CHART_ID, OUString( XML_STYLE_FAMILY_SCH_CHART_NAME ), mxExpPropMapper.get(), OUString( XML_STYLE_FAMILY_SCH_CHART_PREFIX )); // register shape family mrAutoStylePool.AddFamily( - XML_STYLE_FAMILY_SD_GRAPHICS_ID, + XmlStyleFamily::SD_GRAPHICS_ID, OUString( XML_STYLE_FAMILY_SD_GRAPHICS_NAME ), mxExpPropMapper.get(), OUString( XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX )); // register paragraph family also for shapes mrAutoStylePool.AddFamily( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, + XmlStyleFamily::TEXT_PARAGRAPH, GetXMLToken( XML_PARAGRAPH ), mxExpPropMapper.get(), OUString( 'P' )); // register text family also for shapes mrAutoStylePool.AddFamily( - XML_STYLE_FAMILY_TEXT_TEXT, + XmlStyleFamily::TEXT_TEXT, GetXMLToken( XML_TEXT ), mxExpPropMapper.get(), OUString( 'T' )); @@ -3489,7 +3489,7 @@ awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartD void SchXMLExportHelper_Impl::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates ) { if( !aStates.empty() ) - maAutoStyleNameQueue.push( mrAutoStylePool.Add( XML_STYLE_FAMILY_SCH_CHART_ID, aStates )); + maAutoStyleNameQueue.push( mrAutoStylePool.Add( XmlStyleFamily::SCH_CHART_ID, aStates )); } void SchXMLExportHelper_Impl::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates ) diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx index 834c951bd1da..c0c33afc76f8 100644 --- a/xmloff/source/chart/XMLChartStyleContext.cxx +++ b/xmloff/source/chart/XMLChartStyleContext.cxx @@ -63,7 +63,7 @@ XMLChartStyleContext::XMLChartStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) : XMLShapeStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), mrStyles( rStyles ) @@ -82,7 +82,7 @@ void lcl_NumberFormatStyleToProperty( const OUString& rStyleName, const OUString if( !rStyleName.isEmpty()) { const SvXMLNumFormatContext* pStyle = static_cast<const SvXMLNumFormatContext *>(rStylesContext.FindStyleChildContext( - XML_STYLE_FAMILY_DATA_STYLE, rStyleName, true )); + XmlStyleFamily::DATA_STYLE, rStyleName, true )); if( pStyle ) { sal_Int32 nNumberFormat = const_cast<SvXMLNumFormatContext*>(pStyle)->GetKey(); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 9c1059f852d9..cf783b4fc8c8 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1469,7 +1469,7 @@ OUString SvXMLImport::ResolveEmbeddedObjectURLFromBase64() return sRet; } -void SvXMLImport::AddStyleDisplayName( sal_uInt16 nFamily, +void SvXMLImport::AddStyleDisplayName( XmlStyleFamily nFamily, const OUString& rName, const OUString& rDisplayName ) { @@ -1496,11 +1496,11 @@ void SvXMLImport::AddStyleDisplayName( sal_uInt16 nFamily, ::std::pair<StyleMap::iterator,bool> aRes( mpStyleMap->insert( aValue ) ); SAL_WARN_IF( !aRes.second, "xmloff.core", - "duplicate style name of family " << nFamily << ": \"" << rName << "\""); + "duplicate style name of family " << static_cast<int>(nFamily) << ": \"" << rName << "\""); } -OUString SvXMLImport::GetStyleDisplayName( sal_uInt16 nFamily, +OUString SvXMLImport::GetStyleDisplayName( XmlStyleFamily nFamily, const OUString& rName ) const { OUString sName( rName ); diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx index dc0b67f4ad9b..432b7538fa80 100644 --- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx +++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx @@ -49,7 +49,7 @@ using ::xmloff::token::XML_PARAGRAPH_PROPERTIES; XMLGraphicsDefaultStyle::XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList, SvXMLStylesContext& rStyles ) -: XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, true ) +: XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XmlStyleFamily::SD_GRAPHICS_ID, true ) { } diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index b301986afde1..b7036dd5df4e 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -54,7 +54,7 @@ XMLShapeStyleContext::XMLShapeStyleContext( const OUString& rLName, const uno::Reference< xml::sax::XAttributeList >& xAttrList, SvXMLStylesContext& rStyles, - sal_uInt16 nFamily) + XmlStyleFamily nFamily) : XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), m_bIsNumRuleAlreadyConverted( false ) { @@ -199,15 +199,15 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet { CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT, -1 }, { -1, -1 } }; - static const sal_uInt16 aFamilies[] = + static const XmlStyleFamily aFamilies[] = { - XML_STYLE_FAMILY_SD_STROKE_DASH_ID, - XML_STYLE_FAMILY_SD_MARKER_ID, - XML_STYLE_FAMILY_SD_MARKER_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_HATCH_ID, - XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + XmlStyleFamily::SD_STROKE_DASH_ID, + XmlStyleFamily::SD_MARKER_ID, + XmlStyleFamily::SD_MARKER_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_HATCH_ID, + XmlStyleFamily::SD_FILL_IMAGE_ID }; rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 9471c10db1f7..48a8837fbfb0 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -412,17 +412,17 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent // add family name GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_SD_GRAPHICS_ID, + XmlStyleFamily::SD_GRAPHICS_ID, OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), GetPropertySetMapper(), OUString(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_SD_PRESENTATION_ID, + XmlStyleFamily::SD_PRESENTATION_ID, OUString(XML_STYLE_FAMILY_SD_PRESENTATION_NAME), GetPropertySetMapper(), OUString(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)); GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, + XmlStyleFamily::SD_DRAWINGPAGE_ID, OUString(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME), GetPresPagePropsMapper(), OUString(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX)); @@ -1532,12 +1532,12 @@ OUString SdXMLExport::ImpCreatePresPageStyleName( const Reference<XDrawPage>& xD { // there are filtered properties -> hard attributes // try to find this style in AutoStylePool - sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, aPropStates); + sStyleName = GetAutoStylePool()->Find(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, aPropStates); if(sStyleName.isEmpty()) { // Style did not exist, add it to AutoStalePool - sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, aPropStates); + sStyleName = GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, aPropStates); } } } @@ -1596,7 +1596,7 @@ void SdXMLExport::ImpWritePresentationStyles() aStEx->exportStyleFamily(xNamed->getName(), OUString(XML_STYLE_FAMILY_SD_PRESENTATION_NAME), aMapperRef, false, - XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix); + XmlStyleFamily::SD_PRESENTATION_ID, &aPrefix); } } } @@ -2202,7 +2202,7 @@ void SdXMLExport::ExportAutoStyles_() } // export draw-page styles - GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID ); + GetAutoStylePool()->exportXML( XmlStyleFamily::SD_DRAWINGPAGE_ID ); exportAutoDataStyles(); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index affbfd01a779..5eac15c7cbf7 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -191,12 +191,12 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, */ mrExport.GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_SD_GRAPHICS_ID, + XmlStyleFamily::SD_GRAPHICS_ID, XML_STYLE_FAMILY_SD_GRAPHICS_NAME, GetPropertySetMapper(), XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX); mrExport.GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_SD_PRESENTATION_ID, + XmlStyleFamily::SD_PRESENTATION_ID, XML_STYLE_FAMILY_SD_PRESENTATION_NAME, GetPropertySetMapper(), XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX); @@ -359,7 +359,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap OUString aFamilyName; xStylePropSet->getPropertyValue("Family") >>= aFamilyName; if( !aFamilyName.isEmpty() && aFamilyName != "graphics" ) - aShapeInfo.mnFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID; + aShapeInfo.mnFamily = XmlStyleFamily::SD_PRESENTATION_ID; } } catch(const beans::UnknownPropertyException&) @@ -370,7 +370,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap } // get parent-style name - if(XML_STYLE_FAMILY_SD_PRESENTATION_ID == aShapeInfo.mnFamily) + if(XmlStyleFamily::SD_PRESENTATION_ID == aShapeInfo.mnFamily) { aParentName = msPresentationStylePrefix; } @@ -491,11 +491,11 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap if( nCount ) { - aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aPropStates ); + aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Find( XmlStyleFamily::TEXT_PARAGRAPH, "", aPropStates ); if(aShapeInfo.msTextStyleName.isEmpty()) { // Style did not exist, add it to AutoStalePool - aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aPropStates); + aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TEXT_PARAGRAPH, "", aPropStates); } } } @@ -683,7 +683,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape // export style name if( !aShapeInfo.msStyleName.isEmpty() ) { - if(XML_STYLE_FAMILY_SD_GRAPHICS_ID == aShapeInfo.mnFamily) + if(XmlStyleFamily::SD_GRAPHICS_ID == aShapeInfo.mnFamily) mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, mrExport.EncodeStyleName( aShapeInfo.msStyleName) ); else mrExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STYLE_NAME, mrExport.EncodeStyleName( aShapeInfo.msStyleName) ); @@ -1023,12 +1023,12 @@ void XMLShapeExport::exportAutoStyles() // ...for graphic { - GetExport().GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_SD_GRAPHICS_ID ); + GetExport().GetAutoStylePool()->exportXML( XmlStyleFamily::SD_GRAPHICS_ID ); } // ...for presentation { - GetExport().GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_SD_PRESENTATION_ID ); + GetExport().GetAutoStylePool()->exportXML( XmlStyleFamily::SD_PRESENTATION_ID ); } if( mxShapeTableExport.is() ) @@ -1338,7 +1338,7 @@ void XMLShapeExport::ExportGraphicDefaults() aStEx->exportDefaultStyle( xDefaults, XML_STYLE_FAMILY_SD_GRAPHICS_NAME, xPropertySetMapper ); // write graphic family styles - aStEx->exportStyleFamily("graphics", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), xPropertySetMapper, false, XML_STYLE_FAMILY_SD_GRAPHICS_ID); + aStEx->exportStyleFamily("graphics", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), xPropertySetMapper, false, XmlStyleFamily::SD_GRAPHICS_ID); } } catch(const lang::ServiceNotRegisteredException&) diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index f99346709dbe..40efe2d0797b 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -152,7 +152,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, { bool bDone(false); OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_MASTER_PAGE, maMasterPageName ) ); + XmlStyleFamily::MASTER_PAGE, maMasterPageName ) ); for(sal_Int32 a = 0; !bDone && a < xMasterPages->getCount(); a++) { diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 4eff47a38f9c..e56e9ac9359e 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -328,7 +328,7 @@ void SdXMLGenericPageContext::EndElement() if( pStyles ) { const SdXMLNumberFormatImportContext* pSdNumStyle = - dynamic_cast< const SdXMLNumberFormatImportContext* >( pStyles->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, aDateTimeFormat, true ) ); + dynamic_cast< const SdXMLNumberFormatImportContext* >( pStyles->FindStyleChildContext( XmlStyleFamily::DATA_STYLE, aDateTimeFormat, true ) ); if( pSdNumStyle ) { @@ -361,7 +361,7 @@ void SdXMLGenericPageContext::SetStyle( OUString const & rStyleName ) if (const SdXMLStylesContext* pStyles = dynamic_cast<const SdXMLStylesContext *>(pContext)) { const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, rStyleName); + XmlStyleFamily::SD_DRAWINGPAGE_ID, rStyleName); if (const XMLPropStyleContext* pPropStyle = dynamic_cast<const XMLPropStyleContext*>(pStyle)) { @@ -417,7 +417,7 @@ void SdXMLGenericPageContext::SetLayout() if (const SdXMLStylesContext* pStyles = dynamic_cast<const SdXMLStylesContext *>(pContext)) { - const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName); + const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XmlStyleFamily::SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName); if (const SdXMLPresentationPageLayoutContext* pLayout = dynamic_cast<const SdXMLPresentationPageLayoutContext*>(pStyle)) { @@ -477,7 +477,7 @@ void SdXMLGenericPageContext::SetPageMaster( OUString const & rsPageMasterName ) // #80012# GetStylesContext() replaced with GetAutoStylesContext() const SvXMLStylesContext* pAutoStyles = GetSdImport().GetShapeImport()->GetAutoStylesContext(); - const SvXMLStyleContext* pStyle = pAutoStyles ? pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : nullptr; + const SvXMLStyleContext* pStyle = pAutoStyles ? pAutoStyles->FindStyleChildContext(XmlStyleFamily::SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : nullptr; if (const SdXMLPageMasterContext* pPageMaster = dynamic_cast<const SdXMLPageMasterContext*>(pStyle)) { diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 76f534a9819b..419c0174ae81 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -149,7 +149,7 @@ SdXMLShapeContext::SdXMLShapeContext( , mxShapes( rShapes ) , mxAttrList(xAttrList) , mbListContextPushed( false ) - , mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID) + , mnStyleFamily(XmlStyleFamily::SD_GRAPHICS_ID) , mbIsPlaceholder(false) , mbClearDefaultAttributes( true ) , mbIsUserTransformed(false) @@ -665,10 +665,10 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) uno::Reference< container::XNameAccess > xFamily; - if( XML_STYLE_FAMILY_SD_PRESENTATION_ID == mnStyleFamily ) + if( XmlStyleFamily::SD_PRESENTATION_ID == mnStyleFamily ) { aStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_SD_PRESENTATION_ID, + XmlStyleFamily::SD_PRESENTATION_ID, aStyleName ); sal_Int32 nPos = aStyleName.lastIndexOf( '-' ); if( -1 != nPos ) @@ -684,7 +684,7 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) // get graphics family xFamilies->getByName("graphics") >>= xFamily; aStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_SD_GRAPHICS_ID, + XmlStyleFamily::SD_GRAPHICS_ID, aStyleName ); } @@ -740,7 +740,7 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) if( nullptr == GetImport().GetShapeImport()->GetAutoStylesContext()) break; - const SvXMLStyleContext* pTempStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XML_STYLE_FAMILY_TEXT_PARAGRAPH, maTextStyleName); + const SvXMLStyleContext* pTempStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XmlStyleFamily::TEXT_PARAGRAPH, maTextStyleName); XMLPropStyleContext* pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext*>( pTempStyle ) ); // use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice if( pStyle == nullptr ) break; @@ -858,7 +858,7 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const OUString& rL else if( IsXMLToken( rLocalName, XML_STYLE_NAME ) ) { maDrawStyleName = rValue; - mnStyleFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID; + mnStyleFamily = XmlStyleFamily::SD_PRESENTATION_ID; } } else if( XML_NAMESPACE_SVG == nPrefix ) @@ -926,7 +926,7 @@ bool SdXMLShapeContext::isPresentationShape() const { if( !maPresentationClass.isEmpty() && const_cast<SdXMLShapeContext*>(this)->GetImport().GetShapeImport()->IsPresentationShapesSupported() ) { - if(XML_STYLE_FAMILY_SD_PRESENTATION_ID == mnStyleFamily) + if(XmlStyleFamily::SD_PRESENTATION_ID == mnStyleFamily) { return true; } diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index fae45f88f00a..5231163429c9 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -61,7 +61,7 @@ protected: /// whether to restore list context (#91964#) bool mbListContextPushed; - sal_uInt16 mnStyleFamily; + XmlStyleFamily mnStyleFamily; bool mbIsPlaceholder; bool mbClearDefaultAttributes; bool mbIsUserTransformed; diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index e1fc43066ddf..136713271f8d 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -139,7 +139,7 @@ public: const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, SvXMLStylesContext& rStyles, - sal_uInt16 nFamily = XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID); + XmlStyleFamily nFamily = XmlStyleFamily::SD_DRAWINGPAGE_ID); SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, @@ -160,7 +160,7 @@ SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext( const OUString& rLName, const uno::Reference< xml::sax::XAttributeList >& xAttrList, SvXMLStylesContext& rStyles, - sal_uInt16 nFamily) + XmlStyleFamily nFamily) : XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ) { } @@ -216,7 +216,7 @@ void SdXMLDrawingPageStyleContext::Finish( bool bOverwrite ) const SdXMLNumberFormatImportContext* pSdNumStyle = dynamic_cast< const SdXMLNumberFormatImportContext*> ( - GetStyles()->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, sStyleName, true ) ); + GetStyles()->FindStyleChildContext( XmlStyleFamily::DATA_STYLE, sStyleName, true ) ); if( pSdNumStyle ) nStyle = pSdNumStyle->GetDrawKey(); @@ -245,15 +245,15 @@ void SdXMLDrawingPageStyleContext::FillPropertySet( { CTF_FILLBITMAPNAME , -1 }, { -1, -1 } }; - static const sal_uInt16 aFamilies[MAX_SPECIAL_DRAW_STYLES] = + static const XmlStyleFamily aFamilies[MAX_SPECIAL_DRAW_STYLES] = { - XML_STYLE_FAMILY_SD_STROKE_DASH_ID, - XML_STYLE_FAMILY_SD_MARKER_ID, - XML_STYLE_FAMILY_SD_MARKER_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_HATCH_ID, - XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + XmlStyleFamily::SD_STROKE_DASH_ID, + XmlStyleFamily::SD_MARKER_ID, + XmlStyleFamily::SD_MARKER_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_HATCH_ID, + XmlStyleFamily::SD_FILL_IMAGE_ID }; rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = @@ -296,7 +296,7 @@ SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext( sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList>& xAttrList) -: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PAGEMASTERSTYLECONEXT_ID), +: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::SD_PAGEMASTERSTYLECONEXT_ID), mnBorderBottom( 0 ), mnBorderLeft( 0 ), mnBorderRight( 0 ), @@ -377,7 +377,7 @@ SdXMLPageMasterContext::SdXMLPageMasterContext( sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList>& xAttrList) -: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID) +: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::SD_PAGEMASTERCONEXT_ID) { // set family to something special at SvXMLStyleContext // for differences in search-methods @@ -426,7 +426,7 @@ SdXMLPresentationPageLayoutContext::SdXMLPresentationPageLayoutContext( sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList >& xAttrList) -: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID), +: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::SD_PRESENTATIONPAGELAYOUT_ID), mnTypeId( AUTOLAYOUT_NONE ) { // set family to something special at SvXMLStyleContext @@ -783,7 +783,7 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( if( msDisplayName.isEmpty() ) msDisplayName = msName; else if( msDisplayName != msName ) - GetImport().AddStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, msName, msDisplayName ); + GetImport().AddStyleDisplayName( XmlStyleFamily::MASTER_PAGE, msName, msDisplayName ); GetImport().GetShapeImport()->startPage( GetLocalShapesContext() ); @@ -845,7 +845,7 @@ SvXMLImportContextRef SdXMLMasterPageContext::CreateChildContext( XMLShapeStyleContext* pNew = new XMLShapeStyleContext( GetSdImport(), nPrefix, rLocalName, xAttrList, *GetSdImport().GetShapeImport()->GetStylesContext(), - XML_STYLE_FAMILY_SD_PRESENTATION_ID); + XmlStyleFamily::SD_PRESENTATION_ID); // add this style to the outer StylesContext class for later processing xContext = pNew; @@ -960,7 +960,7 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext( } SvXMLStyleContext* SdXMLStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< css::xml::sax::XAttributeList >& xAttrList) @@ -969,14 +969,15 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleStyleChildContext( switch( nFamily ) { - case XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID: + case XmlStyleFamily::SD_DRAWINGPAGE_ID: pContext = new SdXMLDrawingPageStyleContext(GetSdImport(), nPrefix, rLocalName, xAttrList, *this ); break; - case XML_STYLE_FAMILY_TABLE_CELL: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_CELL: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: pContext = new XMLShapeStyleContext( GetSdImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; + default: break; } // call base class @@ -987,7 +988,7 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleStyleChildContext( } SvXMLStyleContext* SdXMLStylesContext::CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList > & xAttrList ) @@ -996,9 +997,10 @@ SvXMLStyleContext* SdXMLStylesContext::CreateDefaultStyleStyleChildContext( switch( nFamily ) { - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: pContext = new XMLGraphicsDefaultStyle(GetSdImport(), nPrefix, rLocalName, xAttrList, *this ); break; + default: break; } // call base class @@ -1009,13 +1011,13 @@ SvXMLStyleContext* SdXMLStylesContext::CreateDefaultStyleStyleChildContext( } rtl::Reference< SvXMLImportPropertyMapper > SdXMLStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily) const + XmlStyleFamily nFamily) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper; switch( nFamily ) { - case XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID: + case XmlStyleFamily::SD_DRAWINGPAGE_ID: { if(!xPresImpPropMapper.is()) { @@ -1027,20 +1029,22 @@ rtl::Reference< SvXMLImportPropertyMapper > SdXMLStylesContext::GetImportPropert break; } - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: + case XmlStyleFamily::TABLE_CELL: { const rtl::Reference< XMLTableImport >& xTableImport( const_cast< SvXMLImport& >( GetImport() ).GetShapeImport()->GetShapeTableImport() ); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_COLUMN: xMapper = xTableImport->GetColumnImportPropertySetMapper().get(); break; - case XML_STYLE_FAMILY_TABLE_ROW: xMapper = xTableImport->GetRowImportPropertySetMapper().get(); break; - case XML_STYLE_FAMILY_TABLE_CELL: xMapper = xTableImport->GetCellImportPropertySetMapper().get(); break; + case XmlStyleFamily::TABLE_COLUMN: xMapper = xTableImport->GetColumnImportPropertySetMapper().get(); break; + case XmlStyleFamily::TABLE_ROW: xMapper = xTableImport->GetRowImportPropertySetMapper().get(); break; + case XmlStyleFamily::TABLE_CELL: xMapper = xTableImport->GetCellImportPropertySetMapper().get(); break; + default: break; } break; } + default: break; } // call base class @@ -1126,7 +1130,7 @@ void SdXMLStylesContext::SetMasterPageStyles(SdXMLMasterPageContext const & rMas { uno::Reference< container::XNameAccess > xMasterPageStyles( rStyleFamilies->getByName(rMaster.GetDisplayName()), UNO_QUERY_THROW ); OUString sPrefix(rMaster.GetDisplayName() + "-"); - ImpSetGraphicStyles(xMasterPageStyles, XML_STYLE_FAMILY_SD_PRESENTATION_ID, sPrefix); + ImpSetGraphicStyles(xMasterPageStyles, XmlStyleFamily::SD_PRESENTATION_ID, sPrefix); } catch (const uno::Exception&) { @@ -1144,7 +1148,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles() const const OUString sGraphicStyleName("graphics"); uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName(sGraphicStyleName), uno::UNO_QUERY_THROW ); - ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, OUString()); + ImpSetGraphicStyles(xGraphicPageStyles, XmlStyleFamily::SD_GRAPHICS_ID, OUString()); } catch( uno::Exception& ) { @@ -1159,7 +1163,7 @@ void SdXMLStylesContext::ImpSetCellStyles() const const OUString sCellStyleName("cell"); uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName(sCellStyleName), uno::UNO_QUERY_THROW ); - ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_TABLE_CELL, OUString()); + ImpSetGraphicStyles(xGraphicPageStyles, XmlStyleFamily::TABLE_CELL, OUString()); } catch( uno::Exception& ) { @@ -1201,7 +1205,7 @@ static bool canSkipReset(const OUString &rName, const XMLPropStyleContext* pProp // help function used by ImpSetGraphicStyles() and ImpSetMasterPageStyles() -void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAccess > const & xPageStyles, sal_uInt16 nFamily, const OUString& rPrefix) const +void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAccess > const & xPageStyles, XmlStyleFamily nFamily, const OUString& rPrefix) const { sal_Int32 nPrefLen(rPrefix.getLength()); diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index 6ca56fd7d3fc..c49be6294dc5 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -182,7 +182,7 @@ class SdXMLStylesContext : public SvXMLStylesContext void ImpSetGraphicStyles() const; void ImpSetCellStyles() const; void ImpSetGraphicStyles( css::uno::Reference< css::container::XNameAccess > const & xPageStyles, - sal_uInt16 nFamily, const OUString& rPrefix) const; + XmlStyleFamily nFamily, const OUString& rPrefix) const; protected: virtual SvXMLStyleContext* CreateStyleChildContext( @@ -191,13 +191,13 @@ protected: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList) override; virtual SvXMLStyleContext *CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList) override; virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -208,7 +208,7 @@ public: bool bIsAutoStyle); virtual void EndElement() override; - virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(sal_uInt16 nFamily) const override; + virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override; void SetMasterPageStyles(SdXMLMasterPageContext const & rMaster) const; diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index 41dce892b047..c6d4500e991b 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -81,7 +81,7 @@ namespace xmloff // our style family m_rContext.GetAutoStylePool()->AddFamily( - XML_STYLE_FAMILY_CONTROL_ID, token::GetXMLToken(token::XML_PARAGRAPH), + XmlStyleFamily::CONTROL_ID, token::GetXMLToken(token::XML_PARAGRAPH), m_xStyleExportMapper.get(), OUString( XML_STYLE_FAMILY_CONTROL_PREFIX ) ); @@ -250,7 +250,7 @@ namespace xmloff void OFormLayerXMLExport_Impl::exportAutoStyles() { - m_rContext.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_CONTROL_ID ); + m_rContext.GetAutoStylePool()->exportXML( XmlStyleFamily::CONTROL_ID ); } void OFormLayerXMLExport_Impl::exportForms(const Reference< XDrawPage >& _rxDrawPage) @@ -588,7 +588,7 @@ namespace xmloff if ( !aPropertyStates.empty() ) { // add to the style pool - OUString sColumnStyleName = m_rContext.GetAutoStylePool()->Add( XML_STYLE_FAMILY_CONTROL_ID, aPropertyStates ); + OUString sColumnStyleName = m_rContext.GetAutoStylePool()->Add( XmlStyleFamily::CONTROL_ID, aPropertyStates ); OSL_ENSURE( m_aGridColumnStyles.end() == m_aGridColumnStyles.find( xColumnProperties ), "OFormLayerXMLExport_Impl::collectGridColumnStylesAndIds: already have a style for this column!" ); diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 9d6909c6bc54..0263989f07d1 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -235,7 +235,7 @@ void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropert if (m_xAutoStyles.is()) { - const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, _rControlNumerStyleName); + const SvXMLStyleContext* pStyle = m_xAutoStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, _rControlNumerStyleName); if (pStyle) { const SvXMLNumFormatContext* pDataStyle = static_cast<const SvXMLNumFormatContext*>(pStyle); @@ -320,7 +320,7 @@ const SvXMLStyleContext* OFormLayerXMLImport_Impl::getStyleElement(const OUStrin // did you use setAutoStyleContext? const SvXMLStyleContext* pControlStyle = - m_xAutoStyles.is() ? m_xAutoStyles->FindStyleChildContext( XML_STYLE_FAMILY_TEXT_PARAGRAPH, _rStyleName ) : nullptr; + m_xAutoStyles.is() ? m_xAutoStyles->FindStyleChildContext( XmlStyleFamily::TEXT_PARAGRAPH, _rStyleName ) : nullptr; OSL_ENSURE( pControlStyle || !m_xAutoStyles.is(), OStringBuffer("OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"").append(OUStringToOString(_rStyleName, RTL_TEXTENCODING_ASCII_US)).append("\"!").getStr() ); return pControlStyle; diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index 5f61a157372f..932962c5f500 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -198,7 +198,7 @@ void XMLDashStyleImport::importXML( if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_STROKE_DASH_ID, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_STROKE_DASH_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 59495892df44..9d5316e5de91 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -181,7 +181,7 @@ void XMLGradientStyleImport::importXML( if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_GRADIENT_ID, rStrName, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index e7f03a817e53..a4f393adf7e2 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -144,7 +144,7 @@ void XMLHatchStyleImport::importXML( if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_HATCH_ID, rStrName, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_HATCH_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx index c96ab9996abe..c2b76463e6d6 100644 --- a/xmloff/source/style/ImageStyle.cxx +++ b/xmloff/source/style/ImageStyle.cxx @@ -155,7 +155,7 @@ bool XMLImageStyle::importXML(uno::Reference<xml::sax::XAttributeList> const & x if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_FILL_IMAGE_ID, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_FILL_IMAGE_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index 134f2b593f76..d9c323a224f2 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -130,7 +130,7 @@ void XMLMarkerStyleImport::importXML( if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_MARKER_ID, rStrName, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_MARKER_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index 4334fa09d6f8..6fcbe9270518 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -63,7 +63,7 @@ PageStyleContext::PageStyleContext( SvXMLImport& rImport, const uno::Reference< xml::sax::XAttributeList > & xAttrList, SvXMLStylesContext& rStyles, bool bDefaultStyle) : - XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_PAGE_MASTER, bDefaultStyle), + XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XmlStyleFamily::PAGE_MASTER, bDefaultStyle), sPageUsage(), m_bIsFillStyleAlreadyConverted(false) // { @@ -216,12 +216,12 @@ void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet }; // the style families associated with the same index modulo 4 - static sal_uInt16 aFamilies[] = + static const XmlStyleFamily aFamilies[] = { - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_HATCH_ID, - XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_HATCH_ID, + XmlStyleFamily::SD_FILL_IMAGE_ID }; // Fill PropertySet, but let it handle special properties not itself diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 13f1bbd12299..ae80775aac8b 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -62,7 +62,7 @@ bool PageMasterImportPropertyMapper::handleSpecialItem( if( CTF_PM_REGISTER_STYLE==nContextID ) { OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, rValue ) ); + XmlStyleFamily::TEXT_PARAGRAPH, rValue ) ); Reference < XNameContainer > xParaStyles = rImport.GetTextImport()->GetParaStyles(); if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) ) diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index f774186562c4..b8c4232e1405 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -122,7 +122,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = // based on the order used in this list. // Also need own defines for the used context flags (e.g. CTF_PM_FILLGRADIENTNAME instead of // CTF_FILLGRADIENTNAME) since these are used to *filter* up to which entry the attributes belong to the - // 'page-layout-properties' section (!), see SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER + // 'page-layout-properties' section (!), see SvXMLAutoStylePoolP_Impl::exportXML, look for XmlStyleFamily::PAGE_MASTER PLMAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, 0 ), PLMAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ), PLMAP( "FillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0 ), diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 30e4e56426d5..fd20d3fc938f 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -192,7 +192,7 @@ void XMLTransGradientStyleImport::importXML( if( !aDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_SD_GRADIENT_ID, rStrName, + rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName, aDisplayName ); rStrName = aDisplayName; } diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index 9c3fbb9feb39..ad706d987c96 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star::awt; using namespace ::xmloff::token; -#define XML_STYLE_FAMILY_FONT 1 +#define XML_STYLE_FAMILY_FONT XmlStyleFamily::PAGE_MASTER namespace { diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 9ac210aadde5..286b1d20a100 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -68,9 +68,9 @@ void XMLPageExport::collectPageMasterAutoStyle( if( !aPropStates.empty()) { OUString sParent; - rPageMasterName = rExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_PAGE_MASTER, sParent, aPropStates ); + rPageMasterName = rExport.GetAutoStylePool()->Find( XmlStyleFamily::PAGE_MASTER, sParent, aPropStates ); if (rPageMasterName.isEmpty()) - rPageMasterName = rExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_PAGE_MASTER, sParent, aPropStates); + rPageMasterName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::PAGE_MASTER, sParent, aPropStates); } } } @@ -162,7 +162,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) : xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper( xPageMasterPropSetMapper, rExp); - rExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_PAGE_MASTER, XML_STYLE_FAMILY_PAGE_MASTER_NAME, + rExport.GetAutoStylePool()->AddFamily( XmlStyleFamily::PAGE_MASTER, XML_STYLE_FAMILY_PAGE_MASTER_NAME, xPageMasterExportPropMapper, XML_STYLE_FAMILY_PAGE_MASTER_PREFIX, false ); Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(), @@ -209,7 +209,7 @@ void XMLPageExport::exportStyles( bool bUsed, bool bAutoStyles ) void XMLPageExport::exportAutoStyles() { - rExport.GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_PAGE_MASTER); + rExport.GetAutoStylePool()->exportXML(XmlStyleFamily::PAGE_MASTER); } void XMLPageExport::exportDefaultStyle() diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 22939b13af31..29033f3cecec 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -43,7 +43,7 @@ using namespace ::xmloff::token; // ctor/dtor class XMLAutoStyleFamily XMLAutoStyleFamily::XMLAutoStyleFamily( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference < SvXMLExportPropertyMapper > &rMapper, const OUString& rStrPrefix, @@ -52,7 +52,7 @@ XMLAutoStyleFamily::XMLAutoStyleFamily( mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), mbAsFamily( bAsFamily ) {} -XMLAutoStyleFamily::XMLAutoStyleFamily( sal_Int32 nFamily ) : +XMLAutoStyleFamily::XMLAutoStyleFamily( XmlStyleFamily nFamily ) : mnFamily(nFamily), mnCount(0), mnName(0), mbAsFamily(false) {} void XMLAutoStyleFamily::ClearEntries() @@ -350,7 +350,7 @@ SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl() // Adds stylefamily-information to sorted list void SvXMLAutoStylePoolP_Impl::AddFamily( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper, const OUString& rStrPrefix, @@ -385,7 +385,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( } void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper ) { std::unique_ptr<XMLAutoStyleFamily> pTemp(new XMLAutoStyleFamily(nFamily)); @@ -395,7 +395,7 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( } // Adds a name to list -void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName ) +void SvXMLAutoStylePoolP_Impl::RegisterName( XmlStyleFamily nFamily, const OUString& rName ) { std::unique_ptr<XMLAutoStyleFamily> pTemp(new XMLAutoStyleFamily(nFamily)); auto const iter = m_FamilySet.find(pTemp); @@ -405,7 +405,7 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& } // Adds a name to list -void SvXMLAutoStylePoolP_Impl::RegisterDefinedName( sal_Int32 nFamily, const OUString& rName ) +void SvXMLAutoStylePoolP_Impl::RegisterDefinedName( XmlStyleFamily nFamily, const OUString& rName ) { std::unique_ptr<XMLAutoStyleFamily> pTemp(new XMLAutoStyleFamily(nFamily)); auto const iter = m_FamilySet.find(pTemp); @@ -433,7 +433,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( // iterate over names for (const auto& rName : rFamily.maNameSet) { - aFamilies.push_back( rFamily.mnFamily ); + aFamilies.push_back( static_cast<sal_Int32>(rFamily.mnFamily) ); aNames.push_back( rName ); } } @@ -452,7 +452,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( // if not added, yet. bool SvXMLAutoStylePoolP_Impl::Add( - OUString& rName, sal_Int32 nFamily, const OUString& rParentName, + OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek ) { std::unique_ptr<XMLAutoStyleFamily> pTemp(new XMLAutoStyleFamily(nFamily)); @@ -477,7 +477,7 @@ bool SvXMLAutoStylePoolP_Impl::Add( } bool SvXMLAutoStylePoolP_Impl::AddNamed( - const OUString& rName, sal_Int32 nFamily, const OUString& rParentName, + const OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, const ::std::vector< XMLPropertyState >& rProperties ) { // get family and parent the same way as in Add() @@ -506,7 +506,7 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( // Search for an array of XMLPropertyState ( vector< XMLPropertyState > ) in list -OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily, +OUString SvXMLAutoStylePoolP_Impl::Find( XmlStyleFamily nFamily, const OUString& rParent, const vector< XMLPropertyState >& rProperties ) const { @@ -576,7 +576,7 @@ struct StyleComparator } void SvXMLAutoStylePoolP_Impl::exportXML( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const SvXMLAutoStylePoolP *pAntiImpl) const { // Get list of parents for current family (nFamily) @@ -679,7 +679,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( sal_Int32 nStart(-1); sal_Int32 nEnd(-1); - if (nFamily == XML_STYLE_FAMILY_PAGE_MASTER) + if (nFamily == XmlStyleFamily::PAGE_MASTER) { nStart = 0; sal_Int32 nIndex = 0; diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index e6d04d3c1a73..e33f41a835ab 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -38,6 +38,7 @@ class XMLAutoStylePoolParent; struct XMLAutoStyleFamily; class SvXMLExportPropertyMapper; class SvXMLExport; +enum class XmlStyleFamily; // Properties of a pool @@ -100,7 +101,7 @@ struct XMLAutoStyleFamily typedef std::set<std::unique_ptr<XMLAutoStylePoolParent>, comphelper::UniquePtrValueLess<XMLAutoStylePoolParent>> ParentSetType; - sal_uInt32 const mnFamily; + XmlStyleFamily const mnFamily; OUString const maStrFamilyName; rtl::Reference<SvXMLExportPropertyMapper> mxMapper; @@ -112,11 +113,11 @@ struct XMLAutoStyleFamily OUString const maStrPrefix; bool const mbAsFamily; - XMLAutoStyleFamily( sal_Int32 nFamily, const OUString& rStrName, + XMLAutoStyleFamily( XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference<SvXMLExportPropertyMapper>& rMapper, const OUString& rStrPrefix, bool bAsFamily ); - explicit XMLAutoStyleFamily( sal_Int32 nFamily ); + explicit XMLAutoStyleFamily( XmlStyleFamily nFamily ); XMLAutoStyleFamily(const XMLAutoStyleFamily&) = delete; XMLAutoStyleFamily& operator=(const XMLAutoStyleFamily&) = delete; @@ -144,32 +145,32 @@ public: SvXMLExport& GetExport() const { return rExport; } - void AddFamily( sal_Int32 nFamily, const OUString& rStrName, + void AddFamily( XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper, const OUString& rStrPrefix, bool bAsFamily ); - void SetFamilyPropSetMapper( sal_Int32 nFamily, + void SetFamilyPropSetMapper( XmlStyleFamily nFamily, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper ); - void RegisterName( sal_Int32 nFamily, const OUString& rName ); - void RegisterDefinedName( sal_Int32 nFamily, const OUString& rName ); + void RegisterName( XmlStyleFamily nFamily, const OUString& rName ); + void RegisterDefinedName( XmlStyleFamily nFamily, const OUString& rName ); void GetRegisteredNames( css::uno::Sequence<sal_Int32>& aFamilies, css::uno::Sequence<OUString>& aNames ); bool Add( - OUString& rName, sal_Int32 nFamily, + OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false ); bool AddNamed( - const OUString& rName, sal_Int32 nFamily, + const OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, const ::std::vector< XMLPropertyState >& rProperties ); - OUString Find( sal_Int32 nFamily, const OUString& rParent, + OUString Find( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const; - void exportXML( sal_Int32 nFamily, + void exportXML( XmlStyleFamily nFamily, const SvXMLAutoStylePoolP *pAntiImpl) const; void ClearEntries(); diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index abe719c7c7fe..c23207d0cbcd 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -148,7 +148,7 @@ static const OUStringLiteral gsFollowStyle( "FollowStyle" ); XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefault ) : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily, bDefault ) , mxStyles( &rStyles ) @@ -272,7 +272,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) // need to filter out old fill definitions when the new ones are used. The new // ones are used when a FillStyle is defined - const bool bTakeCareOfDrawingLayerFillStyle(xImpPrMap.is() && GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH); + const bool bTakeCareOfDrawingLayerFillStyle(xImpPrMap.is() && GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH); bool bDrawingLayerFillStylesUsed(false); if(bTakeCareOfDrawingLayerFillStyle) @@ -288,7 +288,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) } if( pSvXMLStylesContext->IsAutomaticStyle() - && ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) + && ( GetFamily() == XmlStyleFamily::TEXT_TEXT || GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ) ) { // Need to translate StyleName from temp MapNames to names // used in already imported items (already exist in the pool). This @@ -313,7 +313,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) sal_Int32 nLen = aValues.getLength(); if( nLen ) { - if( GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) + if( GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ) { aValues.realloc( nLen + 2 ); PropertyValue *pProps = aValues.getArray() + nLen; @@ -343,7 +343,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) if( xAutoStyle.is() ) { Sequence< OUString > aPropNames(1); - aPropNames[0] = GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ? + aPropNames[0] = GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ? OUStringLiteral("ParaAutoStyleName") : OUStringLiteral("CharAutoStyleName"); Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames ); @@ -366,7 +366,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() ); if( !xFamilies.is() ) { - SAL_WARN("xmloff", "no styles container for family " << GetFamily()); + SAL_WARN("xmloff", "no styles container for family " << static_cast<int>(GetFamily())); return; } @@ -620,22 +620,22 @@ void XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToSt if(a.mnIndex != -1) { const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); - sal_uInt16 aStyleFamily(0); + XmlStyleFamily aStyleFamily(XmlStyleFamily::DATA_STYLE); if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName) { - aStyleFamily = XML_STYLE_FAMILY_SD_GRADIENT_ID; + aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID; } else if(rPropName == s_FillHatchName) { - aStyleFamily = XML_STYLE_FAMILY_SD_HATCH_ID; + aStyleFamily = XmlStyleFamily::SD_HATCH_ID; } else if(rPropName == s_FillBitmapName) { - aStyleFamily = XML_STYLE_FAMILY_SD_FILL_IMAGE_ID; + aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID; } - if(aStyleFamily) + if(aStyleFamily != XmlStyleFamily::DATA_STYLE) { OUString sStyleName; diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 5b7a9dfd04be..e5334873c82c 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -403,7 +403,7 @@ void XMLStyleExport::exportStyleFamily( const char *pFamily, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper, - bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix) + bool bUsed, XmlStyleFamily nFamily, const OUString* pPrefix) { const OUString sFamily(OUString::createFromAscii(pFamily )); exportStyleFamily( sFamily, rXMLFamily, rPropMapper, bUsed, nFamily, @@ -413,7 +413,7 @@ void XMLStyleExport::exportStyleFamily( void XMLStyleExport::exportStyleFamily( const OUString& rFamily, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper, - bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix) + bool bUsed, XmlStyleFamily nFamily, const OUString* pPrefix) { assert(GetExport().GetModel().is()); Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(), UNO_QUERY ); diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index fe3d89188006..09dd224168bd 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -59,14 +59,14 @@ namespace void SvXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList&, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter&, const SvXMLNamespaceMap& ) const { - if ( XML_STYLE_FAMILY_CONTROL_ID == nFamily ) + if ( XmlStyleFamily::CONTROL_ID == nFamily ) { // it's a control-related style const rtl::Reference< XMLPropertySetMapper >& aPropertyMapper = rPropExp.getPropertySetMapper(); @@ -81,7 +81,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( } } - if( (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily) || (XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily) ) + if( (XmlStyleFamily::SD_GRAPHICS_ID == nFamily) || (XmlStyleFamily::SD_PRESENTATION_ID == nFamily) ) { // it's a graphics style const rtl::Reference< XMLPropertySetMapper >& aPropertyMapper = rPropExp.getPropertySetMapper(); assert(aPropertyMapper.is()); @@ -137,7 +137,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( } } - if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER ) + if( nFamily == XmlStyleFamily::PAGE_MASTER ) { for( const auto& rProp : rProperties ) { @@ -169,14 +169,14 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( void SvXMLAutoStylePoolP::exportStyleContent( const css::uno::Reference< css::xml::sax::XDocumentHandler > &, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter&, const SvXMLNamespaceMap& ) const { - if( nFamily != XML_STYLE_FAMILY_PAGE_MASTER ) + if( nFamily != XmlStyleFamily::PAGE_MASTER ) return; sal_Int32 nHeaderStartIndex(-1); @@ -271,7 +271,7 @@ SvXMLExport& SvXMLAutoStylePoolP::GetExport() const // TODO: remove this void SvXMLAutoStylePoolP::AddFamily( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, const OUString& aStrPrefix ) @@ -281,7 +281,7 @@ void SvXMLAutoStylePoolP::AddFamily( } void SvXMLAutoStylePoolP::AddFamily( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const OUString& rStrName, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper, const OUString& rStrPrefix, @@ -291,19 +291,19 @@ void SvXMLAutoStylePoolP::AddFamily( } void SvXMLAutoStylePoolP::SetFamilyPropSetMapper( - sal_Int32 nFamily, + XmlStyleFamily nFamily, const rtl::Reference < SvXMLExportPropertyMapper > & rMapper ) { pImpl->SetFamilyPropSetMapper( nFamily, rMapper ); } -void SvXMLAutoStylePoolP::RegisterName( sal_Int32 nFamily, +void SvXMLAutoStylePoolP::RegisterName( XmlStyleFamily nFamily, const OUString& rName ) { pImpl->RegisterName( nFamily, rName ); } -void SvXMLAutoStylePoolP::RegisterDefinedName( sal_Int32 nFamily, +void SvXMLAutoStylePoolP::RegisterDefinedName( XmlStyleFamily nFamily, const OUString& rName ) { pImpl->RegisterDefinedName( nFamily, rName ); @@ -327,10 +327,10 @@ void SvXMLAutoStylePoolP::RegisterNames( const OUString* pNames = aNames.getConstArray(); sal_Int32 nCount = min( aFamilies.getLength(), aNames.getLength() ); for( sal_Int32 n = 0; n < nCount; n++ ) - RegisterName( pFamilies[n], pNames[n] ); + RegisterName( static_cast<XmlStyleFamily>(pFamilies[n]), pNames[n] ); } -OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily, +OUString SvXMLAutoStylePoolP::Add( XmlStyleFamily nFamily, const vector< XMLPropertyState >& rProperties ) { OUString sName; @@ -338,7 +338,7 @@ OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily, return sName; } -OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily, +OUString SvXMLAutoStylePoolP::Add( XmlStyleFamily nFamily, const OUString& rParent, const vector< XMLPropertyState >& rProperties, bool bDontSeek ) { @@ -347,26 +347,26 @@ OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily, return sName; } -bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) +bool SvXMLAutoStylePoolP::Add(OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) { return pImpl->Add(rName, nFamily, rParent, rProperties); } -bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent, +bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) { return pImpl->AddNamed(rName, nFamily, rParent, rProperties); } -OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily, +OUString SvXMLAutoStylePoolP::Find( XmlStyleFamily nFamily, const OUString& rParent, const vector< XMLPropertyState >& rProperties ) const { return pImpl->Find( nFamily, rParent, rProperties ); } -void SvXMLAutoStylePoolP::exportXML( sal_Int32 nFamily ) const +void SvXMLAutoStylePoolP::exportXML( XmlStyleFamily nFamily ) const { pImpl->exportXML( nFamily, this ); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 199d8d7f3846..d0b6a053aff6 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1470,7 +1470,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, const uno::Reference<xml::sax::XAttributeList>& xAttrList, const sal_Int32 nTempKey, SvXMLStylesContext& rStyles ) : - SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_DATA_STYLE ), + SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::DATA_STYLE ), pData( nullptr ), pStyles( &rStyles ), aMyConditions(), @@ -1636,7 +1636,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) for (size_t i = 0; i < aMyConditions.size(); i++) { SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>( static_cast<const SvXMLNumFormatContext *>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName))); + XmlStyleFamily::DATA_STYLE, aMyConditions[i].sMapName))); if (this == pStyle) { SAL_INFO("xmloff.style", "invalid style:map references containing style"); diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index c1cea0e9cf0c..f724caaddf4b 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -485,7 +485,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties() pProps[nPos++].Value <<= nIndentAt; OUString sDisplayTextStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sTextStyleName ); + XmlStyleFamily::TEXT_TEXT, sTextStyleName ); pProps[nPos].Name = "CharStyleName"; pProps[nPos++].Value <<= sDisplayTextStyleName; @@ -1021,7 +1021,7 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, const OUString& rLName, const Reference< xml::sax::XAttributeList > & xAttrList, bool bOutl ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, bOutl ? XML_STYLE_FAMILY_TEXT_OUTLINE : XML_STYLE_FAMILY_TEXT_LIST ) +: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, bOutl ? XmlStyleFamily::TEXT_OUTLINE : XmlStyleFamily::TEXT_LIST ) , bConsecutive( false ) , bOutline( bOutl ) { @@ -1031,7 +1031,7 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, bool bOutl ) -: SvXMLStyleContext( rImport, nElement, xAttrList, bOutl ? XML_STYLE_FAMILY_TEXT_OUTLINE : XML_STYLE_FAMILY_TEXT_LIST ) +: SvXMLStyleContext( rImport, nElement, xAttrList, bOutl ? XmlStyleFamily::TEXT_OUTLINE : XmlStyleFamily::TEXT_LIST ) , bConsecutive( false ) , bOutline( bOutl ) { @@ -1173,7 +1173,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite ) xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) ); if( rName != GetName() ) - GetImport().AddStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST, + GetImport().AddStyleDisplayName( XmlStyleFamily::TEXT_LIST, GetName(), rName ); Any aAny = xPropSet->getPropertyValue( sNumberingRules ); diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 1c4bd1f4ea3c..4a6682035861 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -98,9 +98,9 @@ void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, if( IsXMLToken( rLocalName, XML_FAMILY ) ) { if( IsXMLToken( rValue, XML_PARAGRAPH ) ) - mnFamily = sal_uInt16(SfxStyleFamily::Para); + mnFamily = XmlStyleFamily(SfxStyleFamily::Para); else if( IsXMLToken( rValue, XML_TEXT ) ) - mnFamily = sal_uInt16(SfxStyleFamily::Char); + mnFamily = XmlStyleFamily(SfxStyleFamily::Char); } else if( IsXMLToken( rLocalName, XML_NAME ) ) { @@ -130,7 +130,7 @@ SvXMLStyleContext::SvXMLStyleContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< xml::sax::XAttributeList >&, - sal_uInt16 nFam, bool bDefault ) : + XmlStyleFamily nFam, bool bDefault ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbHidden( false ), mnFamily( nFam ), @@ -144,7 +144,7 @@ SvXMLStyleContext::SvXMLStyleContext( SvXMLImport& rImp, sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList > &, - sal_uInt16 nFam, bool bDefault ) : + XmlStyleFamily nFam, bool bDefault ) : SvXMLImportContext( rImp ), mbHidden( false ), mnFamily( nFam ), @@ -197,13 +197,13 @@ namespace { class SvXMLStyleIndex_Impl { - OUString const sName; - sal_uInt16 const nFamily; + OUString sName; + XmlStyleFamily nFamily; const rtl::Reference<SvXMLStyleContext> mxStyle; public: - SvXMLStyleIndex_Impl( sal_uInt16 nFam, const OUString& rName ) : + SvXMLStyleIndex_Impl( XmlStyleFamily nFam, const OUString& rName ) : sName( rName ), nFamily( nFam ) { @@ -217,7 +217,7 @@ public: } const OUString& GetName() const { return sName; } - sal_uInt16 GetFamily() const { return nFamily; } + XmlStyleFamily GetFamily() const { return nFamily; } const SvXMLStyleContext *GetStyle() const { return mxStyle.get(); } }; @@ -267,7 +267,7 @@ public: inline void AddStyle( SvXMLStyleContext *pStyle ); void Clear(); - const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily, + const SvXMLStyleContext *FindStyleChildContext( XmlStyleFamily nFamily, const OUString& rName, bool bCreateIndex ) const; bool IsAutomaticStyle() const { return bAutomaticStyle; } @@ -293,7 +293,7 @@ void SvXMLStylesContext_Impl::Clear() aStyles.clear(); } -const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( sal_uInt16 nFamily, +const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( XmlStyleFamily nFamily, const OUString& rName, bool bCreateIndex ) const { @@ -372,7 +372,7 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPr case XML_TOK_STYLE_STYLE: case XML_TOK_STYLE_DEFAULT_STYLE: { - sal_uInt16 nFamily = 0; + XmlStyleFamily nFamily = XmlStyleFamily::DATA_STYLE; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { @@ -470,116 +470,118 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPr } SvXMLStyleContext *SvXMLStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: - case XML_STYLE_FAMILY_TEXT_TEXT: - case XML_STYLE_FAMILY_TEXT_SECTION: + case XmlStyleFamily::TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_TEXT: + case XmlStyleFamily::TEXT_SECTION: pStyle = new XMLTextStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; - case XML_STYLE_FAMILY_TEXT_RUBY: + case XmlStyleFamily::TEXT_RUBY: pStyle = new XMLPropStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; - case XML_STYLE_FAMILY_SCH_CHART_ID: + case XmlStyleFamily::SCH_CHART_ID: pStyle = new XMLChartStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: - case XML_STYLE_FAMILY_SD_PRESENTATION_ID: - case XML_STYLE_FAMILY_SD_POOL_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: + case XmlStyleFamily::SD_PRESENTATION_ID: + case XmlStyleFamily::SD_POOL_ID: pStyle = new XMLShapeStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); + break; + default: break; } return pStyle; } SvXMLStyleContext *SvXMLStylesContext::CreateDefaultStyleStyleChildContext( - sal_uInt16 /*nFamily*/, sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, + XmlStyleFamily /*nFamily*/, sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & ) { return nullptr; } -bool SvXMLStylesContext::InsertStyleFamily( sal_uInt16 ) const +bool SvXMLStylesContext::InsertStyleFamily( XmlStyleFamily ) const { return true; } -sal_uInt16 SvXMLStylesContext::GetFamily( const OUString& rValue ) +XmlStyleFamily SvXMLStylesContext::GetFamily( const OUString& rValue ) { - sal_uInt16 nFamily = 0U; + XmlStyleFamily nFamily = XmlStyleFamily::DATA_STYLE; if( IsXMLToken( rValue, XML_PARAGRAPH ) ) { - nFamily = XML_STYLE_FAMILY_TEXT_PARAGRAPH; + nFamily = XmlStyleFamily::TEXT_PARAGRAPH; } else if( IsXMLToken( rValue, XML_TEXT ) ) { - nFamily = XML_STYLE_FAMILY_TEXT_TEXT; + nFamily = XmlStyleFamily::TEXT_TEXT; } else if( IsXMLToken( rValue, XML_DATA_STYLE ) ) { - nFamily = XML_STYLE_FAMILY_DATA_STYLE; + nFamily = XmlStyleFamily::DATA_STYLE; } else if ( IsXMLToken( rValue, XML_SECTION ) ) { - nFamily = XML_STYLE_FAMILY_TEXT_SECTION; + nFamily = XmlStyleFamily::TEXT_SECTION; } else if( IsXMLToken( rValue, XML_TABLE ) ) { - nFamily = XML_STYLE_FAMILY_TABLE_TABLE; + nFamily = XmlStyleFamily::TABLE_TABLE; } else if( IsXMLToken( rValue, XML_TABLE_COLUMN ) ) - nFamily = XML_STYLE_FAMILY_TABLE_COLUMN; + nFamily = XmlStyleFamily::TABLE_COLUMN; else if( IsXMLToken( rValue, XML_TABLE_ROW ) ) - nFamily = XML_STYLE_FAMILY_TABLE_ROW; + nFamily = XmlStyleFamily::TABLE_ROW; else if( IsXMLToken( rValue, XML_TABLE_CELL ) ) - nFamily = XML_STYLE_FAMILY_TABLE_CELL; + nFamily = XmlStyleFamily::TABLE_CELL; else if ( rValue == XML_STYLE_FAMILY_SD_GRAPHICS_NAME ) { - nFamily = XML_STYLE_FAMILY_SD_GRAPHICS_ID; + nFamily = XmlStyleFamily::SD_GRAPHICS_ID; } else if ( rValue == XML_STYLE_FAMILY_SD_PRESENTATION_NAME ) { - nFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID; + nFamily = XmlStyleFamily::SD_PRESENTATION_ID; } else if ( rValue == XML_STYLE_FAMILY_SD_POOL_NAME ) { - nFamily = XML_STYLE_FAMILY_SD_POOL_ID; + nFamily = XmlStyleFamily::SD_POOL_ID; } else if ( rValue == XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME ) { - nFamily = XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID; + nFamily = XmlStyleFamily::SD_DRAWINGPAGE_ID; } else if ( rValue == XML_STYLE_FAMILY_SCH_CHART_NAME ) { - nFamily = XML_STYLE_FAMILY_SCH_CHART_ID; + nFamily = XmlStyleFamily::SCH_CHART_ID; } else if ( IsXMLToken( rValue, XML_RUBY ) ) { - nFamily = XML_STYLE_FAMILY_TEXT_RUBY; + nFamily = XmlStyleFamily::TEXT_RUBY; } return nFamily; } rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: if( !mxParaImpPropMapper.is() ) { SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this); @@ -589,7 +591,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper } xMapper = mxParaImpPropMapper; break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: if( !mxTextImpPropMapper.is() ) { SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this); @@ -600,7 +602,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper xMapper = mxTextImpPropMapper; break; - case XML_STYLE_FAMILY_TEXT_SECTION: + case XmlStyleFamily::TEXT_SECTION: // don't cache section mapper, as it's rarely used // *sigh*, cast to non-const, because this is a const method, // but SvXMLImport::GetTextImport() isn't. @@ -608,7 +610,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper GetSectionImportPropertySetMapper(); break; - case XML_STYLE_FAMILY_TEXT_RUBY: + case XmlStyleFamily::TEXT_RUBY: // don't cache section mapper, as it's rarely used // *sigh*, cast to non-const, because this is a const method, // but SvXMLImport::GetTextImport() isn't. @@ -616,9 +618,9 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper GetRubyImportPropertySetMapper(); break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: - case XML_STYLE_FAMILY_SD_PRESENTATION_ID: - case XML_STYLE_FAMILY_SD_POOL_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: + case XmlStyleFamily::SD_PRESENTATION_ID: + case XmlStyleFamily::SD_POOL_ID: if(!mxShapeImpPropMapper.is()) { rtl::Reference< XMLShapeImportHelper > aImpHelper = const_cast<SvXMLImport&>(GetImport()).GetShapeImport(); @@ -627,7 +629,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper } xMapper = mxShapeImpPropMapper; break; - case XML_STYLE_FAMILY_SCH_CHART_ID: + case XmlStyleFamily::SCH_CHART_ID: if( ! mxChartImpPropMapper.is() ) { XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper( false ); @@ -635,7 +637,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper } xMapper = mxChartImpPropMapper; break; - case XML_STYLE_FAMILY_PAGE_MASTER: + case XmlStyleFamily::PAGE_MASTER: if( ! mxPageImpPropMapper.is() ) { XMLPropertySetMapper *pPropMapper = @@ -646,17 +648,18 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper } xMapper = mxPageImpPropMapper; break; + default: break; } return xMapper; } -Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFamily ) const +Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily nFamily ) const { Reference < XAutoStyleFamily > xAutoStyles; - if( XML_STYLE_FAMILY_TEXT_TEXT == nFamily || XML_STYLE_FAMILY_TEXT_PARAGRAPH == nFamily) + if( XmlStyleFamily::TEXT_TEXT == nFamily || XmlStyleFamily::TEXT_PARAGRAPH == nFamily) { - bool bPara = XML_STYLE_FAMILY_TEXT_PARAGRAPH == nFamily; + bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily; OUString sName; if( !bPara && mxTextAutoStyles.is() ) xAutoStyles = mxTextAutoStyles; @@ -682,25 +685,26 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFa } Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { Reference < XNameContainer > xStyles; OUString sName; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: if( mxParaStyles.is() ) xStyles = mxParaStyles; else sName = "ParagraphStyles"; break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: if( mxTextStyles.is() ) xStyles = mxTextStyles; else sName = "CharacterStyles"; break; + default: break; } if( !xStyles.is() && !sName.isEmpty() ) { @@ -715,13 +719,14 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: const_cast<SvXMLStylesContext *>(this)->mxParaStyles = xStyles; break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: const_cast<SvXMLStylesContext *>(this)->mxTextStyles = xStyles; break; + default: break; } } } @@ -730,17 +735,18 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( return xStyles; } -OUString SvXMLStylesContext::GetServiceName( sal_uInt16 nFamily ) const +OUString SvXMLStylesContext::GetServiceName( XmlStyleFamily nFamily ) const { OUString sServiceName; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: sServiceName = gsParaStyleServiceName; break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: sServiceName = gsTextStyleServiceName; break; + default: break; } return sServiceName; @@ -809,9 +815,9 @@ void SvXMLStylesContext::CopyAutoStylesToDoc() for( i = 0; i < nCount; i++ ) { SvXMLStyleContext *pStyle = GetStyle( i ); - if( !pStyle || ( pStyle->GetFamily() != XML_STYLE_FAMILY_TEXT_TEXT && - pStyle->GetFamily() != XML_STYLE_FAMILY_TEXT_PARAGRAPH && - pStyle->GetFamily() != XML_STYLE_FAMILY_TABLE_CELL ) ) + if( !pStyle || ( pStyle->GetFamily() != XmlStyleFamily::TEXT_TEXT && + pStyle->GetFamily() != XmlStyleFamily::TEXT_PARAGRAPH && + pStyle->GetFamily() != XmlStyleFamily::TABLE_CELL ) ) continue; pStyle->CreateAndInsert( false ); } @@ -867,7 +873,7 @@ void SvXMLStylesContext::FinishStyles( bool bOverwrite ) } const SvXMLStyleContext *SvXMLStylesContext::FindStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, const OUString& rName, bool bCreateIndex ) const { diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index db34766a09cb..1970987f8129 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -180,15 +180,15 @@ XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExp mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), true ) ); mxColumnExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get(), true ) ); - mrExport.GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, + mrExport.GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_COLUMN, OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME), mxColumnExportPropertySetMapper.get(), OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX)); - mrExport.GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_ROW, + mrExport.GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_ROW, OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME), mxRowExportPropertySetMapper.get(), OUString(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX)); - mrExport.GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_CELL, + mrExport.GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_CELL, OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME), mxCellExportPropertySetMapper.get(), OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX)); @@ -223,7 +223,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( has_states( aPropStates ) ) { - const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TABLE_COLUMN, aPropStates) ); + const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_COLUMN, aPropStates) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); xTableInfo->maColumnStyleMap[xKey] = sStyleName; } @@ -247,7 +247,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( has_states( aRowPropStates ) ) { - const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TABLE_ROW, aRowPropStates) ); + const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_ROW, aRowPropStates) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); xTableInfo->maRowStyleMap[xKey] = sStyleName; } @@ -273,7 +273,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) OUString sStyleName; std::vector< XMLPropertyState > aCellPropStates( mxCellExportPropertySetMapper->Filter( xCellSet ) ); if( has_states( aCellPropStates ) ) - sStyleName = mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TABLE_CELL, aCellPropStates); + sStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_CELL, aCellPropStates); else sStyleName = sParentStyleName; @@ -480,7 +480,7 @@ void XMLTableExport::exportTableStyles() aStEx.set(new XMLStyleExport(mrExport, mrExport.GetAutoStylePool().get())); } - aStEx->exportStyleFamily(sCellStyleName, OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME), mxCellExportPropertySetMapper.get(), true, XML_STYLE_FAMILY_TABLE_CELL); + aStEx->exportStyleFamily(sCellStyleName, OUString(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME), mxCellExportPropertySetMapper.get(), true, XmlStyleFamily::TABLE_CELL); exportTableTemplates(); } @@ -492,9 +492,9 @@ void XMLTableExport::exportAutoStyles() if( !mbExportTables ) return; - mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_COLUMN ); - mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_ROW ); - mrExport.GetAutoStylePool()->exportXML( XML_STYLE_FAMILY_TABLE_CELL ); + mrExport.GetAutoStylePool()->exportXML( XmlStyleFamily::TABLE_COLUMN ); + mrExport.GetAutoStylePool()->exportXML( XmlStyleFamily::TABLE_ROW ); + mrExport.GetAutoStylePool()->exportXML( XmlStyleFamily::TABLE_CELL ); } const TableStyleElement* getTableStyleMap() diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 45b4693f7d35..513e3e595774 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -440,7 +440,7 @@ void XMLTableImportContext::InitColumns() { const XMLPropStyleContext* pStyle = dynamic_cast< const XMLPropStyleContext* >( - pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN, xInfo->msStyleName) ); + pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN, xInfo->msStyleName) ); if( pStyle ) { @@ -513,7 +513,7 @@ SvXMLImportContext * XMLTableImportContext::ImportRow( sal_uInt16 nPrefix, const { const XMLPropStyleContext* pStyle = dynamic_cast< const XMLPropStyleContext* >( - pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW, sStyleName) ); + pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW, sStyleName) ); if( pStyle ) { @@ -671,7 +671,7 @@ XMLCellImportContext::XMLCellImportContext( SvXMLImport& rImport, const Referenc { const XMLPropStyleContext* pStyle = dynamic_cast< const XMLPropStyleContext* >( - pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL, sStyleName) ); + pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL, sStyleName) ); if( pStyle ) { @@ -739,7 +739,7 @@ void XMLCellImportContext::EndElement() XMLTableTemplateContext::XMLTableTemplateContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_TABLE_TEMPLATE_ID, false ) +: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::TABLE_TEMPLATE_ID, false ) { } diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 4177068ae434..3a0ce16d1fe6 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -128,7 +128,7 @@ XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( sal_uInt16 nPrfx, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) -: SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG) +: SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XmlStyleFamily::TEXT_FOOTNOTECONFIG) , sNumFormat("1") , sNumSync("false") , nOffset(0) @@ -150,7 +150,7 @@ XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( if( IsXMLToken( rValue, XML_ENDNOTE ) ) { bIsEndnote = true; - SetFamily( XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG ); + SetFamily( XmlStyleFamily::TEXT_FOOTNOTECONFIG ); } break; } @@ -359,28 +359,28 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( if (!sCitationStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sCitationStyle ); + XmlStyleFamily::TEXT_TEXT, sCitationStyle ); rConfig->setPropertyValue(gsPropertyCharStyleName, aAny); } if (!sAnchorStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sAnchorStyle ); + XmlStyleFamily::TEXT_TEXT, sAnchorStyle ); rConfig->setPropertyValue(gsPropertyAnchorCharStyleName, aAny); } if (!sPageStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_MASTER_PAGE, sPageStyle ); + XmlStyleFamily::MASTER_PAGE, sPageStyle ); rConfig->setPropertyValue(gsPropertyPageStyleName, aAny); } if (!sDefaultStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, sDefaultStyle ); + XmlStyleFamily::TEXT_PARAGRAPH, sDefaultStyle ); rConfig->setPropertyValue(gsPropertyParagraphStyleName, aAny); } diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx index c9a80c6d6d6d..be28561eaf63 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx @@ -77,7 +77,7 @@ void XMLIndexAlphabeticalSourceContext::ProcessAttribute( { sMainEntryStyleName = rValue; OUString sDisplayStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sMainEntryStyleName ); + XmlStyleFamily::TEXT_TEXT, sMainEntryStyleName ); const Reference < css::container::XNameContainer >& rStyles = GetImport().GetTextImport()->GetTextStyles(); bMainEntryStyleNameOK = rStyles.is() && rStyles->hasByName( sDisplayStyleName ); @@ -169,7 +169,7 @@ void XMLIndexAlphabeticalSourceContext::EndElement() if (bMainEntryStyleNameOK) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sMainEntryStyleName ); + XmlStyleFamily::TEXT_TEXT, sMainEntryStyleName ); rIndexPropertySet->setPropertyValue("MainEntryCharacterStyleName",aAny); } diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index b888d0a7e506..35fd6e61fd92 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -58,7 +58,7 @@ XMLIndexBibliographyConfigurationContext::XMLIndexBibliographyConfigurationConte sal_uInt16 nPrfx, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) : - SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG), + SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XmlStyleFamily::TEXT_BIBLIOGRAPHYCONFIG), sSuffix(), sPrefix(), sAlgorithm(), diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx index 3addf0827632..8811f4830917 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx @@ -72,7 +72,7 @@ void XMLIndexSimpleEntryContext::StartElement( { m_sCharStyleName = xAttrList->getValueByIndex(nAttr); OUString sDisplayStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, m_sCharStyleName ); + XmlStyleFamily::TEXT_TEXT, m_sCharStyleName ); // #142494#: Check if style exists const Reference < css::container::XNameContainer > & rStyles = GetImport().GetTextImport()->GetTextStyles(); @@ -117,7 +117,7 @@ void XMLIndexSimpleEntryContext::FillPropertyValues( { rValues[1].Name = "CharacterStyleName"; aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, + XmlStyleFamily::TEXT_TEXT, m_sCharStyleName ); rValues[1].Value = aAny; } diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index 4139ce7606c3..f310776dfee0 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -93,7 +93,7 @@ void XMLIndexTOCStylesContext::EndElement() for(sal_Int32 i = 0; i < nCount; i++) { aStyleNamesSequence[i] = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, + XmlStyleFamily::TEXT_PARAGRAPH, aStyleNames[i] ); } diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index 85ec9b7bc088..5d3ec9b12d4f 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -169,7 +169,7 @@ void XMLIndexTemplateContext::EndElement() { OUString sDisplayStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, + XmlStyleFamily::TEXT_PARAGRAPH, sStyleName ); // #i50288#: Check if style exists const Reference < css::container::XNameContainer > & rStyles = diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx index 08189caaadb4..d6d994b869a0 100644 --- a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx @@ -68,7 +68,7 @@ void XMLIndexTitleTemplateContext::StartElement( { sStyleName = xAttrList->getValueByIndex(nAttr); OUString sDisplayStyleName = GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, sStyleName ); + XmlStyleFamily::TEXT_PARAGRAPH, sStyleName ); const Reference < css::container::XNameContainer >& rStyles = GetImport().GetTextImport()->GetParaStyles(); bStyleNameOK = rStyles.is() && rStyles->hasByName( sDisplayStyleName ); @@ -86,7 +86,7 @@ void XMLIndexTitleTemplateContext::EndElement() if (bStyleNameOK) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_PARAGRAPH, + XmlStyleFamily::TEXT_PARAGRAPH, sStyleName ); rTOCPropertySet->setPropertyValue("ParaStyleHeading", aAny); } diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index 63570b8710f8..bfc192b3f907 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -59,7 +59,7 @@ XMLLineNumberingImportContext::XMLLineNumberingImportContext( sal_uInt16 nPrfx, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList) -: SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG) +: SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XmlStyleFamily::TEXT_LINENUMBERINGCONFIG) , sNumFormat(GetXMLToken(XML_1)) , sNumLetterSync(GetXMLToken(XML_FALSE)) , nOffset(-1) @@ -223,10 +223,10 @@ void XMLLineNumberingImportContext::CreateAndInsert(bool) // set style name (if it exists) if ( GetImport().GetStyles()->FindStyleChildContext( - XML_STYLE_FAMILY_TEXT_TEXT, sStyleName ) != nullptr ) + XmlStyleFamily::TEXT_TEXT, sStyleName ) != nullptr ) { aAny <<= GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, sStyleName ); + XmlStyleFamily::TEXT_TEXT, sStyleName ); xLineNumbering->setPropertyValue(gsCharStyleName, aAny); } diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index aaeb9b244d21..76f352b4b8fb 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -86,14 +86,14 @@ void XMLSectionExport::ExportSectionStart( if (bAutoStyles) { // get PropertySet and add section style - GetParaExport().Add( XML_STYLE_FAMILY_TEXT_SECTION, xPropertySet ); + GetParaExport().Add( XmlStyleFamily::TEXT_SECTION, xPropertySet ); } else { // always export section style GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetParaExport().Find( - XML_STYLE_FAMILY_TEXT_SECTION, + XmlStyleFamily::TEXT_SECTION, xPropertySet, "" ) ); // xml:id for RDF metadata diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index d9819994e790..e8b04539dd81 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -586,7 +586,7 @@ void XMLTextFrameContext_Impl::Create() if( !sStyleName.isEmpty() ) { OUString sDisplayStyleName( GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_SD_GRAPHICS_ID, sStyleName ) ); + XmlStyleFamily::SD_GRAPHICS_ID, sStyleName ) ); const Reference < XNameContainer > & rStyles = xTextImportHelper->GetFrameStyles(); if( rStyles.is() && diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx index a6050686e652..e2c059d69b1c 100644 --- a/xmloff/source/text/XMLTextListItemContext.cxx +++ b/xmloff/source/text/XMLTextListItemContext.cxx @@ -75,7 +75,7 @@ XMLTextListItemContext::XMLTextListItemContext( if ( !sListStyleOverrideName.isEmpty() ) { OUString sDisplayStyleName( - GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST, + GetImport().GetStyleDisplayName( XmlStyleFamily::TEXT_LIST, sListStyleOverrideName ) ); const Reference < container::XNameContainer >& rNumStyles = rTxtImp.GetNumberingStyles(); diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index f417df1f29d7..c29f45ff5178 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -66,7 +66,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, bool bOverwrite ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_MASTER_PAGE ) +: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XmlStyleFamily::MASTER_PAGE ) , bInsertHeader( false ) , bInsertFooter( false ) , bInsertHeaderLeft( false ) @@ -106,7 +106,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, if( !sDisplayName.isEmpty() ) { - rImport.AddStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, sName, + rImport.AddStyleDisplayName( XmlStyleFamily::MASTER_PAGE, sName, sDisplayName ); } else @@ -277,7 +277,7 @@ void XMLTextMasterPageContext::Finish( bool bOverwrite ) { OUString sDisplayFollow( GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_MASTER_PAGE, sFollow ) ); + XmlStyleFamily::MASTER_PAGE, sFollow ) ); if( sDisplayFollow.isEmpty() || !xPageStyles->hasByName( sDisplayFollow ) ) sDisplayFollow = xStyle->getName(); diff --git a/xmloff/source/text/XMLTextMasterStylesContext.cxx b/xmloff/source/text/XMLTextMasterStylesContext.cxx index 5a157441690a..ff3895467294 100644 --- a/xmloff/source/text/XMLTextMasterStylesContext.cxx +++ b/xmloff/source/text/XMLTextMasterStylesContext.cxx @@ -31,7 +31,7 @@ using ::xmloff::token::IsXMLToken; using ::xmloff::token::XML_MASTER_PAGE; -bool XMLTextMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const +bool XMLTextMasterStylesContext::InsertStyleFamily( XmlStyleFamily ) const { return true; } @@ -55,7 +55,7 @@ SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleChildContext( if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_MASTER_PAGE ) && - InsertStyleFamily( XML_STYLE_FAMILY_MASTER_PAGE ) ) + InsertStyleFamily( XmlStyleFamily::MASTER_PAGE ) ) pContext = new XMLTextMasterPageContext( GetImport(), nPrefix, rLocalName, xAttrList, @@ -67,7 +67,7 @@ SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleChildContext( } SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleStyleChildContext( - sal_uInt16 /*nFamily*/, + XmlStyleFamily /*nFamily*/, sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const Reference< XAttributeList > & /*xAttrList*/ ) diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx index 627f3ee3d60d..a30177eccf54 100644 --- a/xmloff/source/text/XMLTextShapeStyleContext.cxx +++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx @@ -144,7 +144,7 @@ static const OUStringLiteral gsIsAutoUpdate( "IsAutoUpdate" ); XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) : XMLShapeStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), bAutoUpdate( false ) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index e2265228f662..d69ae5bc6e40 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -792,7 +792,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( if (FIELD_ID_COMBINED_CHARACTERS != nToken) { GetExport().GetTextParagraphExport()->Add( - XML_STYLE_FAMILY_TEXT_TEXT, xRangePropSet); + XmlStyleFamily::TEXT_TEXT, xRangePropSet); } // process special styles for each field (e.g. data styles) @@ -898,7 +898,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( "need proper PropertyState for combined characters"); const XMLPropertyState *aStates[] = { pCombinedCharactersPropertyState.get(), nullptr }; GetExport().GetTextParagraphExport()->Add( - XML_STYLE_FAMILY_TEXT_TEXT, xRangePropSet, + XmlStyleFamily::TEXT_TEXT, xRangePropSet, aStates); break; } diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index c41fad2fe63b..b794392cb687 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -79,7 +79,7 @@ void XMLTextParagraphExport::exportTextFootnote( if (bAutoStyles) { // handle formatting of citation mark - Add( XML_STYLE_FAMILY_TEXT_TEXT, rPropSet ); + Add( XmlStyleFamily::TEXT_TEXT, rPropSet ); // handle formatting within footnote exportTextFootnoteHelper(xFootnote, xText, rText, diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index ab1500fc76e5..5dcae9a2d2bf 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1302,8 +1302,8 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars, if( (rFlags & CONV_STAR_FONT_FLAGS_VALID) == 0 ) { XMLTextStyleContext *pStyle = nullptr; - sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH - : XML_STYLE_FAMILY_TEXT_TEXT; + XmlStyleFamily nFamily = bPara ? XmlStyleFamily::TEXT_PARAGRAPH + : XmlStyleFamily::TEXT_TEXT; if (!rStyleName.isEmpty() && m_xImpl->m_xAutoStyles.is()) { const SvXMLStyleContext* pTempStyle = @@ -1425,7 +1425,7 @@ static bool lcl_HasListStyle( const OUString& sStyleName, if ( !aParentStyle.isEmpty() ) { aParentStyle = - rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, + rImport.GetStyleDisplayName( XmlStyleFamily::TEXT_PARAGRAPH, aParentStyle ); } if ( aParentStyle.isEmpty() || !xParaStyles->hasByName( aParentStyle ) ) @@ -1508,8 +1508,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( static const char s_PageDescName[] = "PageDescName"; static const char s_OutlineLevel[] = "OutlineLevel"; - const sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH - : XML_STYLE_FAMILY_TEXT_TEXT; + const XmlStyleFamily nFamily = bPara ? XmlStyleFamily::TEXT_PARAGRAPH + : XmlStyleFamily::TEXT_TEXT; XMLTextStyleContext *pStyle = nullptr; OUString sStyleName( rStyleName ); if (!sStyleName.isEmpty() && m_xImpl->m_xAutoStyles.is()) @@ -1740,7 +1740,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( { OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_MASTER_PAGE, + XmlStyleFamily::MASTER_PAGE, pStyle->GetMasterPageName()) ); if( sDisplayName.isEmpty() || (m_xImpl->m_xPageStyles.is() && @@ -1755,7 +1755,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( { OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, + XmlStyleFamily::TEXT_TEXT, pStyle->GetDropCapStyleName()) ); if (m_xImpl->m_xTextStyles->hasByName(sDisplayName) && xPropSetInfo->hasPropertyByName("DropCapCharStyleName")) @@ -2147,7 +2147,7 @@ void XMLTextImportHelper::SetHyperlink( { OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, rStyleName ) ); + XmlStyleFamily::TEXT_TEXT, rStyleName ) ); if( !sDisplayName.isEmpty() && xPropSetInfo->hasPropertyByName(s_UnvisitedCharStyleName) && m_xImpl->m_xTextStyles->hasByName(sDisplayName)) @@ -2158,7 +2158,7 @@ void XMLTextImportHelper::SetHyperlink( sDisplayName = rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, rVisitedStyleName ); + XmlStyleFamily::TEXT_TEXT, rVisitedStyleName ); if( !sDisplayName.isEmpty() && xPropSetInfo->hasPropertyByName(s_VisitedCharStyleName) && m_xImpl->m_xTextStyles->hasByName(sDisplayName)) @@ -2192,7 +2192,7 @@ void XMLTextImportHelper::SetRuby( { const SvXMLStyleContext* pTempStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> - FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY, + FindStyleChildContext( XmlStyleFamily::TEXT_RUBY, rStyleName, true ); XMLPropStyleContext *pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle)); @@ -2205,7 +2205,7 @@ void XMLTextImportHelper::SetRuby( { OUString sDisplayName( rImport.GetStyleDisplayName( - XML_STYLE_FAMILY_TEXT_TEXT, rTextStyleName ) ); + XmlStyleFamily::TEXT_TEXT, rTextStyleName ) ); if( (!sDisplayName.isEmpty()) && m_xImpl->m_xTextStyles->hasByName( sDisplayName )) { @@ -2435,7 +2435,7 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName, const SvXMLStyleContext* pStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> - FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, + FindStyleChildContext( XmlStyleFamily::DATA_STYLE, sStyleName, true ); // get appropriate context @@ -2471,7 +2471,7 @@ const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUSt { const SvXMLStyleContext* pTempStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> - FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName, + FindStyleChildContext( XmlStyleFamily::TEXT_LIST, rName, true ); pStyle = dynamic_cast< const SvxXMLListStyleContext* >(pTempStyle); } @@ -2486,7 +2486,7 @@ XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rN { const SvXMLStyleContext* pTempStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> - FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName, + FindStyleChildContext( XmlStyleFamily::SD_GRAPHICS_ID, rName, true ); pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle)); } @@ -2503,7 +2503,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle( const SvXMLStyleContext* pTempStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> FindStyleChildContext( - XML_STYLE_FAMILY_TEXT_SECTION, + XmlStyleFamily::TEXT_SECTION, rName, true ); pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle)); } @@ -2520,7 +2520,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster( const SvXMLStyleContext* pTempStyle = static_cast<SvXMLStylesContext *>(m_xImpl->m_xAutoStyles.get())-> FindStyleChildContext( - XML_STYLE_FAMILY_PAGE_MASTER, + XmlStyleFamily::PAGE_MASTER, rName, true ); pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle)); } diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index 14de8ffb551e..a3831c735b4c 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -411,7 +411,7 @@ XMLTextListsHelper::MakeNumRule( if ( !i_StyleName.isEmpty() && i_StyleName != i_ParentStyleName ) { const OUString sDisplayStyleName( - i_rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST, + i_rImport.GetStyleDisplayName( XmlStyleFamily::TEXT_LIST, i_StyleName) ); const uno::Reference < container::XNameContainer >& rNumStyles( i_rImport.GetTextImport()->GetNumberingStyles() ); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index e23c78b5a962..4aa66869a9f8 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -527,28 +527,29 @@ void FieldParamExporter::ExportParameter(const OUString& sKey, const OUString& s m_pExport->EndElement(XML_NAMESPACE_FIELD, XML_PARAM, false); } -void XMLTextParagraphExport::Add( sal_uInt16 nFamily, +void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, const Reference < XPropertySet > & rPropSet, const XMLPropertyState** ppAddStates, bool bDontSeek ) { rtl::Reference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: xPropMapper = GetParaPropMapper(); break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: xPropMapper = GetTextPropMapper(); break; - case XML_STYLE_FAMILY_TEXT_FRAME: + case XmlStyleFamily::TEXT_FRAME: xPropMapper = GetAutoFramePropMapper(); break; - case XML_STYLE_FAMILY_TEXT_SECTION: + case XmlStyleFamily::TEXT_SECTION: xPropMapper = GetSectionPropMapper(); break; - case XML_STYLE_FAMILY_TEXT_RUBY: + case XmlStyleFamily::TEXT_RUBY: xPropMapper = GetRubyPropMapper(); break; + default: break; } SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" ); @@ -571,7 +572,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, sal_uInt16 nIgnoreProps = 0; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: if( xPropSetInfo->hasPropertyByName( gsParaStyleName ) ) { rPropSet->getPropertyValue( gsParaStyleName ) >>= sParent; @@ -617,7 +618,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } } break; - case XML_STYLE_FAMILY_TEXT_TEXT: + case XmlStyleFamily::TEXT_TEXT: { // Get parent and remove hyperlinks (they aren't of interest) rtl::Reference< XMLPropertySetMapper > xPM(xPropMapper->getPropertySetMapper()); @@ -645,16 +646,17 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } } break; - case XML_STYLE_FAMILY_TEXT_FRAME: + case XmlStyleFamily::TEXT_FRAME: if( xPropSetInfo->hasPropertyByName( gsFrameStyleName ) ) { rPropSet->getPropertyValue( gsFrameStyleName ) >>= sParent; } break; - case XML_STYLE_FAMILY_TEXT_SECTION: - case XML_STYLE_FAMILY_TEXT_RUBY: + case XmlStyleFamily::TEXT_SECTION: + case XmlStyleFamily::TEXT_RUBY: ; // section styles have no parents break; + default: break; } if (aPropStates.size() - nIgnoreProps) { @@ -670,16 +672,17 @@ static bool lcl_validPropState( const XMLPropertyState& rState ) return rState.mnIndex != -1; } -void XMLTextParagraphExport::Add( sal_uInt16 nFamily, +void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, MultiPropertySetHelper& rPropSetHelper, const Reference < XPropertySet > & rPropSet) { rtl::Reference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: xPropMapper = GetParaPropMapper(); break; + default: break; } SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" ); @@ -728,7 +731,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, OUString sParent, sCondParent; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: if( rPropSetHelper.hasProperty( PARA_STYLE_NAME_AUTO ) ) { rPropSetHelper.getValue( PARA_STYLE_NAME_AUTO, rPropSet, @@ -741,6 +744,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } break; + default: break; } if( std::any_of( aPropStates.begin(), aPropStates.end(), lcl_validPropState ) ) @@ -753,8 +757,8 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, } OUString XMLTextParagraphExport::Find( - sal_uInt16 nFamily, - const Reference < XPropertySet > & rPropSet, + XmlStyleFamily nFamily, + const Reference < XPropertySet > & rPropSet, const OUString& rParent, const XMLPropertyState** ppAddStates) const { @@ -762,18 +766,19 @@ OUString XMLTextParagraphExport::Find( rtl::Reference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) { - case XML_STYLE_FAMILY_TEXT_PARAGRAPH: + case XmlStyleFamily::TEXT_PARAGRAPH: xPropMapper = GetParaPropMapper(); break; - case XML_STYLE_FAMILY_TEXT_FRAME: + case XmlStyleFamily::TEXT_FRAME: xPropMapper = GetAutoFramePropMapper(); break; - case XML_STYLE_FAMILY_TEXT_SECTION: + case XmlStyleFamily::TEXT_SECTION: xPropMapper = GetSectionPropMapper(); break; - case XML_STYLE_FAMILY_TEXT_RUBY: + case XmlStyleFamily::TEXT_RUBY: xPropMapper = GetRubyPropMapper(); break; + default: break; } SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" ); if( !xPropMapper.is() ) @@ -863,7 +868,7 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink( aPropStates.erase( aFirstDel ); } sName = GetAutoStylePool().Find( - XML_STYLE_FAMILY_TEXT_TEXT, + XmlStyleFamily::TEXT_TEXT, OUString(), // AutoStyles should not have parents! aPropStates ); rbHasAutoStyle = true; @@ -1257,7 +1262,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); OUString aPrefix(u'P'); - rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, + rAutoStylePool.AddFamily( XmlStyleFamily::TEXT_PARAGRAPH, sFamily, xParaPropMapper, aPrefix ); xPropMapper = new XMLTextPropertySetMapper( TextPropMap::TEXT, true ); @@ -1265,7 +1270,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( GetExport() ); sFamily = GetXMLToken(XML_TEXT); aPrefix = "T"; - rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily, + rAutoStylePool.AddFamily( XmlStyleFamily::TEXT_TEXT, sFamily, xTextPropMapper, aPrefix ); xPropMapper = new XMLTextPropertySetMapper( TextPropMap::AUTO_FRAME, true ); @@ -1273,7 +1278,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( GetExport() ); sFamily = XML_STYLE_FAMILY_SD_GRAPHICS_NAME; aPrefix = "fr"; - rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_FRAME, sFamily, + rAutoStylePool.AddFamily( XmlStyleFamily::TEXT_FRAME, sFamily, xAutoFramePropMapper, aPrefix ); xPropMapper = new XMLTextPropertySetMapper( TextPropMap::SECTION, true ); @@ -1281,14 +1286,14 @@ XMLTextParagraphExport::XMLTextParagraphExport( GetExport() ); sFamily = GetXMLToken( XML_SECTION ); aPrefix = "Sect" ; - rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily, + rAutoStylePool.AddFamily( XmlStyleFamily::TEXT_SECTION, sFamily, xSectionPropMapper, aPrefix ); xPropMapper = new XMLTextPropertySetMapper( TextPropMap::RUBY, true ); xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper ); sFamily = GetXMLToken( XML_RUBY ); aPrefix = "Ru"; - rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily, + rAutoStylePool.AddFamily( XmlStyleFamily::TEXT_RUBY, sFamily, xRubyPropMapper, aPrefix ); xPropMapper = new XMLTextPropertySetMapper( TextPropMap::FRAME, true ); @@ -1442,24 +1447,24 @@ void XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) { Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles(); OUString sName; - sal_uInt16 nFamily; + XmlStyleFamily nFamily; for ( int i = 0; i < 3; ++i ) { if ( 0 == i ) { sName = "CharacterStyles" ; - nFamily = XML_STYLE_FAMILY_TEXT_TEXT; + nFamily = XmlStyleFamily::TEXT_TEXT; } else if ( 1 == i ) { sName = "RubyStyles" ; - nFamily = XML_STYLE_FAMILY_TEXT_RUBY; + nFamily = XmlStyleFamily::TEXT_RUBY; } else { sName = "ParagraphStyles" ; - nFamily = XML_STYLE_FAMILY_TEXT_PARAGRAPH; + nFamily = XmlStyleFamily::TEXT_PARAGRAPH; } Any aAny = xAutoStyleFamilies->getByName( sName ); @@ -1566,7 +1571,7 @@ void XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) Any aAny = xSections->getByIndex( i ); Reference< XTextSection > xSection = *o3tl::doAccess<Reference<XTextSection>>(aAny); Reference < XPropertySet > xPSet( xSection, uno::UNO_QUERY ); - Add( XML_STYLE_FAMILY_TEXT_SECTION, xPSet ); + Add( XmlStyleFamily::TEXT_SECTION, xPSet ); } } } @@ -1903,7 +1908,7 @@ void XMLTextParagraphExport::exportParagraph( { if( bAutoStyles ) { - Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, rPropSetHelper, xPropSet ); + Add( XmlStyleFamily::TEXT_PARAGRAPH, rPropSetHelper, xPropSet ); } else { @@ -1940,7 +1945,7 @@ void XMLTextParagraphExport::exportParagraph( } } - OUString sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, sStyle ); + OUString sAutoStyle = Find( XmlStyleFamily::TEXT_PARAGRAPH, xPropSet, sStyle ); if ( sAutoStyle.isEmpty() ) sAutoStyle = sStyle; if( !sAutoStyle.isEmpty() ) @@ -1958,7 +1963,7 @@ void XMLTextParagraphExport::exportParagraph( xPropSet ) >>= sCondStyle; if( sCondStyle != sStyle ) { - sCondStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, + sCondStyle = Find( XmlStyleFamily::TEXT_PARAGRAPH, xPropSet, sCondStyle ); if( !sCondStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, @@ -2794,11 +2799,11 @@ void XMLTextParagraphExport::exportAnyTextFrame( _collectTextEmbeddedAutoStyles( xPropSet ); // No text frame style for shapes (#i28745#) else if ( FrameType::Shape != eType ) - Add( XML_STYLE_FAMILY_TEXT_FRAME, xPropSet ); + Add( XmlStyleFamily::TEXT_FRAME, xPropSet ); if( pRangePropSet && lcl_txtpara_isBoundAsChar( xPropSet, xPropSet->getPropertySetInfo() ) ) - Add( XML_STYLE_FAMILY_TEXT_TEXT, *pRangePropSet ); + Add( XmlStyleFamily::TEXT_TEXT, *pRangePropSet ); switch( eType ) { @@ -2907,7 +2912,7 @@ void XMLTextParagraphExport::_exportTextFrame( OUString aMinHeightValue; OUString sMinWidthValue; - OUString sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); + OUString sAutoStyle = Find( XmlStyleFamily::TEXT_FRAME, rPropSet, sStyle ); if ( sAutoStyle.isEmpty() ) sAutoStyle = sStyle; if( !sAutoStyle.isEmpty() ) @@ -3068,7 +3073,7 @@ void XMLTextParagraphExport::_exportTextGraphic( rPropSet->getPropertyValue( gsFrameStyleName ) >>= sStyle; } - OUString sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); + OUString sAutoStyle = Find( XmlStyleFamily::TEXT_FRAME, rPropSet, sStyle ); if ( sAutoStyle.isEmpty() ) sAutoStyle = sStyle; if( !sAutoStyle.isEmpty() ) @@ -3437,7 +3442,7 @@ void XMLTextParagraphExport::exportTextRange( Reference< XPropertySet > xPropSet( rTextRange, UNO_QUERY ); if ( bAutoStyles ) { - Add( XML_STYLE_FAMILY_TEXT_TEXT, xPropSet ); + Add( XmlStyleFamily::TEXT_TEXT, xPropSet ); } else { @@ -3681,15 +3686,15 @@ void XMLTextParagraphExport::recordTrackedChangesNoXText() void XMLTextParagraphExport::exportTextAutoStyles() { - GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_PARAGRAPH ); + GetAutoStylePool().exportXML( XmlStyleFamily::TEXT_PARAGRAPH ); - GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_TEXT ); + GetAutoStylePool().exportXML( XmlStyleFamily::TEXT_TEXT ); - GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_FRAME ); + GetAutoStylePool().exportXML( XmlStyleFamily::TEXT_FRAME ); - GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_SECTION ); + GetAutoStylePool().exportXML( XmlStyleFamily::TEXT_SECTION ); - GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_RUBY ); + GetAutoStylePool().exportXML( XmlStyleFamily::TEXT_RUBY ); maListAutoPool.exportXML(); } @@ -3709,7 +3714,7 @@ void XMLTextParagraphExport::exportRuby( { // ruby auto styles if (bStart) - Add( XML_STYLE_FAMILY_TEXT_RUBY, rPropSet ); + Add( XmlStyleFamily::TEXT_RUBY, rPropSet ); } else { @@ -3728,7 +3733,7 @@ void XMLTextParagraphExport::exportRuby( // ruby style GetExport().CheckAttrList(); - OUString sStyleName(Find(XML_STYLE_FAMILY_TEXT_RUBY, rPropSet, "")); + OUString sStyleName(Find(XmlStyleFamily::TEXT_RUBY, rPropSet, "")); SAL_WARN_IF(sStyleName.isEmpty(), "xmloff", "Can't find ruby style!"); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, sStyleName); diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index 543682d207ec..163d1485f4a5 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -140,13 +140,13 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg ) } } exportStyleFamily( "ParagraphStyles", GetXMLToken(XML_PARAGRAPH), GetParaPropMapper(), - bUsed, XML_STYLE_FAMILY_TEXT_PARAGRAPH); + bUsed, XmlStyleFamily::TEXT_PARAGRAPH); exportStyleFamily( "CharacterStyles", GetXMLToken(XML_TEXT), GetTextPropMapper(), - bUsed, XML_STYLE_FAMILY_TEXT_TEXT ); + bUsed, XmlStyleFamily::TEXT_TEXT ); // get shape export to make sure the frame family is added correctly. GetExport().GetShapeExport(); exportStyleFamily( "FrameStyles", OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), xFramePropMapper, - bUsed, XML_STYLE_FAMILY_TEXT_FRAME); + bUsed, XmlStyleFamily::TEXT_FRAME); exportNumStyles( bUsed ); if( !IsBlockMode() ) { diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index ac8c2198f189..a5422a01e4e9 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -128,7 +128,7 @@ void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey, XMLTextStyleContext::XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle ) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, bDefaultStyle ) , m_nOutlineLevel( -1 ) @@ -211,7 +211,7 @@ void XMLTextStyleContext::CreateAndInsert( bool bOverwrite ) } sal_uInt16 nCategory = ParagraphStyleCategory::TEXT; - if( XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() && + if( XmlStyleFamily::TEXT_PARAGRAPH == GetFamily() && !m_sCategoryVal.isEmpty() && xStyle->isUserDefined() && xPropSetInfo->hasPropertyByName("Category") && SvXMLUnitConverter::convertEnum( nCategory, m_sCategoryVal, aCategoryMap)) @@ -238,9 +238,9 @@ void XMLTextStyleContext::CreateAndInsert( bool bOverwrite ) void XMLTextStyleContext::SetDefaults( ) { - if( ( GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) || - ( GetFamily() == XML_STYLE_FAMILY_TABLE_TABLE ) || - ( GetFamily() == XML_STYLE_FAMILY_TABLE_ROW ) ) + if( ( GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ) || + ( GetFamily() == XmlStyleFamily::TABLE_TABLE ) || + ( GetFamily() == XmlStyleFamily::TABLE_ROW ) ) { Reference < XMultiServiceFactory > xFactory ( GetImport().GetModel(), UNO_QUERY); if (xFactory.is()) @@ -321,7 +321,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite ) { // change list style name to display name OUString sDisplayListStyleName( - GetImport().GetStyleDisplayName(XML_STYLE_FAMILY_TEXT_LIST, + GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_LIST, m_sListStyleName)); // The families container must exist const Reference < XNameContainer >& rNumStyles = @@ -341,7 +341,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite ) { // change list style name to display name OUString sDisplayDropCapTextStyleName( - GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, + GetImport().GetStyleDisplayName( XmlStyleFamily::TEXT_TEXT, m_sDropCapTextStyleName)); // The families container must exist const Reference < XNameContainer >& rTextStyles = @@ -358,7 +358,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite ) { OUString sDisplayName( GetImport().GetStyleDisplayName( - XML_STYLE_FAMILY_MASTER_PAGE, m_sMasterPageName)); + XmlStyleFamily::MASTER_PAGE, m_sMasterPageName)); // The families container must exist const Reference < XNameContainer >& rPageStyles = GetImport().GetTextImport()->GetPageStyles(); @@ -415,12 +415,12 @@ void XMLTextStyleContext::FillPropertySet( }; // the style families associated with the same index modulo 4 - static const sal_uInt16 aFamilies[] = + static const XmlStyleFamily aFamilies[] = { - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_GRADIENT_ID, - XML_STYLE_FAMILY_SD_HATCH_ID, - XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_GRADIENT_ID, + XmlStyleFamily::SD_HATCH_ID, + XmlStyleFamily::SD_FILL_IMAGE_ID }; // get property set info @@ -429,13 +429,13 @@ void XMLTextStyleContext::FillPropertySet( bool bAutomatic = false; if(pSvXMLStylesContext->IsAutomaticStyle() && - (XML_STYLE_FAMILY_TEXT_TEXT == GetFamily() || XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily())) + (XmlStyleFamily::TEXT_TEXT == GetFamily() || XmlStyleFamily::TEXT_PARAGRAPH == GetFamily())) { bAutomatic = true; if( !GetAutoName().isEmpty() ) { - OUString sAutoProp = ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT ) ? + OUString sAutoProp = ( GetFamily() == XmlStyleFamily::TEXT_TEXT ) ? OUString( "CharAutoStyleName" ): OUString( "ParaAutoStyleName" ); @@ -488,7 +488,7 @@ void XMLTextStyleContext::FillPropertySet( // value; if we didn't find one, we'll set to false, the file // format default. // border-model: same - if(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_ROW == GetFamily()) + if(IsDefaultStyle() && XmlStyleFamily::TABLE_ROW == GetFamily()) { OUString sIsSplitAllowed("IsSplitAllowed"); SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "xmloff", "property missing?" ); @@ -497,7 +497,7 @@ void XMLTextStyleContext::FillPropertySet( (aContextIDs[1].nIndex == -1) ? makeAny( false ) : GetProperties()[aContextIDs[1].nIndex].maValue ); } - if(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_TABLE == GetFamily()) + if(IsDefaultStyle() && XmlStyleFamily::TABLE_TABLE == GetFamily()) { OUString sCollapsingBorders("CollapsingBorders"); SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "xmloff", "property missing?" ); |