[Libreoffice-commits] core.git: sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu Apr 12 13:16:38 UTC 2018
sc/source/ui/Accessibility/AccessibleText.cxx | 6 +++---
sc/source/ui/inc/AccessibleText.hxx | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 44c75946d209d2bbfb9d2b0ad8a59abd3d0e8b74
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Apr 10 11:16:41 2018 +0200
loplugin:useuniqueptr in ScAccessiblePreviewHeaderCellTextData
Change-Id: I18764ca8ca2e0a78d68005c7604809990afa63ce
Reviewed-on: https://gerrit.libreoffice.org/52760
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index e75f49850177..f82b3d812043 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1214,7 +1214,7 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData()
{
if (pEditEngine)
pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
- delete mpViewForwarder;
+ mpViewForwarder.reset();
}
void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
@@ -1286,8 +1286,8 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder()
{
if (!mpViewForwarder)
- mpViewForwarder = new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos, mbColHeader);
- return mpViewForwarder;
+ mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos, mbColHeader));
+ return mpViewForwarder.get();
}
ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* pViewShell)
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index e802af493082..286bdb6463ec 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -187,7 +187,7 @@ public:
virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
private:
- ScPreviewViewForwarder* mpViewForwarder;
+ std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
ScPreviewShell* mpViewShell;
OUString maText;
bool mbColHeader;
More information about the Libreoffice-commits
mailing list