dbaccess/source/filter/xml/xmlAutoStyle.cxx | 4 dbaccess/source/filter/xml/xmlAutoStyle.hxx | 2 dbaccess/source/filter/xml/xmlColumn.cxx | 6 dbaccess/source/filter/xml/xmlExport.cxx | 30 +- dbaccess/source/filter/xml/xmlStyleImport.cxx | 42 +-- dbaccess/source/filter/xml/xmlStyleImport.hxx | 8 dbaccess/source/filter/xml/xmlTable.cxx | 2 include/xmloff/SchXMLImportHelper.hxx | 2 include/xmloff/XMLShapeStyleContext.hxx | 2 include/xmloff/XMLTextMasterStylesContext.hxx | 4 include/xmloff/XMLTextShapeStyleContext.hxx | 2 include/xmloff/families.hxx | 107 ++++---- include/xmloff/prstylei.hxx | 2 include/xmloff/shapeexport.hxx | 4 include/xmloff/styleexp.hxx | 5 include/xmloff/txtparae.hxx | 6 include/xmloff/txtstyli.hxx | 2 include/xmloff/xmlaustp.hxx | 27 +- include/xmloff/xmlimp.hxx | 4 include/xmloff/xmlstyle.hxx | 29 +- reportdesign/source/filter/xml/xmlAutoStyle.cxx | 4 reportdesign/source/filter/xml/xmlAutoStyle.hxx | 2 reportdesign/source/filter/xml/xmlCell.cxx | 2 reportdesign/source/filter/xml/xmlColumn.cxx | 4 reportdesign/source/filter/xml/xmlExport.cxx | 32 +- reportdesign/source/filter/xml/xmlExport.hxx | 4 reportdesign/source/filter/xml/xmlHelper.cxx | 2 reportdesign/source/filter/xml/xmlRow.cxx | 4 reportdesign/source/filter/xml/xmlStyleImport.cxx | 64 ++-- reportdesign/source/filter/xml/xmlStyleImport.hxx | 12 reportdesign/source/filter/xml/xmlTable.cxx | 2 reportdesign/source/filter/xml/xmlfilter.cxx | 2 sc/inc/sheetdata.hxx | 3 sc/source/filter/xml/sheetdata.cxx | 4 sc/source/filter/xml/xmlannoi.cxx | 2 sc/source/filter/xml/xmlannoi.hxx | 11 sc/source/filter/xml/xmlcelli.cxx | 2 sc/source/filter/xml/xmlcoli.cxx | 2 sc/source/filter/xml/xmlexprt.cxx | 78 ++--- sc/source/filter/xml/xmlexternaltabi.cxx | 2 sc/source/filter/xml/xmlimprt.cxx | 4 sc/source/filter/xml/xmlrowi.cxx | 2 sc/source/filter/xml/xmlstyle.cxx | 10 sc/source/filter/xml/xmlstyle.hxx | 4 sc/source/filter/xml/xmlstyli.cxx | 96 +++---- sc/source/filter/xml/xmlstyli.hxx | 18 - sc/source/filter/xml/xmlsubti.cxx | 2 sw/source/filter/xml/xmlfmt.cxx | 114 ++++---- sw/source/filter/xml/xmlfmte.cxx | 6 sw/source/filter/xml/xmlimp.cxx | 6 sw/source/filter/xml/xmlimp.hxx | 4 sw/source/filter/xml/xmlitemi.cxx | 11 sw/source/filter/xml/xmltbli.cxx | 8 sw/source/filter/xml/xmltexte.cxx | 4 sw/source/uibase/config/StoredChapterNumbering.cxx | 6 xmloff/inc/PageMasterStyleMap.hxx | 2 xmloff/inc/SchXMLAutoStylePoolP.hxx | 2 xmloff/inc/StyleMap.hxx | 10 xmloff/inc/XMLChartStyleContext.hxx | 2 xmloff/qa/unit/uxmloff.cxx | 6 xmloff/source/chart/SchXMLAutoStylePoolP.cxx | 4 xmloff/source/chart/SchXMLExport.cxx | 12 xmloff/source/chart/XMLChartStyleContext.cxx | 4 xmloff/source/core/xmlimp.cxx | 6 xmloff/source/draw/XMLGraphicsDefaultStyle.cxx | 2 xmloff/source/draw/XMLShapeStyleContext.cxx | 18 - xmloff/source/draw/sdxmlexp.cxx | 14 - xmloff/source/draw/shapeexport.cxx | 20 - xmloff/source/draw/ximpbody.cxx | 2 xmloff/source/draw/ximppage.cxx | 8 xmloff/source/draw/ximpshap.cxx | 14 - xmloff/source/draw/ximpshap.hxx | 2 xmloff/source/draw/ximpstyl.cxx | 74 ++--- xmloff/source/draw/ximpstyl.hxx | 8 xmloff/source/forms/layerexport.cxx | 6 xmloff/source/forms/layerimport.cxx | 4 xmloff/source/style/DashStyle.cxx | 2 xmloff/source/style/GradientStyle.cxx | 2 xmloff/source/style/HatchStyle.cxx | 2 xmloff/source/style/ImageStyle.cxx | 2 xmloff/source/style/MarkerStyle.cxx | 2 xmloff/source/style/PageMasterImportContext.cxx | 12 xmloff/source/style/PageMasterImportPropMapper.cxx | 2 xmloff/source/style/PageMasterStyleMap.cxx | 2 xmloff/source/style/TransGradientStyle.cxx | 2 xmloff/source/style/XMLFontStylesContext.cxx | 2 xmloff/source/style/XMLPageExport.cxx | 8 xmloff/source/style/impastpl.cxx | 24 - xmloff/source/style/impastpl.hxx | 23 - xmloff/source/style/prstylei.cxx | 22 - xmloff/source/style/styleexp.cxx | 4 xmloff/source/style/xmlaustp.cxx | 36 +- xmloff/source/style/xmlnumfi.cxx | 4 xmloff/source/style/xmlnumi.cxx | 8 xmloff/source/style/xmlstyle.cxx | 132 +++++----- xmloff/source/table/XMLTableExport.cxx | 20 - xmloff/source/table/XMLTableImport.cxx | 8 xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx | 12 xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx | 4 xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 2 xmloff/source/text/XMLIndexSimpleEntryContext.cxx | 4 xmloff/source/text/XMLIndexTOCStylesContext.cxx | 2 xmloff/source/text/XMLIndexTemplateContext.cxx | 2 xmloff/source/text/XMLIndexTitleTemplateContext.cxx | 4 xmloff/source/text/XMLLineNumberingImportContext.cxx | 6 xmloff/source/text/XMLSectionExport.cxx | 4 xmloff/source/text/XMLTextFrameContext.cxx | 2 xmloff/source/text/XMLTextListItemContext.cxx | 2 xmloff/source/text/XMLTextMasterPageContext.cxx | 6 xmloff/source/text/XMLTextMasterStylesContext.cxx | 6 xmloff/source/text/XMLTextShapeStyleContext.cxx | 2 xmloff/source/text/txtflde.cxx | 4 xmloff/source/text/txtftne.cxx | 2 xmloff/source/text/txtimp.cxx | 32 +- xmloff/source/text/txtlists.cxx | 2 xmloff/source/text/txtparae.cxx | 97 +++---- xmloff/source/text/txtstyle.cxx | 6 xmloff/source/text/txtstyli.cxx | 34 +- 118 files changed, 817 insertions(+), 780 deletions(-)
New commits: commit aa58c380894dd384f6ce1efc62b3932136f2f477 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Feb 14 16:53:39 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Feb 15 07:02:36 2020 +0100 convert XML_STYLE_FAMILY to scoped enum Change-Id: I5335b0190a2f5a8111993c0c9c224c8a6a8f0cfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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() ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits