diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-18 09:47:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-28 10:51:13 +0200 |
commit | 26b27c23d42247695d72167be7729e36a473f644 (patch) | |
tree | d050d995e530949e18d3878b41a6e8e6df909da6 | |
parent | c12bfe9296b5db66ae7326f1dd99b1aa8fb9d2bb (diff) |
loplugin:useuniqueptr in SvxDrawPage
Change-Id: Ic0ca03d419cb7124d5076130163de113b29bac9d
Reviewed-on: https://gerrit.libreoffice.org/54848
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/unopage.hxx | 3 | ||||
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 6 | ||||
-rw-r--r-- | sw/inc/unodraw.hxx | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx index eefc11c61b2b..1ca099d797eb 100644 --- a/include/svx/unopage.hxx +++ b/include/svx/unopage.hxx @@ -40,6 +40,7 @@ #include <comphelper/servicehelper.hxx> #include <svx/unoprov.hxx> +#include <memory> class SdrPage; class SdrModel; @@ -70,7 +71,7 @@ class SVX_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper6< css::drawin SdrPage* mpPage; // TTTT should be reference SdrModel* mpModel; // TTTT probably not needed -> use from SdrPage - SdrView* mpView; + std::unique_ptr<SdrView> mpView; void SelectObjectsInView( const css::uno::Reference< css::drawing::XShapes >& aShapes, SdrPageView* pPageView ) throw (); void SelectObjectInView( const css::uno::Reference< css::drawing::XShape >& xShape, SdrPageView* pPageView ) throw(); diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 8f252456b107..15a3b01c5635 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -94,11 +94,7 @@ void SvxDrawPage::disposing() throw() mpModel = nullptr; } - if( mpView ) - { - delete mpView; - mpView = nullptr; - } + mpView.reset(); mpPage = nullptr; } diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index aea0b64ce67c..3612db0b7755 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -47,7 +47,7 @@ public: const SdrMarkList& PreGroup(const css::uno::Reference< css::drawing::XShapes >& rShapes); void PreUnGroup(const css::uno::Reference< css::drawing::XShapeGroup >& rShapeGroup); - SdrView* GetDrawView() {return mpView;} + SdrView* GetDrawView() {return mpView.get();} SdrPageView* GetPageView(); void RemovePageView(); static css::uno::Reference< css::uno::XInterface > GetInterface( SdrObject* pObj ); |