summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/tplcitem.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 13:08:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 09:31:50 +0200
commitd2b3ea4d377bf05830f6eb11d53fd55ea6b435fc (patch)
treea9ca855eac45810e67d6e629538de13b2a9e589d /sfx2/source/dialog/tplcitem.cxx
parent7a11e702569ab89eb7722c883ecc3cbbe1a19a65 (diff)
loplugin:useuniqueptr in sfx2
Change-Id: I7b406cd07cae579de608faa3ec47dd1190dea411 Reviewed-on: https://gerrit.libreoffice.org/60003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/dialog/tplcitem.cxx')
-rw-r--r--sfx2/source/dialog/tplcitem.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx
index ec732fe08768..1254e4163161 100644
--- a/sfx2/source/dialog/tplcitem.cxx
+++ b/sfx2/source/dialog/tplcitem.cxx
@@ -156,16 +156,15 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
IMPL_LINK_NOARG(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, void*, void)
{
nUserEventId = nullptr;
- SfxBoolItem* pState = nullptr;
+ std::unique_ptr<SfxBoolItem> pState;
switch(nWaterCanState)
{
case 0 :
case 1 :
- pState = new SfxBoolItem(SID_STYLE_WATERCAN, nWaterCanState != 0);
+ pState.reset(new SfxBoolItem(SID_STYLE_WATERCAN, nWaterCanState != 0));
break;
}
- rTemplateDlg.SetWaterCanState(pState);
- delete pState;
+ rTemplateDlg.SetWaterCanState(pState.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */