summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-09 11:24:22 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 12:14:04 +0200
commit44c7366d5b58116c14d1dfd41ab6d2c8daec223a (patch)
tree3cc8ee622cfc5d58b6480b2975851330518f4306 /xmloff
parentfccf28b5795b18907337bbb22a85d23a52280add (diff)
avoid manual memory handling
Change-Id: I8b8d1126f20ee29fb3ac80e539da5e340226c304
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximpshap.cxx26
-rw-r--r--xmloff/source/draw/ximpshap.hxx3
2 files changed, 11 insertions, 18 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index ffd707726d2a..15facfc6a183 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2583,14 +2583,8 @@ SdXMLChartShapeContext::SdXMLChartShapeContext(
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
bool bTemporaryShape)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
- mpChartContext( nullptr )
-{
-}
-
-SdXMLChartShapeContext::~SdXMLChartShapeContext()
+: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
- delete mpChartContext;
}
void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
@@ -2626,7 +2620,7 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
uno::Reference< frame::XModel > xChartModel;
if( aAny >>= xChartModel )
{
- mpChartContext = GetImport().GetChartImport()->CreateChartContext( GetImport(), XML_NAMESPACE_SVG, GetXMLToken(XML_CHART), xChartModel, xAttrList );
+ mxChartContext.set( GetImport().GetChartImport()->CreateChartContext( GetImport(), XML_NAMESPACE_SVG, GetXMLToken(XML_CHART), xChartModel, xAttrList ) );
}
}
}
@@ -2650,30 +2644,30 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
SdXMLShapeContext::StartElement(xAttrList);
- if( mpChartContext )
- mpChartContext->StartElement( xAttrList );
+ if( mxChartContext.is() )
+ mxChartContext->StartElement( xAttrList );
}
}
void SdXMLChartShapeContext::EndElement()
{
- if( mpChartContext )
- mpChartContext->EndElement();
+ if( mxChartContext.is() )
+ mxChartContext->EndElement();
SdXMLShapeContext::EndElement();
}
void SdXMLChartShapeContext::Characters( const OUString& rChars )
{
- if( mpChartContext )
- mpChartContext->Characters( rChars );
+ if( mxChartContext.is() )
+ mxChartContext->Characters( rChars );
}
SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList )
{
- if( mpChartContext )
- return mpChartContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
+ if( mxChartContext.is() )
+ return mxChartContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
return nullptr;
}
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index dcf623324c4f..a6ce95d8fce0 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -404,7 +404,7 @@ public:
class SdXMLChartShapeContext : public SdXMLShapeContext
{
- SvXMLImportContext* mpChartContext;
+ SvXMLImportContextRef mxChartContext;
public:
@@ -413,7 +413,6 @@ public:
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
css::uno::Reference< css::drawing::XShapes >& rShapes,
bool bTemporaryShape);
- virtual ~SdXMLChartShapeContext();
virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
virtual void EndElement() override;