diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-09 14:04:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-10 08:43:04 +0200 |
commit | 45e1b44247c6b8af449fbf078068939140bd9dbb (patch) | |
tree | 07fb23933c74990e86fcf2dd3dc6552a845103a3 /sc | |
parent | 015fc77362e4c0f2c213cc793e8e692ba3c7bc05 (diff) |
loplugin:useuniqueptr in ScAccessiblePreviewCellTextData
Change-Id: I06e211f69cafd88080680a22919f1c16eef2aaa9
Reviewed-on: https://gerrit.libreoffice.org/52648
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleText.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 489e2c62ebba..3ca075385213 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -1142,7 +1142,7 @@ ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData() { if (pEditEngine) pEditEngine->SetNotifyHdl(Link<EENotify&,void>()); - delete mpViewForwarder; + mpViewForwarder.reset(); } void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) @@ -1185,8 +1185,8 @@ SvxTextForwarder* ScAccessiblePreviewCellTextData::GetTextForwarder() SvxViewForwarder* ScAccessiblePreviewCellTextData::GetViewForwarder() { if (!mpViewForwarder) - mpViewForwarder = new ScPreviewCellViewForwarder(mpViewShell, aCellPos); - return mpViewForwarder; + mpViewForwarder.reset(new ScPreviewCellViewForwarder(mpViewShell, aCellPos)); + return mpViewForwarder.get(); } ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewShell) diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index bcb8c3fff01c..860534504c85 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -164,7 +164,7 @@ public: virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; } private: - ScPreviewViewForwarder* mpViewForwarder; + std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder; ScPreviewShell* mpViewShell; using ScAccessibleCellBaseTextData::GetDocShell; |