diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 09:25:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 08:21:49 +0200 |
commit | c5adc20d4017d12172d861e7c1165e79c2ce93bf (patch) | |
tree | 820cb71d71dce7df3595f3acc1f9aff3a8f825cb | |
parent | 466d6d77f08a46f7801ba3b9771c25c2eb2a7902 (diff) |
loplugin:useuniqueptr in SwNumPositionTabPage
Change-Id: Ie0ad1694df7429080f2a296bb72370c6e70c97d4
Reviewed-on: https://gerrit.libreoffice.org/58242
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/ui/misc/num.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/inc/num.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 69e0261c494f..89d748a826ef 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -141,7 +141,7 @@ SwNumPositionTabPage::~SwNumPositionTabPage() void SwNumPositionTabPage::dispose() { - delete pActNum; + pActNum.reset(); pOutlineDlg = nullptr; SfxTabPage::dispose(); } @@ -434,10 +434,10 @@ void SwNumPositionTabPage::Reset( const SfxItemSet* rSet ) } if(!pActNum) - pActNum = new SwNumRule(*pSaveNum); + pActNum.reset(new SwNumRule(*pSaveNum)); else if(*pSaveNum != *pActNum) *pActNum = *pSaveNum; - m_aPreviewWIN.SetNumRule(pActNum); + m_aPreviewWIN.SetNumRule(pActNum.get()); InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); InitControls(); diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx index d17a6894647e..f1849b17f2c5 100644 --- a/sw/source/uibase/inc/num.hxx +++ b/sw/source/uibase/inc/num.hxx @@ -37,7 +37,7 @@ class SwOutlineTabDialog; class SwNumPositionTabPage : public SfxTabPage { - SwNumRule* pActNum; + std::unique_ptr<SwNumRule> pActNum; SwNumRule* pSaveNum; SwWrtShell* pWrtSh; |