summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-14 11:47:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-14 11:47:28 +0200
commit02d306a23acf842e62dfc317396296425b31c964 (patch)
treee3702bdbcc3710f2cdbc60c9641a69de5f56eaae /sd
parent90bea1ea24838845646ec253d1a4b472b73d53ca (diff)
Use unique_ptr for SdPage::mpItems
Change-Id: I28025e8896331926d30e748f7c945973b978cb32
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/sdpage.hxx2
-rw-r--r--sd/source/core/sdpage.cxx2
-rw-r--r--sd/source/core/sdpage2.cxx6
3 files changed, 4 insertions, 6 deletions
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 45d3b0e78262..4fef9099de04 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -134,7 +134,7 @@ protected:
virtual css::uno::Reference< css::uno::XInterface > createUnoPage() override;
- SfxItemSet* mpItems;
+ std::unique_ptr<SfxItemSet> mpItems;
SfxItemSet* getOrCreateItems();
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 6cb7963bcacd..dd4f403344a2 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -185,8 +185,6 @@ SdPage::~SdPage()
clearChildNodes(mxAnimationNode);
- delete mpItems;
-
Clear();
}
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 977038901c9a..c8c5b946776c 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -19,7 +19,7 @@
#include <vector>
#include <libxml/xmlwriter.h>
-
+#include <o3tl/make_unique.hxx>
#include <sfx2/docfile.hxx>
#include <vcl/svapp.hxx>
#include <editeng/outliner.hxx>
@@ -479,9 +479,9 @@ SfxStyleSheet* SdPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
SfxItemSet* SdPage::getOrCreateItems()
{
if( mpItems == nullptr )
- mpItems = new SfxItemSet( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
+ mpItems = o3tl::make_unique<SfxItemSet>( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
- return mpItems;
+ return mpItems.get();
}
bool SdPage::setAlienAttributes( const css::uno::Any& rAttributes )