From 45e1b44247c6b8af449fbf078068939140bd9dbb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 9 Apr 2018 14:04:22 +0200 Subject: loplugin:useuniqueptr in ScAccessiblePreviewCellTextData Change-Id: I06e211f69cafd88080680a22919f1c16eef2aaa9 Reviewed-on: https://gerrit.libreoffice.org/52648 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/Accessibility/AccessibleText.cxx | 6 +++--- sc/source/ui/inc/AccessibleText.hxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sc') 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()); - 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 mpViewForwarder; ScPreviewShell* mpViewShell; using ScAccessibleCellBaseTextData::GetDocShell; -- cgit