diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-03 11:15:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-03 14:10:00 +0200 |
commit | b83beb8481b645b4db04112d63837a372cba6e57 (patch) | |
tree | 3f9172931fa9184dde377dd64d48298090d6fea2 /xmloff/source/style | |
parent | 528dc27c3d97846bd0d73ef30e1c9c66daba425a (diff) |
use more explicit types in xmloff
instead of declaring them as a base-type, and then static-casting
everwhere
Change-Id: I53b901c5353bb39ca9a0357aa442f50d2f475e7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99995
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r-- | xmloff/source/style/XMLFontStylesContext_impl.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 14 |
2 files changed, 7 insertions, 11 deletions
diff --git a/xmloff/source/style/XMLFontStylesContext_impl.hxx b/xmloff/source/style/XMLFontStylesContext_impl.hxx index 2d7880389391..854523e9a15b 100644 --- a/xmloff/source/style/XMLFontStylesContext_impl.hxx +++ b/xmloff/source/style/XMLFontStylesContext_impl.hxx @@ -35,11 +35,11 @@ class XMLFontStyleContextFontFace : public SvXMLStyleContext css::uno::Any aPitch; css::uno::Any aEnc; - SvXMLImportContextRef xStyles; + rtl::Reference<XMLFontStylesContext> xStyles; XMLFontStylesContext *GetStyles() { - return static_cast<XMLFontStylesContext *>(xStyles.get()); + return xStyles.get(); } public: diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 4712bf4e5bb7..708ae6675e57 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -211,8 +211,7 @@ SvXMLImportContextRef XMLPropStyleContext::CreateChildContext( if( nFamily ) { rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = - static_cast<SvXMLStylesContext *>(mxStyles.get())->GetImportPropertyMapper( - GetFamily() ); + mxStyles->GetImportPropertyMapper( GetFamily() ); if( xImpPrMap.is() ) xContext = new SvXMLPropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, @@ -232,8 +231,7 @@ void XMLPropStyleContext::FillPropertySet( const Reference< XPropertySet > & rPropSet ) { rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = - static_cast<SvXMLStylesContext *>(mxStyles.get())->GetImportPropertyMapper( - GetFamily() ); + mxStyles->GetImportPropertyMapper( GetFamily() ); SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" ); if( xImpPrMap.is() ) xImpPrMap->FillPropertySet( maProperties, rPropSet ); @@ -247,8 +245,7 @@ Reference < XStyle > XMLPropStyleContext::Create() { Reference < XStyle > xNewStyle; - OUString sServiceName( - static_cast<SvXMLStylesContext *>(mxStyles.get())->GetServiceName( GetFamily() ) ); + OUString sServiceName = mxStyles->GetServiceName( GetFamily() ); if( !sServiceName.isEmpty() ) { Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(), @@ -267,7 +264,7 @@ Reference < XStyle > XMLPropStyleContext::Create() void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) { - SvXMLStylesContext* pSvXMLStylesContext = static_cast< SvXMLStylesContext* >(mxStyles.get()); + SvXMLStylesContext* pSvXMLStylesContext = mxStyles.get(); rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = pSvXMLStylesContext->GetImportPropertyMapper(GetFamily()); OSL_ENSURE(xImpPrMap.is(), "There is no import prop mapper"); @@ -460,8 +457,7 @@ void XMLPropStyleContext::Finish( bool bOverwrite ) return; // The families container must exist - Reference < XNameContainer > xFamilies = - static_cast<SvXMLStylesContext *>(mxStyles.get())->GetStylesContainer( GetFamily() ); + Reference < XNameContainer > xFamilies = mxStyles->GetStylesContainer( GetFamily() ); SAL_WARN_IF( !xFamilies.is(), "xmloff", "Families lost" ); if( !xFamilies.is() ) return; |