diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-27 10:18:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-28 08:27:11 +0200 |
commit | 291f125e84e9a375442191e22325acbf88ed88dc (patch) | |
tree | ff4e52dd1a5ebb4e5566a927e4abef7fd8d04366 /sc/source/ui | |
parent | 681b3facd3ddb7ab4577c48e232fb29a269d0d40 (diff) |
loplugin:useuniqueptr in ScAccessiblePageHeaderArea
Change-Id: Ic32996b3aaf415109c1fdc336db138ec12159ce2
Reviewed-on: https://gerrit.libreoffice.org/56545
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessiblePageHeaderArea.hxx | 6 |
2 files changed, 7 insertions, 10 deletions
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 69538abbf141..c1e3c919ea29 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -80,11 +80,8 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing() mpViewShell->RemoveAccessibilityObject(*this); mpViewShell = nullptr; } - if (mpTextHelper) - DELETEZ(mpTextHelper); - if (mpEditObj) - DELETEZ(mpEditObj); - + mpTextHelper.reset(); + mpEditObj.reset(); ScAccessibleContextBase::disposing(); } @@ -281,10 +278,10 @@ void ScAccessiblePageHeaderArea::CreateTextHelper() { if (!mpTextHelper) { - mpTextHelper = new ::accessibility::AccessibleTextHelper( + mpTextHelper.reset( new ::accessibility::AccessibleTextHelper( o3tl::make_unique<ScAccessibilityEditSource>( o3tl::make_unique<ScAccessibleHeaderTextData>( - mpViewShell, mpEditObj, mbHeader, meAdjust))); + mpViewShell, mpEditObj.get(), mbHeader, meAdjust))) ); mpTextHelper->SetEventSource(this); } } diff --git a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx index 5b15a2fd833e..7a3eba11eac4 100644 --- a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx +++ b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx @@ -44,7 +44,7 @@ public: protected: virtual ~ScAccessiblePageHeaderArea() override; public: - const EditTextObject* GetEditTextObject() const { return mpEditObj; } + const EditTextObject* GetEditTextObject() const { return mpEditObj.get(); } using ScAccessibleContextBase::disposing; virtual void SAL_CALL disposing() override; @@ -104,8 +104,8 @@ protected: virtual tools::Rectangle GetBoundingBox() const override; private: - EditTextObject* mpEditObj; - accessibility::AccessibleTextHelper* mpTextHelper; + std::unique_ptr<EditTextObject> mpEditObj; + std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper; ScPreviewShell* mpViewShell; bool mbHeader; SvxAdjust meAdjust; |