diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-14 16:53:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-15 07:02:36 +0100 |
commit | aa58c380894dd384f6ce1efc62b3932136f2f477 (patch) | |
tree | ca6af6905afd398da0541c71733393540ab8be2e /xmloff/source | |
parent | 0cb4f304abf6f8dd6b40eb800788d2fe80581813 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
58 files changed, 384 insertions, 368 deletions
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?" ); |