diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 09:35:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 09:35:26 +0200 |
commit | 7f6a17756d62226dfa2af1ded365e3b3ac9f8d21 (patch) | |
tree | 596ab4f7e4d572b08e9affaefc4fae4e344b5f15 /sc | |
parent | 9a3a9a393c74872a5ec5f227b7c30ae3d4bcb1aa (diff) |
Let CreateItemSet return unique_ptr
...and address resulting loplugin:useuniqueptr
Change-Id: Ia79eb8d59ce5092b2d93b656eab687096baedf17
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/scmod.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 8eaccd2558e3..6f24143fc2af 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -235,7 +235,7 @@ public: sal_uInt16 GetCurRefDlgId() const { return nCurRefDlgId; } // virtual methods for the 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/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index eedfdb4c08a4..8ca88ba3b886 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> - +#include <o3tl/make_unique.hxx> #include "scitems.hxx" #include <sfx2/app.hxx> #include <editeng/eeitem.hxx> @@ -1925,12 +1925,12 @@ IMPL_LINK_NOARG(ScModule, SpellTimerHdl, Timer *, void) /** * Virtual methods for the OptionsDialog */ -SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) +std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId ) { - SfxItemSet* pRet = nullptr; + std::unique_ptr<SfxItemSet> pRet; if(SID_SC_EDITOPTIONS == nId) { - pRet = new SfxItemSet( GetPool(), + pRet = o3tl::make_unique<SfxItemSet>( GetPool(), // TP_CALC: SID_SCDOCOPTIONS, SID_SCDOCOPTIONS, // TP_VIEW: |