diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-21 12:12:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-22 11:01:53 +0200 |
commit | 442df6cf8345f8029d5a3b470bc4981a5aa2bf20 (patch) | |
tree | 9efa6f2b29f41d79f968d1e8ad2588c323305776 /xmloff/source/draw | |
parent | a411d7729ab2bed05c3c5d22a8cbcf5dde034b91 (diff) |
ofz: don't leak in face of exceptions
Change-Id: Ic15590a13bd3770ee5dd7db76b21c830a4fe73e2
Reviewed-on: https://gerrit.libreoffice.org/42587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff/source/draw')
32 files changed, 242 insertions, 246 deletions
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx index 8abc0ed7185b..d04fb00d2a3a 100644 --- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx +++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx @@ -55,9 +55,9 @@ XMLGraphicsDefaultStyle::~XMLGraphicsDefaultStyle() { } -SvXMLImportContext *XMLGraphicsDefaultStyle::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList > & xAttrList ) +SvXMLImportContextRef XMLGraphicsDefaultStyle::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix ) { @@ -72,14 +72,14 @@ SvXMLImportContext *XMLGraphicsDefaultStyle::CreateChildContext( sal_uInt16 nPre { rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() ); if( xImpPrMap.is() ) - pContext = new XMLShapePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, nFamily, GetProperties(), xImpPrMap ); + xContext = new XMLShapePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, nFamily, GetProperties(), xImpPrMap ); } } - if( !pContext ) - pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); + if (!xContext) + xContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } struct XMLPropertyByIndex { diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index 0fafed0fc439..490a5238e9b2 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -123,7 +123,7 @@ public: void EndElement() override; - SvXMLImportContext *CreateChildContext( + SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList ) override; @@ -204,7 +204,7 @@ void XMLImageMapObjectContext::EndElement() // else: not valid -> don't create and insert } -SvXMLImportContext* XMLImageMapObjectContext::CreateChildContext( +SvXMLImportContextRef XMLImageMapObjectContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) @@ -572,36 +572,36 @@ XMLImageMapContext::~XMLImageMapContext() { } -SvXMLImportContext *XMLImageMapContext::CreateChildContext( +SvXMLImportContextRef XMLImageMapContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if ( XML_NAMESPACE_DRAW == nPrefix ) { if ( IsXMLToken(rLocalName, XML_AREA_RECTANGLE) ) { - pContext = new XMLImageMapRectangleContext( + xContext = new XMLImageMapRectangleContext( GetImport(), nPrefix, rLocalName, xImageMap); } else if ( IsXMLToken(rLocalName, XML_AREA_POLYGON) ) { - pContext = new XMLImageMapPolygonContext( + xContext = new XMLImageMapPolygonContext( GetImport(), nPrefix, rLocalName, xImageMap); } else if ( IsXMLToken(rLocalName, XML_AREA_CIRCLE) ) { - pContext = new XMLImageMapCircleContext( + xContext = new XMLImageMapCircleContext( GetImport(), nPrefix, rLocalName, xImageMap); } } else - pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, + xContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } void XMLImageMapContext::EndElement() diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 909c0d69372d..81d91a03f5e1 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -484,7 +484,7 @@ private: bool mbTextual; bool mbDecimal02; OUString maText; - rtl::Reference< SvXMLImportContext > mxSlaveContext; + SvXMLImportContextRef mxSlaveContext; public: @@ -493,9 +493,9 @@ public: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, - SvXMLImportContext* pSlaveContext ); + const SvXMLImportContextRef& rSlaveContext ); - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; @@ -507,11 +507,11 @@ public: }; -SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, SvXMLImportContext* pSlaveContext ) +SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, const SvXMLImportContextRef& rSlaveContext ) : SvXMLImportContext(rImport, nPrfx, rLocalName), mpParent( pParent ), maNumberStyle( rLocalName ), - mxSlaveContext( pSlaveContext ) + mxSlaveContext( rSlaveContext ) { mbLong = false; mbTextual = false; @@ -544,7 +544,7 @@ SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXM } -SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLNumberFormatMemberImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) { @@ -705,7 +705,7 @@ void SdXMLNumberFormatImportContext::EndElement() } } -SvXMLImportContext * SdXMLNumberFormatImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLNumberFormatImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLNumberFormatMemberImportContext( GetImport(), nPrefix, rLocalName, xAttrList, this, SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) ); } diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx index 4ceca19a46ac..4d3807c5588b 100644 --- a/xmloff/source/draw/XMLReplacementImageContext.cxx +++ b/xmloff/source/draw/XMLReplacementImageContext.cxx @@ -97,7 +97,7 @@ void XMLReplacementImageContext::EndElement() m_xPropSet->setPropertyValue( m_sGraphicURL, makeAny( sHRef ) ); } -SvXMLImportContext *XMLReplacementImageContext::CreateChildContext( +SvXMLImportContextRef XMLReplacementImageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList > & xAttrList ) diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx b/xmloff/source/draw/XMLShapePropertySetContext.cxx index ef0453f802dc..072a5c9a9c89 100644 --- a/xmloff/source/draw/XMLShapePropertySetContext.cxx +++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx @@ -63,34 +63,34 @@ void XMLShapePropertySetContext::EndElement() SvXMLPropertySetContext::EndElement(); } -SvXMLImportContext *XMLShapePropertySetContext::CreateChildContext( +SvXMLImportContextRef XMLShapePropertySetContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList, ::std::vector< XMLPropertyState > &rProperties, const XMLPropertyState& rProp ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) ) { case CTF_NUMBERINGRULES: mnBulletIndex = rProp.mnIndex; - mxBulletStyle = pContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList ); + mxBulletStyle = xContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList ); break; case CTF_TABSTOP: - pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix, + xContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix, rLocalName, rProp, rProperties ); break; } - if( !pContext ) - pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName, + if (!xContext) + xContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName, xAttrList, rProperties, rProp ); - return pContext; + return xContext; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index 78ee86693777..80f31a57f9bc 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -86,12 +86,12 @@ void XMLShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& } } -SvXMLImportContext *XMLShapeStyleContext::CreateChildContext( +SvXMLImportContextRef XMLShapeStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix ) { @@ -107,7 +107,7 @@ SvXMLImportContext *XMLShapeStyleContext::CreateChildContext( rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() ); if( xImpPrMap.is() ) - pContext = new XMLShapePropertySetContext( GetImport(), nPrefix, + xContext = new XMLShapePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, nFamily, GetProperties(), @@ -115,11 +115,11 @@ SvXMLImportContext *XMLShapeStyleContext::CreateChildContext( } } - if( !pContext ) - pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, + if (!xContext) + xContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet > & rPropSet ) diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index dd5eb993b7e1..3bb5c93cc5a7 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -1233,7 +1233,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: } } -SvXMLImportContext * AnimationNodeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, +SvXMLImportContextRef AnimationNodeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { if( mxNode.is()) diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index fb520bb9e3b7..faa16a01b48e 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -387,7 +387,7 @@ public: virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) override; }; @@ -521,7 +521,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s } } -SvXMLImportContext * XMLAnimationsEffectContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContextRef XMLAnimationsEffectContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { return new XMLAnimationsSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this ); } @@ -625,7 +625,7 @@ XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPr { } -SvXMLImportContext * XMLAnimationsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, +SvXMLImportContextRef XMLAnimationsContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { return new XMLAnimationsEffectContext( GetImport(), nPrefix, rLocalName, xAttrList, mpImpl ); diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index 38c3460df817..6f0cfbd623b4 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -78,7 +78,7 @@ public: SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape ); - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) override; + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) override; virtual void EndElement() override; bool mbValid; @@ -246,7 +246,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons mbValid = !sEventName.isEmpty(); } -SvXMLImportContext * SdXMLEventContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLEventContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this ); } @@ -467,7 +467,7 @@ SdXMLEventsContext::~SdXMLEventsContext() { } -SvXMLImportContext * SdXMLEventsContext::CreateChildContext( sal_uInt16 nPrfx, const OUString& rLocalName, +SvXMLImportContextRef SdXMLEventsContext::CreateChildContext( sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLEventContext( GetImport(), nPrfx, rLocalName, xAttrList, mxShape ); diff --git a/xmloff/source/draw/eventimp.hxx b/xmloff/source/draw/eventimp.hxx index cf2e2b04c3ad..5f7937a529b3 100644 --- a/xmloff/source/draw/eventimp.hxx +++ b/xmloff/source/draw/eventimp.hxx @@ -39,7 +39,7 @@ public: const css::uno::Reference< css::drawing::XShape >& rxShape ); virtual ~SdXMLEventsContext() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx index 4b4d516096a2..a3b3a50bf757 100644 --- a/xmloff/source/draw/layerimp.cxx +++ b/xmloff/source/draw/layerimp.cxx @@ -52,7 +52,7 @@ class SdXMLLayerContext : public SvXMLImportContext public: SdXMLLayerContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XNameAccess >& xLayerManager ); - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) override; + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) override; virtual void EndElement() override; private: @@ -84,7 +84,7 @@ SdXMLLayerContext::SdXMLLayerContext( SvXMLImport& rImport, sal_uInt16 nPrefix, } -SvXMLImportContext * SdXMLLayerContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& ) +SvXMLImportContextRef SdXMLLayerContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& ) { if( (XML_NAMESPACE_SVG == nPrefix) && IsXMLToken(rLocalName, XML_TITLE) ) { @@ -150,7 +150,7 @@ SdXMLLayerSetContext::~SdXMLLayerSetContext() { } -SvXMLImportContext * SdXMLLayerSetContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, +SvXMLImportContextRef SdXMLLayerSetContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { return new SdXMLLayerContext( GetImport(), nPrefix, rLocalName, xAttrList, mxLayerManager ); diff --git a/xmloff/source/draw/layerimp.hxx b/xmloff/source/draw/layerimp.hxx index 882f5cb3dd55..031a4a1b44cc 100644 --- a/xmloff/source/draw/layerimp.hxx +++ b/xmloff/source/draw/layerimp.hxx @@ -38,7 +38,7 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLLayerSetContext() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index b99022d4f471..a62f92ea21f6 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -62,7 +62,7 @@ public: const OUString& rLName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ); - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) override; }; @@ -74,7 +74,7 @@ SdXMLBodyContext_Impl::SdXMLBodyContext_Impl( SdXMLImport& rImport, { } -SvXMLImportContext *SdXMLBodyContext_Impl::CreateChildContext( +SvXMLImportContextRef SdXMLBodyContext_Impl::CreateChildContext( sal_uInt16 /*nPrefix*/, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) @@ -96,7 +96,7 @@ public: const OUString& rLName, const uno::Reference<xml::sax::XAttributeList>& xAttrList); - virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, + virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) override; }; @@ -110,26 +110,26 @@ SdXMLDocContext_Impl::SdXMLDocContext_Impl( { } -SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( +SvXMLImportContextRef SdXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; const SvXMLTokenMap& rTokenMap = GetSdImport().GetDocElemTokenMap(); switch(rTokenMap.Get(nPrefix, rLocalName)) { case XML_TOK_DOC_FONTDECLS: { - pContext = GetSdImport().CreateFontDeclsContext( rLocalName, xAttrList ); + xContext = GetSdImport().CreateFontDeclsContext( rLocalName, xAttrList ); break; } case XML_TOK_DOC_SETTINGS: { if( GetImport().getImportFlags() & SvXMLImportFlags::SETTINGS ) { - pContext = new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList ); + xContext = new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList ); } break; } @@ -138,7 +138,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( if( GetImport().getImportFlags() & SvXMLImportFlags::STYLES ) { // office:styles inside office:document - pContext = GetSdImport().CreateStylesContext(rLocalName, xAttrList); + xContext = GetSdImport().CreateStylesContext(rLocalName, xAttrList); } break; } @@ -147,7 +147,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( if( GetImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES ) { // office:automatic-styles inside office:document - pContext = GetSdImport().CreateAutoStylesContext(rLocalName, xAttrList); + xContext = GetSdImport().CreateAutoStylesContext(rLocalName, xAttrList); } break; } @@ -156,7 +156,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( if( GetImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES ) { // office:master-styles inside office:document - pContext = GetSdImport().CreateMasterStylesContext(rLocalName, xAttrList); + xContext = GetSdImport().CreateMasterStylesContext(rLocalName, xAttrList); } break; } @@ -170,7 +170,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( if( GetImport().getImportFlags() & SvXMLImportFlags::SCRIPTS ) { // office:script inside office:document - pContext = GetSdImport().CreateScriptContext( rLocalName ); + xContext = GetSdImport().CreateScriptContext( rLocalName ); } break; } @@ -179,7 +179,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT ) { // office:body inside office:document - pContext = new SdXMLBodyContext_Impl(GetSdImport(),nPrefix, + xContext = new SdXMLBodyContext_Impl(GetSdImport(),nPrefix, rLocalName, xAttrList); } break; @@ -187,10 +187,10 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } // call parent when no own context was created - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } // context for flat file xml format @@ -203,7 +203,7 @@ public: const uno::Reference<xml::sax::XAttributeList>& i_xAttrList, const uno::Reference<document::XDocumentProperties>& i_xDocProps); - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList) override; }; @@ -219,7 +219,7 @@ SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport, { } -SvXMLImportContext *SdXMLFlatDocContext_Impl::CreateChildContext( +SvXMLImportContextRef SdXMLFlatDocContext_Impl::CreateChildContext( sal_uInt16 i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList) { diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index e7f9f61c5858..cc541900fcb9 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -628,19 +628,19 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateFrameChildContext( return pContext; } -SvXMLImportContext *XMLShapeImportHelper::CreateFrameChildContext( +SvXMLImportContextRef XMLShapeImportHelper::CreateFrameChildContext( SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext * pContext = nullptr; + SvXMLImportContextRef xContext; SdXMLFrameShapeContext *pFrameContext = dynamic_cast<SdXMLFrameShapeContext*>( pThisContext ); - if( pFrameContext ) - pContext = pFrameContext->CreateChildContext( nPrefix, rLocalName, xAttrList ); + if (pFrameContext) + xContext = pFrameContext->CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } /** this function is called whenever the implementation classes like to add this new diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index d6bcbeea619d..62ffb7098f5e 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -167,44 +167,44 @@ void SdXML3DSceneShapeContext::EndElement() } } -SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXML3DSceneShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; // #i68101# if( nPrefix == XML_NAMESPACE_SVG && (IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) { - pContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); } else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) ) { - pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); } // look for local light context first else if(nPrefix == XML_NAMESPACE_DR3D && IsXMLToken( rLocalName, XML_LIGHT ) ) { // dr3d:light inside dr3d:scene context - pContext = create3DLightContext( nPrefix, rLocalName, xAttrList ); + xContext = create3DLightContext( nPrefix, rLocalName, xAttrList ); } // call GroupChildContext function at common ShapeImport - if(!pContext) + if (!xContext) { - pContext = GetImport().GetShapeImport()->Create3DSceneChildContext( + xContext = GetImport().GetShapeImport()->Create3DSceneChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxChildren); - } + } // call parent when no own context was created - if(!pContext) + if (!xContext) { - pContext = SvXMLImportContext::CreateChildContext( + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList); } - return pContext; + return xContext; } SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImporter ) diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx index e99b3b5bdefa..63ab0bde3be4 100644 --- a/xmloff/source/draw/ximp3dscene.hxx +++ b/xmloff/source/draw/ximp3dscene.hxx @@ -48,7 +48,7 @@ public: virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList) override; virtual void EndElement() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index be23c0725876..6556ab45aa53 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -211,11 +211,11 @@ SdXMLDrawPageContext::~SdXMLDrawPageContext() { } -SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; const SvXMLTokenMap& rTokenMap = GetSdImport().GetDrawPageElemTokenMap(); // some special objects inside draw:page context @@ -236,7 +236,7 @@ SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix if(xNewShapes.is()) { // presentation:notes inside draw:page context - pContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes); + xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes); } } } @@ -251,7 +251,7 @@ SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix uno::Reference< animations::XAnimationNodeSupplier > xNodeSupplier(GetLocalShapesContext(), uno::UNO_QUERY); if(xNodeSupplier.is()) { - pContext = new xmloff::AnimationNodeContext( xNodeSupplier->getAnimationNode(), GetSdImport(), nPrefix, rLocalName, xAttrList ); + xContext = new xmloff::AnimationNodeContext( xNodeSupplier->getAnimationNode(), GetSdImport(), nPrefix, rLocalName, xAttrList ); mbHadSMILNodes = true; } } @@ -260,10 +260,10 @@ SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPrefix } // call parent when no own context was created - if(!pContext) - pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } void SdXMLDrawPageContext::EndElement() @@ -290,12 +290,12 @@ SdXMLBodyContext::~SdXMLBodyContext() { } -SvXMLImportContext *SdXMLBodyContext::CreateChildContext( +SvXMLImportContextRef SdXMLBodyContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; const SvXMLTokenMap& rTokenMap = GetSdImport().GetBodyElemTokenMap(); switch(rTokenMap.Get(nPrefix, rLocalName)) @@ -304,7 +304,7 @@ SvXMLImportContext *SdXMLBodyContext::CreateChildContext( case XML_TOK_BODY_FOOTER_DECL: case XML_TOK_BODY_DATE_TIME_DECL: { - pContext = new SdXMLHeaderFooterDeclContext( GetImport(), nPrefix, rLocalName, xAttrList ); + xContext = new SdXMLHeaderFooterDeclContext( GetImport(), nPrefix, rLocalName, xAttrList ); break; } case XML_TOK_BODY_PAGE: @@ -340,7 +340,7 @@ SvXMLImportContext *SdXMLBodyContext::CreateChildContext( if(xNewShapes.is()) { // draw:page inside office:body context - pContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, + xContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes); } } @@ -349,15 +349,15 @@ SvXMLImportContext *SdXMLBodyContext::CreateChildContext( } case XML_TOK_BODY_SETTINGS: { - pContext = new SdXMLShowsContext( GetSdImport(), nPrefix, rLocalName, xAttrList ); + xContext = new SdXMLShowsContext( GetSdImport(), nPrefix, rLocalName, xAttrList ); } } // call parent when no own context was created - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx index 3616480b2fbc..801fa0e2eca8 100644 --- a/xmloff/source/draw/ximpbody.hxx +++ b/xmloff/source/draw/ximpbody.hxx @@ -43,7 +43,7 @@ public: css::uno::Reference< css::drawing::XShapes > const & rShapes); virtual ~SdXMLDrawPageContext() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void EndElement() override; @@ -61,7 +61,7 @@ public: SdXMLBodyContext( SdXMLImport& rImport, const OUString& rLocalName ); virtual ~SdXMLBodyContext() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 0a9dc7be5b43..5f6ae87e1358 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1292,7 +1292,7 @@ void XMLEnhancedCustomShapeContext::EndElement() SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maHandles, EASGet( EAS_Handles ) ); } -SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix,const OUString& rLocalName, +SvXMLImportContextRef XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix,const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList> & xAttrList ) { EnhancedCustomShapeTokenEnum aTokenEnum = EASGet( rLocalName ); diff --git a/xmloff/source/draw/ximpcustomshape.hxx b/xmloff/source/draw/ximpcustomshape.hxx index 74318059d52a..218f6e5267bb 100644 --- a/xmloff/source/draw/ximpcustomshape.hxx +++ b/xmloff/source/draw/ximpcustomshape.hxx @@ -58,7 +58,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList ) override; }; diff --git a/xmloff/source/draw/ximpgrp.cxx b/xmloff/source/draw/ximpgrp.cxx index 555f446433b6..3e3284bdccbf 100644 --- a/xmloff/source/draw/ximpgrp.cxx +++ b/xmloff/source/draw/ximpgrp.cxx @@ -42,21 +42,21 @@ SdXMLGroupShapeContext::~SdXMLGroupShapeContext() { } -SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; // #i68101# if( nPrefix == XML_NAMESPACE_SVG && (IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) { - pContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); } else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) ) { - pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); } else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) ) { @@ -65,16 +65,16 @@ SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPref else { // call GroupChildContext function at common ShapeImport - pContext = GetImport().GetShapeImport()->CreateGroupChildContext( + xContext = GetImport().GetShapeImport()->CreateGroupChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxChildren); } // call parent when no own context was created - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext( + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } void SdXMLGroupShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>&) diff --git a/xmloff/source/draw/ximpgrp.hxx b/xmloff/source/draw/ximpgrp.hxx index 665b1639aeb9..7c585ebf2342 100644 --- a/xmloff/source/draw/ximpgrp.hxx +++ b/xmloff/source/draw/ximpgrp.hxx @@ -41,7 +41,7 @@ public: bool bTemporaryShape); virtual ~SdXMLGroupShapeContext() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList) override; diff --git a/xmloff/source/draw/ximplink.cxx b/xmloff/source/draw/ximplink.cxx index 3bbe4271d89d..728dd0d35728 100644 --- a/xmloff/source/draw/ximplink.cxx +++ b/xmloff/source/draw/ximplink.cxx @@ -48,7 +48,7 @@ SdXMLShapeLinkContext::~SdXMLShapeLinkContext() { } -SvXMLImportContext* SdXMLShapeLinkContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLShapeLinkContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { diff --git a/xmloff/source/draw/ximplink.hxx b/xmloff/source/draw/ximplink.hxx index dac00fdbec70..c930f9b0f7e7 100644 --- a/xmloff/source/draw/ximplink.hxx +++ b/xmloff/source/draw/ximplink.hxx @@ -44,7 +44,7 @@ public: css::uno::Reference< css::drawing::XShapes > const & rShapes); virtual ~SdXMLShapeLinkContext() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 35deee58ab56..cfa7bfdd3668 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -60,7 +60,7 @@ class DrawAnnotationContext : public SvXMLImportContext public: DrawAnnotationContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess ); - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void EndElement() override; private: @@ -130,23 +130,23 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, sal_uInt16 n } } -SvXMLImportContext * DrawAnnotationContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) +SvXMLImportContextRef DrawAnnotationContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList ) { - SvXMLImportContext * pContext = nullptr; + SvXMLImportContextRef xContext; if( mxAnnotation.is() ) { if( XML_NAMESPACE_DC == nPrefix ) { if( IsXMLToken( rLocalName, XML_CREATOR ) ) - pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maAuthorBuffer); + xContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maAuthorBuffer); else if( IsXMLToken( rLocalName, XML_DATE ) ) - pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer); + xContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer); } else if( (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) && IsXMLToken(rLocalName, XML_SENDER_INITIALS) ) { - pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maInitialsBuffer); + xContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maInitialsBuffer); } else { @@ -166,16 +166,16 @@ SvXMLImportContext * DrawAnnotationContext::CreateChildContext( sal_uInt16 nPref // if we have a text cursor, lets try to import some text if( mxCursor.is() ) { - pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList ); + xContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList ); } } } // call parent for content - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void DrawAnnotationContext::EndElement() @@ -242,38 +242,38 @@ void SdXMLGenericPageContext::StartElement( const Reference< css::xml::sax::XAtt GetImport().GetFormImport()->startPage( Reference< drawing::XDrawPage >::query( mxShapes ) ); } -SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLGenericPageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if( nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_ANIMATIONS ) ) { - pContext = new XMLAnimationsContext( GetImport(), nPrefix, rLocalName, xAttrList ); + xContext = new XMLAnimationsContext( GetImport(), nPrefix, rLocalName, xAttrList ); } else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_FORMS ) ) { if( GetImport().IsFormsSupported() ) - pContext = xmloff::OFormLayerXMLImport::createOfficeFormsContext( GetImport(), nPrefix, rLocalName ); + xContext = xmloff::OFormLayerXMLImport::createOfficeFormsContext( GetImport(), nPrefix, rLocalName ); } else if( ((nPrefix == XML_NAMESPACE_OFFICE) || (nPrefix == XML_NAMESPACE_OFFICE_EXT)) && IsXMLToken( rLocalName, XML_ANNOTATION ) ) { if( mxAnnotationAccess.is() ) - pContext = new DrawAnnotationContext( GetImport(), nPrefix, rLocalName, xAttrList, mxAnnotationAccess ); + xContext = new DrawAnnotationContext( GetImport(), nPrefix, rLocalName, xAttrList, mxAnnotationAccess ); } else { // call GroupChildContext function at common ShapeImport - pContext = GetImport().GetShapeImport()->CreateGroupChildContext( + xContext = GetImport().GetShapeImport()->CreateGroupChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShapes); } // call parent when no own context was created - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } void SdXMLGenericPageContext::EndElement() diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx index 938ad814c968..024d35284b62 100644 --- a/xmloff/source/draw/ximppage.hxx +++ b/xmloff/source/draw/ximppage.hxx @@ -67,7 +67,7 @@ public: virtual ~SdXMLGenericPageContext() override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void EndElement() override; diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 0cf5d26693fd..a267d57a56f6 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -166,21 +166,21 @@ SdXMLShapeContext::~SdXMLShapeContext() { } -SvXMLImportContext *SdXMLShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, +SvXMLImportContextRef SdXMLShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext * pContext = nullptr; + SvXMLImportContextRef xContext; // #i68101# if( p_nPrefix == XML_NAMESPACE_SVG && (IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) { - pContext = new SdXMLDescriptionContext( GetImport(), p_nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLDescriptionContext( GetImport(), p_nPrefix, rLocalName, xAttrList, mxShape ); } else if( p_nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) ) { - pContext = new SdXMLEventsContext( GetImport(), p_nPrefix, rLocalName, xAttrList, mxShape ); + xContext = new SdXMLEventsContext( GetImport(), p_nPrefix, rLocalName, xAttrList, mxShape ); } else if( p_nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) ) { @@ -233,17 +233,17 @@ SvXMLImportContext *SdXMLShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, // if we have a text cursor, lets try to import some text if( mxCursor.is() ) { - pContext = GetImport().GetTextImport()->CreateTextChildContext( + xContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), p_nPrefix, rLocalName, xAttrList, ( mbTextBox ? XMLTextType::TextBox : XMLTextType::Shape ) ); } } // call parent for content - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext( p_nPrefix, rLocalName, xAttrList ); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( p_nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttributeList>& xAttrList ) @@ -2462,11 +2462,11 @@ void SdXMLGraphicObjectShapeContext::EndElement() SdXMLShapeContext::EndElement(); } -SvXMLImportContext* SdXMLGraphicObjectShapeContext::CreateChildContext( +SvXMLImportContextRef SdXMLGraphicObjectShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if( (XML_NAMESPACE_OFFICE == nPrefix) && xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) ) @@ -2475,18 +2475,18 @@ SvXMLImportContext* SdXMLGraphicObjectShapeContext::CreateChildContext( { mxBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64(); if( mxBase64Stream.is() ) - pContext = new XMLBase64ImportContext( GetImport(), nPrefix, + xContext = new XMLBase64ImportContext( GetImport(), nPrefix, rLocalName, xAttrList, mxBase64Stream ); } } // delegate to parent class if no context could be created - if ( nullptr == pContext ) - pContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, + if (!xContext) + xContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } SdXMLGraphicObjectShapeContext::~SdXMLGraphicObjectShapeContext() @@ -2582,7 +2582,7 @@ void SdXMLChartShapeContext::Characters( const OUString& rChars ) mxChartContext->Characters( rChars ); } -SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, +SvXMLImportContextRef SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { if( mxChartContext.is() ) @@ -2758,27 +2758,27 @@ void SdXMLObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const OUStri SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue ); } -SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext( +SvXMLImportContextRef SdXMLObjectShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if((XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_BINARY_DATA)) { mxBase64Stream = GetImport().GetStreamForEmbeddedObjectURLFromBase64(); if( mxBase64Stream.is() ) - pContext = new XMLBase64ImportContext( GetImport(), nPrefix, + xContext = new XMLBase64ImportContext( GetImport(), nPrefix, rLocalName, xAttrList, mxBase64Stream ); } else if( ((XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_DOCUMENT)) || ((XML_NAMESPACE_MATH == nPrefix) && IsXMLToken(rLocalName, XML_MATH)) ) { - XMLEmbeddedObjectImportContext *pEContext = - new XMLEmbeddedObjectImportContext( GetImport(), nPrefix, - rLocalName, xAttrList ); - maCLSID = pEContext->GetFilterCLSID(); + rtl::Reference<XMLEmbeddedObjectImportContext> xEContext( + new XMLEmbeddedObjectImportContext(GetImport(), nPrefix, + rLocalName, xAttrList)); + maCLSID = xEContext->GetFilterCLSID(); if( !maCLSID.isEmpty() ) { uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); @@ -2789,20 +2789,19 @@ SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext( uno::Reference< lang::XComponent > xComp; xPropSet->getPropertyValue("Model") >>= xComp; SAL_WARN_IF( !xComp.is(), "xmloff", "no xModel for own OLE format" ); - pEContext->SetComponent( xComp ); + xEContext->SetComponent(xComp); } } - pContext = pEContext; + xContext = xEContext.get(); } // delegate to parent class if no context could be created - if(!pContext) - pContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } - SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, @@ -2910,7 +2909,7 @@ void SdXMLAppletShapeContext::EndElement() SdXMLShapeContext::EndElement(); } -SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLAppletShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { if( p_nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) ) { @@ -3180,7 +3179,7 @@ void SdXMLPluginShapeContext::EndElement() SdXMLShapeContext::EndElement(); } -SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLPluginShapeContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) { if( p_nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) ) { @@ -3400,18 +3399,18 @@ OUString SdXMLFrameShapeContext::getGraphicURLFromImportContext(const SvXMLImpor return aRetval; } -SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPrefix, +SvXMLImportContextRef SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext * pContext = nullptr; + SvXMLImportContextRef xContext; if( !mxImplContext.is() ) { SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList ); - pContext = pShapeContext; + xContext = pShapeContext; // propagate the hyperlink to child context if ( !msHyperlink.isEmpty() ) @@ -3430,11 +3429,11 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref } #endif - mxImplContext = pContext; + mxImplContext = xContext; mbSupportsReplacement = IsXMLToken(rLocalName, XML_OBJECT ) || IsXMLToken(rLocalName, XML_OBJECT_OLE); setSupportsMultipleContents(IsXMLToken(rLocalName, XML_IMAGE)); - if(getSupportsMultipleContents() && dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext)) + if(getSupportsMultipleContents() && dynamic_cast< SdXMLGraphicObjectShapeContext* >(xContext.get())) { addContent(*mxImplContext.get()); } @@ -3442,11 +3441,11 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref else if(getSupportsMultipleContents() && XML_NAMESPACE_DRAW == nPrefix && IsXMLToken(rLocalName, XML_IMAGE)) { // read another image - pContext = GetImport().GetShapeImport()->CreateFrameChildContext( + xContext = GetImport().GetShapeImport()->CreateFrameChildContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList); - mxImplContext = pContext; + mxImplContext = xContext; - if(dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext)) + if(dynamic_cast< SdXMLGraphicObjectShapeContext* >(xContext.get())) { addContent(*mxImplContext.get()); } @@ -3465,9 +3464,9 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref pSContext->getShape(), uno::UNO_QUERY ); if( xPropSet.is() ) { - pContext = new XMLReplacementImageContext( GetImport(), + xContext = new XMLReplacementImageContext( GetImport(), nPrefix, rLocalName, xAttrList, xPropSet ); - mxReplImplContext = pContext; + mxReplImplContext = xContext; } } } @@ -3484,7 +3483,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref mxImplContext = solveMultipleImages(); } SvXMLImportContext *pImplContext = mxImplContext.get(); - pContext = dynamic_cast<SdXMLShapeContext&>(*pImplContext).CreateChildContext( nPrefix, + xContext = dynamic_cast<SdXMLShapeContext&>(*pImplContext).CreateChildContext( nPrefix, rLocalName, xAttrList ); } else if ( (XML_NAMESPACE_DRAW == nPrefix) && IsXMLToken( rLocalName, XML_IMAGE_MAP ) ) @@ -3500,15 +3499,15 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref uno::Reference < beans::XPropertySet > xPropSet( pSContext->getShape(), uno::UNO_QUERY ); if (xPropSet.is()) { - pContext = new XMLImageMapContext(GetImport(), nPrefix, rLocalName, xPropSet); + xContext = new XMLImageMapContext(GetImport(), nPrefix, rLocalName, xPropSet); } } } // call parent for content - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void SdXMLFrameShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>&) @@ -3823,28 +3822,27 @@ void SdXMLCustomShapeContext::EndElement() } } -SvXMLImportContext* SdXMLCustomShapeContext::CreateChildContext( +SvXMLImportContextRef SdXMLCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if ( XML_NAMESPACE_DRAW == nPrefix ) { if ( IsXMLToken( rLocalName, XML_ENHANCED_GEOMETRY ) ) { uno::Reference< beans::XPropertySet > xPropSet( mxShape,uno::UNO_QUERY ); if ( xPropSet.is() ) - pContext = new XMLEnhancedCustomShapeContext( GetImport(), mxShape, nPrefix, rLocalName, maCustomShapeGeometry ); + xContext = new XMLEnhancedCustomShapeContext( GetImport(), mxShape, nPrefix, rLocalName, maCustomShapeGeometry ); } } // delegate to parent class if no context could be created - if ( nullptr == pContext ) - pContext = SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, + if (!xContext) + xContext = SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } - SdXMLTableShapeContext::SdXMLTableShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, css::uno::Reference< css::drawing::XShapes > const & rShapes ) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, false ) { @@ -3985,7 +3983,7 @@ void SdXMLTableShapeContext::processAttribute( sal_uInt16 nPrefix, const OUStrin SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue ); } -SvXMLImportContext* SdXMLTableShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLTableShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList ) { if( mxTableImportContext.is() && (nPrefix == XML_NAMESPACE_TABLE) ) return mxTableImportContext->CreateChildContext(nPrefix, rLocalName, xAttrList); diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 71dfad28d06c..f1dbfde62ce6 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -117,7 +117,7 @@ public: virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -396,7 +396,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -420,7 +420,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; virtual void Characters( const OUString& rChars ) override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; @@ -445,7 +445,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -475,7 +475,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -504,7 +504,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -561,7 +561,7 @@ public: bool bTemporaryShape); virtual ~SdXMLFrameShapeContext() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; @@ -591,7 +591,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list @@ -613,7 +613,7 @@ public: virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; // this is called from the parent group for each unparsed attribute in the attribute list virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) override; diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx index caed5664e6ef..d9e2a4e95651 100644 --- a/xmloff/source/draw/ximpshow.cxx +++ b/xmloff/source/draw/ximpshow.cxx @@ -184,7 +184,7 @@ SdXMLShowsContext::~SdXMLShowsContext() } } -SvXMLImportContext * SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) +SvXMLImportContextRef SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList ) { if( mpImpl && p_nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SHOW ) ) { diff --git a/xmloff/source/draw/ximpshow.hxx b/xmloff/source/draw/ximpshow.hxx index af59f8eec008..3764b5922879 100644 --- a/xmloff/source/draw/ximpshow.hxx +++ b/xmloff/source/draw/ximpshow.hxx @@ -40,7 +40,7 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList); virtual ~SdXMLShowsContext() override; - virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override; }; diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 8a5751f7d526..5ceaffdadd07 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -65,7 +65,7 @@ public: const rtl::Reference < SvXMLImportPropertyMapper > &rMap ); using SvXMLPropertySetContext::CreateChildContext; - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, ::std::vector< XMLPropertyState > &rProperties, @@ -84,14 +84,14 @@ SdXMLDrawingPagePropertySetContext::SdXMLDrawingPagePropertySetContext( { } -SvXMLImportContext *SdXMLDrawingPagePropertySetContext::CreateChildContext( +SvXMLImportContextRef SdXMLDrawingPagePropertySetContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList, ::std::vector< XMLPropertyState > &rProperties, const XMLPropertyState& rProp ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) ) { @@ -114,12 +114,12 @@ SvXMLImportContext *SdXMLDrawingPagePropertySetContext::CreateChildContext( } } - if( !pContext ) - pContext = SvXMLPropertySetContext::CreateChildContext( p_nPrefix, rLocalName, + if (!xContext) + xContext = SvXMLPropertySetContext::CreateChildContext( p_nPrefix, rLocalName, xAttrList, rProperties, rProp ); - return pContext; + return xContext; } class SdXMLDrawingPageStyleContext : public XMLPropStyleContext @@ -134,7 +134,7 @@ public: SvXMLStylesContext& rStyles, sal_uInt16 nFamily = XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID); - SvXMLImportContext * CreateChildContext( + SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -157,12 +157,12 @@ SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext( { } -SvXMLImportContext *SdXMLDrawingPageStyleContext::CreateChildContext( +SvXMLImportContextRef SdXMLDrawingPageStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_DRAWING_PAGE_PROPERTIES ) ) @@ -170,17 +170,17 @@ SvXMLImportContext *SdXMLDrawingPageStyleContext::CreateChildContext( rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() ); if( xImpPrMap.is() ) - pContext = new SdXMLDrawingPagePropertySetContext( GetImport(), nPrefix, + xContext = new SdXMLDrawingPagePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, GetProperties(), xImpPrMap ); } - if( !pContext ) - pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, + if (!xContext) + xContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void SdXMLDrawingPageStyleContext::Finish( bool bOverwrite ) @@ -395,28 +395,27 @@ SdXMLPageMasterContext::SdXMLPageMasterContext( } } -SvXMLImportContext *SdXMLPageMasterContext::CreateChildContext( +SvXMLImportContextRef SdXMLPageMasterContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if(nPrefix == XML_NAMESPACE_STYLE && IsXMLToken( rLocalName, XML_PAGE_LAYOUT_PROPERTIES) ) { DBG_ASSERT(!mxPageMasterStyle.is(), "PageMasterStyle is set, there seem to be two of them (!)"); mxPageMasterStyle.set(new SdXMLPageMasterStyleContext(GetSdImport(), nPrefix, rLocalName, xAttrList)); - pContext = mxPageMasterStyle.get(); + xContext = mxPageMasterStyle.get(); } // call base class - if(!pContext) - pContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } - SdXMLPresentationPageLayoutContext::SdXMLPresentationPageLayoutContext( SdXMLImport& rImport, sal_uInt16 nPrfx, @@ -442,29 +441,29 @@ SdXMLPresentationPageLayoutContext::SdXMLPresentationPageLayoutContext( } } -SvXMLImportContext *SdXMLPresentationPageLayoutContext::CreateChildContext( +SvXMLImportContextRef SdXMLPresentationPageLayoutContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if(nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_PLACEHOLDER ) ) { - const rtl::Reference< SdXMLPresentationPlaceholderContext > xContext{ + const rtl::Reference< SdXMLPresentationPlaceholderContext > xLclContext{ new SdXMLPresentationPlaceholderContext(GetSdImport(), nPrefix, rLocalName, xAttrList)}; // presentation:placeholder inside style:presentation-page-layout context - pContext = xContext.get(); + xContext = xLclContext.get(); // remember SdXMLPresentationPlaceholderContext for later evaluation - maList.push_back( xContext ); + maList.push_back(xLclContext); } // call base class - if(!pContext) - pContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } void SdXMLPresentationPageLayoutContext::EndElement() @@ -843,12 +842,12 @@ void SdXMLMasterPageContext::EndElement() GetImport().GetShapeImport()->endPage(GetLocalShapesContext()); } -SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext( +SvXMLImportContextRef SdXMLMasterPageContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; const SvXMLTokenMap& rTokenMap = GetSdImport().GetMasterPageElemTokenMap(); // some special objects inside style:masterpage context @@ -865,7 +864,7 @@ SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext( XML_STYLE_FAMILY_SD_PRESENTATION_ID); // add this style to the outer StylesContext class for later processing - pContext = pNew; + xContext = pNew; GetSdImport().GetShapeImport()->GetStylesContext()->AddStyle(*pNew); } break; @@ -885,7 +884,7 @@ SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext( if(xNewShapes.is()) { // presentation:notes inside master-page context - pContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes); + xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes); } } } @@ -894,13 +893,12 @@ SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext( } // call base class - if(!pContext) - pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } - SdXMLStylesContext::SdXMLStylesContext( SdXMLImport& rImport, const OUString& rLName, @@ -1414,12 +1412,12 @@ SdXMLMasterStylesContext::SdXMLMasterStylesContext( { } -SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( +SvXMLImportContextRef SdXMLMasterStylesContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList >& xAttrList) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if(nPrefix == XML_NAMESPACE_STYLE && IsXMLToken( rLocalName, XML_MASTER_PAGE ) ) @@ -1449,11 +1447,11 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( uno::Reference< drawing::XShapes > xNewShapes(xNewMasterPage, uno::UNO_QUERY); if(xNewShapes.is() && GetSdImport().GetShapeImport()->GetStylesContext()) { - const rtl::Reference<SdXMLMasterPageContext> xContext{ + const rtl::Reference<SdXMLMasterPageContext> xLclContext{ new SdXMLMasterPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes)}; - pContext = xContext.get(); - maMasterPageList.push_back(xContext); + xContext = xLclContext.get(); + maMasterPageList.push_back(xLclContext); } } } @@ -1467,21 +1465,21 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( uno::Reference< drawing::XShapes > xHandoutPage( xHandoutSupp->getHandoutMasterPage(), uno::UNO_QUERY ); if(xHandoutPage.is() && GetSdImport().GetShapeImport()->GetStylesContext()) { - pContext = new SdXMLMasterPageContext(GetSdImport(), + xContext = new SdXMLMasterPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList, xHandoutPage); } } } else if( (nPrefix == XML_NAMESPACE_DRAW )&& IsXMLToken( rLocalName, XML_LAYER_SET ) ) { - pContext = new SdXMLLayerSetContext( GetImport(), nPrefix, rLocalName, xAttrList ); + xContext = new SdXMLLayerSetContext( GetImport(), nPrefix, rLocalName, xAttrList ); } // call base class - if(!pContext) - pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList); - return pContext; + return xContext; } SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext(SvXMLImport& rImport, diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index c33bcf092264..d70fc8cfca88 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -82,7 +82,7 @@ public: const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; @@ -108,7 +108,7 @@ public: css::uno::Reference< css::drawing::XShapes > const & rShapes); virtual ~SdXMLMasterPageContext() override; - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; @@ -163,7 +163,7 @@ public: const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); - virtual SvXMLImportContext *CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; @@ -236,7 +236,7 @@ public: SdXMLImport& rImport, const OUString& rLName); - virtual SvXMLImportContext* CreateChildContext( + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; |