summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 10:53:24 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commit5b010b43d7cadc11ebc6756a9b7689c660f3d387 (patch)
treef02c6cd16badd0946546e549bec2af202cfb7cb2 /xmloff
parent6c285099289b2d73c9e7da503341e22728be1787 (diff)
remove direct memory management
Change-Id: I15823666ce8ea1840dc7b927d1a6f2f810edf2d2
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx16
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx2
2 files changed, 4 insertions, 14 deletions
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index a6c9f368a389..da92ee22c5aa 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -283,7 +283,6 @@ SdXMLImport::SdXMLImport(
OUString const & implementationName,
bool bIsDraw, SvXMLImportFlags nImportFlags )
: SvXMLImport( xContext, implementationName, nImportFlags ),
- mpMasterStylesContext(nullptr),
mpDocElemTokenMap(nullptr),
mpBodyElemTokenMap(nullptr),
mpStylesElemTokenMap(nullptr),
@@ -410,10 +409,6 @@ void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen
SdXMLImport::~SdXMLImport() throw ()
{
- // Styles or AutoStyles context?
- if(mpMasterStylesContext)
- mpMasterStylesContext->ReleaseRef();
-
// delete all token maps
delete mpDocElemTokenMap;
delete mpBodyElemTokenMap;
@@ -719,14 +714,9 @@ SvXMLStylesContext *SdXMLImport::CreateAutoStylesContext(const OUString& rLocalN
SvXMLImportContext* SdXMLImport::CreateMasterStylesContext(const OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>&)
{
- if(mpMasterStylesContext)
- return mpMasterStylesContext;
-
- mpMasterStylesContext = new SdXMLMasterStylesContext(
- *this, rLocalName);
- mpMasterStylesContext->AddFirstRef();
-
- return mpMasterStylesContext;
+ if (!mxMasterStylesContext.is())
+ mxMasterStylesContext.set(new SdXMLMasterStylesContext(*this, rLocalName));
+ return mxMasterStylesContext.get();
}
SvXMLImportContext *SdXMLImport::CreateFontDeclsContext(const OUString& rLocalName,
diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx
index 7250eb6ec250..27e381348d9d 100644
--- a/xmloff/source/draw/sdxmlimp_impl.hxx
+++ b/xmloff/source/draw/sdxmlimp_impl.hxx
@@ -167,7 +167,7 @@ class SdXMLImport: public SvXMLImport
css::uno::Reference< css::container::XNameAccess > mxPageLayouts;
// contexts for Style and AutoStyle import
- SdXMLMasterStylesContext* mpMasterStylesContext;
+ css::uno::Reference<SdXMLMasterStylesContext> mxMasterStylesContext;
// token map lists
SvXMLTokenMap* mpDocElemTokenMap;