summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-13 11:19:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-13 11:19:58 +0200
commitd57c9d81aab1e02d257738a82bddeca78db46da8 (patch)
treef1997c86fc81b44b9821b905085f0f8f00450cac /cui/source
parent5389b44827393c80df27e429ba446971a0d7a696 (diff)
Use unique_ptr for SvxHpLinkDlg::mpItemSet
Change-Id: I6ad2669afe3853196bb1fce9c7c81af640831116
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx10
-rw-r--r--cui/source/inc/cuihyperdlg.hxx6
2 files changed, 11 insertions, 5 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 09810b34b8b5..eb8e9515b759 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
#include <vcl/settings.hxx>
#include <unotools/viewoptions.hxx>
#include "cuihyperdlg.hxx"
@@ -115,13 +118,13 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
GetCancelButton().SetText ( CuiResId(RID_SVXSTR_HYPDLG_CLOSEBUT) );
// create itemset for tabpages
- mpItemSet = new SfxItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
+ mpItemSet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
SvxHyperlinkItem aItem(SID_HYPERLINK_GETLINK);
mpItemSet->Put(aItem);
- SetInputSet (mpItemSet);
+ SetInputSet (mpItemSet.get());
//loop through the pages and get their max bounds and lock that down
ShowPage(RID_SVXPAGE_HYPERLINK_NEWDOCUMENT);
@@ -165,8 +168,7 @@ void SvxHpLinkDlg::dispose()
SvtViewOptions aViewOpt( EViewType::TabDialog, OUString::number(SID_HYPERLINK_DIALOG) );
aViewOpt.Delete();
- delete mpItemSet;
- mpItemSet = nullptr;
+ mpItemSet.reset();
maCtrl.dispose();
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index 19feaf2aaeac..897d30a09aed 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
#define INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
+#include <sal/config.h>
+
+#include <memory>
+
#include <svx/hlnkitem.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/ctrlitem.hxx>
@@ -62,7 +66,7 @@ class SvxHpLinkDlg : public IconChoiceDialog
private:
SvxHlinkCtrl maCtrl; ///< Controller
SfxBindings* mpBindings;
- SfxItemSet* mpItemSet;
+ std::unique_ptr<SfxItemSet> mpItemSet;
bool mbGrabFocus : 1;
bool mbReadOnly : 1;