include/svx/connctrl.hxx | 3 ++- svx/source/dialog/connctrl.cxx | 6 +++--- svx/source/form/navigatortree.cxx | 4 ++-- svx/source/inc/fmexpl.hxx | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-)
New commits: commit 51d93012d5d947c458c58a92b10b6411e1ebb43d Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon May 28 12:00:50 2018 +0200 loplugin:useuniqueptr in SvxXConnectionPreview Change-Id: Ie634cbf418e49a2272966feafb4bbfa987cad52c Reviewed-on: https://gerrit.libreoffice.org/55223 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx index 106140dfa374..0f35c31cf1aa 100644 --- a/include/svx/connctrl.hxx +++ b/include/svx/connctrl.hxx @@ -26,6 +26,7 @@ #include <vcl/ctrl.hxx> #include <vcl/event.hxx> #include <vcl/outdev.hxx> +#include <memory> namespace vcl { class Window; } @@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview : public Control private: SdrEdgeObj* pEdgeObj; - SdrPage* pSdrPage; + std::unique_ptr<SdrPage> pSdrPage; const SdrView* pView; SVX_DLLPRIVATE void SetStyles(); diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index a27dcf0278fd..d46f31beacf7 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -54,7 +54,7 @@ SvxXConnectionPreview::~SvxXConnectionPreview() void SvxXConnectionPreview::dispose() { - delete pSdrPage; + pSdrPage.reset(); Control::dispose(); } @@ -161,9 +161,9 @@ void SvxXConnectionPreview::Construct() // not yet one. if(!pSdrPage) { - pSdrPage = new SdrPage( + pSdrPage.reset( new SdrPage( pView->getSdrModelFromSdrView(), - false); + false) ); } const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj); commit 5848eb908fadd8ff8ab73bbbbee1df9743ffb60f Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon May 28 11:59:15 2018 +0200 loplugin:useuniqueptr in NavigatorTree Change-Id: I76930b64f873ecb6b70fed4d78199d43bc4edcff Reviewed-on: https://gerrit.libreoffice.org/55222 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index ca831645b4cf..6d114087ac73 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -143,7 +143,7 @@ namespace svxform EnableInplaceEditing( true ); SetSelectionMode(SelectionMode::Multiple); - m_pNavModel = new NavigatorTreeModel(); + m_pNavModel.reset(new NavigatorTreeModel()); Clear(); StartListening( *m_pNavModel ); @@ -172,7 +172,7 @@ namespace svxform DBG_ASSERT(GetNavModel() != nullptr, "NavigatorTree::~NavigatorTree : unexpected : no ExplorerModel"); EndListening( *m_pNavModel ); Clear(); - delete m_pNavModel; + m_pNavModel.reset(); SvTreeListBox::dispose(); } diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx index 0d01abb9e2e9..f681edc26ffb 100644 --- a/svx/source/inc/fmexpl.hxx +++ b/svx/source/inc/fmexpl.hxx @@ -386,7 +386,7 @@ namespace svxform ::svxform::OControlExchangeHelper m_aControlExchange; - NavigatorTreeModel* m_pNavModel; + std::unique_ptr<NavigatorTreeModel> m_pNavModel; SvTreeListEntry* m_pRootEntry; SvTreeListEntry* m_pEditEntry; @@ -479,7 +479,7 @@ namespace svxform OUString GenerateName( FmEntryData const * pEntryData ); - NavigatorTreeModel* GetNavModel() const { return m_pNavModel; } + NavigatorTreeModel* GetNavModel() const { return m_pNavModel.get(); } SvTreeListEntry* FindEntry( FmEntryData* pEntryData ); virtual bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) override; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits