Kaydet (Commit) 44c7366d authored tarafından David Tardon's avatar David Tardon

avoid manual memory handling

Change-Id: I8b8d1126f20ee29fb3ac80e539da5e340226c304
üst fccf28b5
...@@ -2583,14 +2583,8 @@ SdXMLChartShapeContext::SdXMLChartShapeContext( ...@@ -2583,14 +2583,8 @@ SdXMLChartShapeContext::SdXMLChartShapeContext(
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes, uno::Reference< drawing::XShapes >& rShapes,
bool bTemporaryShape) bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
mpChartContext( nullptr )
{
}
SdXMLChartShapeContext::~SdXMLChartShapeContext()
{ {
delete mpChartContext;
} }
void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
...@@ -2626,7 +2620,7 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri ...@@ -2626,7 +2620,7 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
uno::Reference< frame::XModel > xChartModel; uno::Reference< frame::XModel > xChartModel;
if( aAny >>= 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 ...@@ -2650,30 +2644,30 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
SdXMLShapeContext::StartElement(xAttrList); SdXMLShapeContext::StartElement(xAttrList);
if( mpChartContext ) if( mxChartContext.is() )
mpChartContext->StartElement( xAttrList ); mxChartContext->StartElement( xAttrList );
} }
} }
void SdXMLChartShapeContext::EndElement() void SdXMLChartShapeContext::EndElement()
{ {
if( mpChartContext ) if( mxChartContext.is() )
mpChartContext->EndElement(); mxChartContext->EndElement();
SdXMLShapeContext::EndElement(); SdXMLShapeContext::EndElement();
} }
void SdXMLChartShapeContext::Characters( const OUString& rChars ) void SdXMLChartShapeContext::Characters( const OUString& rChars )
{ {
if( mpChartContext ) if( mxChartContext.is() )
mpChartContext->Characters( rChars ); mxChartContext->Characters( rChars );
} }
SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList )
{ {
if( mpChartContext ) if( mxChartContext.is() )
return mpChartContext->CreateChildContext( nPrefix, rLocalName, xAttrList ); return mxChartContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
return nullptr; return nullptr;
} }
......
...@@ -404,7 +404,7 @@ public: ...@@ -404,7 +404,7 @@ public:
class SdXMLChartShapeContext : public SdXMLShapeContext class SdXMLChartShapeContext : public SdXMLShapeContext
{ {
SvXMLImportContext* mpChartContext; SvXMLImportContextRef mxChartContext;
public: public:
...@@ -413,7 +413,6 @@ public: ...@@ -413,7 +413,6 @@ public:
const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
css::uno::Reference< css::drawing::XShapes >& rShapes, css::uno::Reference< css::drawing::XShapes >& rShapes,
bool bTemporaryShape); bool bTemporaryShape);
virtual ~SdXMLChartShapeContext();
virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
virtual void EndElement() override; virtual void EndElement() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment