summaryrefslogtreecommitdiff
path: root/sw
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 /sw
parent9a3a9a393c74872a5ec5f227b7c30ae3d4bcb1aa (diff)
Let CreateItemSet return unique_ptr
...and address resulting loplugin:useuniqueptr Change-Id: Ia79eb8d59ce5092b2d93b656eab687096baedf17
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/swmodule.hxx2
-rw-r--r--sw/source/uibase/app/appopt.cxx5
2 files changed, 4 insertions, 3 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 71cf3c0f499f..3c7839ffa6ce 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -221,7 +221,7 @@ public:
SwFieldUpdateFlags GetFieldUpdateFlags() const;
// Virtual methods for options 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/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 732b413e0334..9db1a4b61002 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/i18n/ScriptType.hpp>
#include <hintids.hxx>
+#include <o3tl/make_unique.hxx>
#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
#include <sfx2/request.hxx>
@@ -72,7 +73,7 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
+std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
{
bool bTextDialog = (nId == SID_SW_EDITOPTIONS);
@@ -96,7 +97,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
}
// Options/Edit
- SfxItemSet* pRet = new SfxItemSet (GetPool(), FN_PARAM_DOCDISP, FN_PARAM_ELEM,
+ auto pRet = o3tl::make_unique<SfxItemSet>(GetPool(), FN_PARAM_DOCDISP, FN_PARAM_ELEM,
SID_PRINTPREVIEW, SID_PRINTPREVIEW,
SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
FN_PARAM_PRINTER, FN_PARAM_STDFONTS,