summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 11:05:39 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commitbb35e4dcf986619edb300f4dcd35d54b04dce034 (patch)
tree69b631d8e35ad2e4a6f3f6be211feda39e46ddf9
parent8b229333aeb98dae259dac068b67195a8baa1423 (diff)
remove direct memory management
Change-Id: I5dd5d9130f11f47c4b48c1aae9748434ac751d95
-rw-r--r--include/xmloff/shapeimport.hxx8
-rw-r--r--xmloff/source/draw/shapeimport.cxx24
2 files changed, 10 insertions, 22 deletions
diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx
index db54f5cb1ebd..eda682d53bed 100644
--- a/include/xmloff/shapeimport.hxx
+++ b/include/xmloff/shapeimport.hxx
@@ -275,8 +275,8 @@ class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public salhelper::SimpleReferenceO
rtl::Reference<SvXMLImportPropertyMapper> mpPresPagePropsMapper;
// contexts for Style and AutoStyle import
- SvXMLStylesContext* mpStylesContext;
- SvXMLStylesContext* mpAutoStylesContext;
+ css::uno::Reference<SvXMLStylesContext> mxStylesContext;
+ css::uno::Reference<SvXMLStylesContext> mxAutoStylesContext;
// contexts for xShape contents TokenMaps
SvXMLTokenMap* mpGroupShapeElemTokenMap;
@@ -335,9 +335,9 @@ public:
const SvXMLTokenMap& Get3DLightAttrTokenMap();
// Styles and AutoStyles contexts
- SvXMLStylesContext* GetStylesContext() const { return mpStylesContext; }
+ SvXMLStylesContext* GetStylesContext() const { return mxStylesContext.get(); }
void SetStylesContext(SvXMLStylesContext* pNew);
- SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStylesContext; }
+ SvXMLStylesContext* GetAutoStylesContext() const { return mxAutoStylesContext.get(); }
void SetAutoStylesContext(SvXMLStylesContext* pNew);
// get factories and mappers
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 2402aad98a5b..3f40c5691e6f 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -113,8 +113,6 @@ XMLShapeImportHelper::XMLShapeImportHelper(
mpPropertySetMapper(nullptr),
mpPresPagePropsMapper(nullptr),
- mpStylesContext(nullptr),
- mpAutoStylesContext(nullptr),
mpGroupShapeElemTokenMap(nullptr),
mpFrameShapeElemTokenMap(nullptr),
mp3DSceneShapeElemTokenMap(nullptr),
@@ -184,17 +182,11 @@ XMLShapeImportHelper::~XMLShapeImportHelper()
delete mp3DLightAttrTokenMap;
// Styles or AutoStyles context?
- if(mpStylesContext)
- {
- mpStylesContext->Clear();
- mpStylesContext->ReleaseRef();
- }
+ if(mxStylesContext.is())
+ mxStylesContext->Clear();
- if(mpAutoStylesContext)
- {
- mpAutoStylesContext->Clear();
- mpAutoStylesContext->ReleaseRef();
- }
+ if(mxAutoStylesContext.is())
+ mxAutoStylesContext->Clear();
}
const SvXMLTokenMap& XMLShapeImportHelper::GetGroupShapeElemTokenMap()
@@ -434,16 +426,12 @@ SvXMLShapeContext* XMLShapeImportHelper::Create3DSceneChildContext(
void XMLShapeImportHelper::SetStylesContext(SvXMLStylesContext* pNew)
{
- mpStylesContext = pNew;
- if (mpStylesContext)
- mpStylesContext->AddFirstRef();
+ mxStylesContext.set(pNew);
}
void XMLShapeImportHelper::SetAutoStylesContext(SvXMLStylesContext* pNew)
{
- mpAutoStylesContext = pNew;
- if (mpAutoStylesContext)
- mpAutoStylesContext->AddFirstRef();
+ mxAutoStylesContext.set(pNew);
}
SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext(