diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 14:35:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 08:19:02 +0200 |
commit | df7adbfc158f182e9111ade5cde45fc860f0275e (patch) | |
tree | a8e4fac965e819dbf36db72ea4a89c4d915f1908 /sw | |
parent | 3f1eaebcbb39aeff0558218f0ce77f7e91424fa2 (diff) |
loplugin:useuniqueptr in SwCharURLPage
Change-Id: I19cb7ba6ce32fef43691db2c994fd79fee76fb46
Reviewed-on: https://gerrit.libreoffice.org/58226
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/chrdlg/chardlg.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dialog/macassgn.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/inc/chrdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/macassgn.hxx | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index ce27eae7dcfa..716d88528121 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -185,7 +185,7 @@ SwCharURLPage::~SwCharURLPage() void SwCharURLPage::dispose() { - delete pINetItem; + pINetItem.reset(); SfxTabPage::dispose(); } @@ -221,7 +221,7 @@ void SwCharURLPage::Reset(const SfxItemSet* rSet) m_xVisitedLB->save_value(); m_xNotVisitedLB->save_value(); m_xTargetFrameLB->save_value(); - pINetItem = new SvxMacroItem(FN_INET_FIELD_MACRO); + pINetItem.reset( new SvxMacroItem(FN_INET_FIELD_MACRO) ); if( pINetFormat->GetMacroTable() ) pINetItem->SetMacroTable(*pINetFormat->GetMacroTable()); diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index 7b192f89c2cb..ec1c51062a99 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -105,13 +105,13 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) } bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh, - SvxMacroItem*& rpINetItem ) + std::unique_ptr<SvxMacroItem>& rpINetItem ) { bool bRet = false; SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ); SvxMacroItem aItem( RES_FRMMACRO ); if( !rpINetItem ) - rpINetItem = new SvxMacroItem( RES_FRMMACRO ); + rpINetItem.reset(new SvxMacroItem( RES_FRMMACRO )); else aItem.SetMacroTable( rpINetItem->GetMacroTable() ); diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx index 10d00c645105..0f8ec43d9296 100644 --- a/sw/source/uibase/inc/chrdlg.hxx +++ b/sw/source/uibase/inc/chrdlg.hxx @@ -55,7 +55,7 @@ public: class SwCharURLPage : public SfxTabPage { - SvxMacroItem* pINetItem; + std::unique_ptr<SvxMacroItem> pINetItem; bool bModified; std::unique_ptr<weld::Entry> m_xURLED; diff --git a/sw/source/uibase/inc/macassgn.hxx b/sw/source/uibase/inc/macassgn.hxx index 1bb1800c295d..7437f094c9d2 100644 --- a/sw/source/uibase/inc/macassgn.hxx +++ b/sw/source/uibase/inc/macassgn.hxx @@ -39,7 +39,7 @@ class SwMacroAssignDlg public: static SfxEventNamesItem AddEvents( DlgEventType eType ); static bool INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh, - SvxMacroItem*& rpINetItem ); + std::unique_ptr<SvxMacroItem>& rpINetItem ); }; #endif |