summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-14 09:35:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-14 09:35:26 +0200
commit7f6a17756d62226dfa2af1ded365e3b3ac9f8d21 (patch)
tree596ab4f7e4d572b08e9affaefc4fae4e344b5f15 /sd
parent9a3a9a393c74872a5ec5f227b7c30ae3d4bcb1aa (diff)
Let CreateItemSet return unique_ptr
...and address resulting loplugin:useuniqueptr Change-Id: Ia79eb8d59ce5092b2d93b656eab687096baedf17
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/sdmod.hxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx5
2 files changed, 4 insertions, 3 deletions
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 6ba30070212f..3e50eec0f2f6 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -109,7 +109,7 @@ public:
SD_DLLPUBLIC SvNumberFormatter* GetNumberFormatter();
// virtual methods for the option dialog
- virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) override;
+ virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) override;
virtual SfxStyleFamilies* CreateStyleFamilies() override;
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 4ddeb6ff5eec..2ddb26a7ee84 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -19,6 +19,7 @@
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/styfitem.hxx>
#include <svl/inethist.hxx>
@@ -409,7 +410,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
/**
* virtual methods for option dialog
*/
-SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
+std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
{
::sd::FrameView* pFrameView = nullptr;
::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
@@ -440,7 +441,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
SfxItemPool& rPool = GetPool();
rPool.SetDefaultMetric( MapUnit::Map100thMM );
- SfxItemSet* pRet = new SfxItemSet( rPool,
+ auto pRet = o3tl::make_unique<SfxItemSet>( rPool,
SID_ATTR_METRIC, SID_ATTR_METRIC,
SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,