[Libreoffice-commits] core.git: sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Apr 9 06:45:30 UTC 2018
sc/source/ui/Accessibility/AccessibleText.cxx | 11 +++--------
sc/source/ui/inc/AccessibleText.hxx | 3 +--
2 files changed, 4 insertions(+), 10 deletions(-)
New commits:
commit 3a5a3ebe09a348f976e86252563b2b71ec65fdf6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Sat Apr 7 14:48:07 2018 +0200
loplugin:useuniqueptr in ScAccessibleCellTextData
and remove unused mpEditViewForwarder field
Change-Id: I844a935852ba9cb81606a98aff9454a73c3fe347
Reviewed-on: https://gerrit.libreoffice.org/52545
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 66bcc5f4ad88..30369d73077a 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -659,8 +659,6 @@ void ScEditViewForwarder::SetInvalid()
ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell,
const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell)
: ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
- mpViewForwarder(nullptr),
- mpEditViewForwarder(nullptr),
mpViewShell(pViewShell),
meSplitPos(eSplitPos),
mpAccessibleCell( pAccCell )
@@ -671,8 +669,7 @@ ScAccessibleCellTextData::~ScAccessibleCellTextData()
{
if (pEditEngine)
pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
- delete mpViewForwarder;
- delete mpEditViewForwarder;
+ mpViewForwarder.reset();
}
void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
@@ -682,8 +679,6 @@ void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
mpViewShell = nullptr; // invalid now
if (mpViewForwarder)
mpViewForwarder->SetInvalid();
- if (mpEditViewForwarder)
- mpEditViewForwarder->SetInvalid();
}
ScAccessibleCellBaseTextData::Notify(rBC, rHint);
}
@@ -842,8 +837,8 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
SvxViewForwarder* ScAccessibleCellTextData::GetViewForwarder()
{
if (!mpViewForwarder)
- mpViewForwarder = new ScViewForwarder(mpViewShell, meSplitPos, aCellPos);
- return mpViewForwarder;
+ mpViewForwarder.reset(new ScViewForwarder(mpViewShell, meSplitPos, aCellPos));
+ return mpViewForwarder.get();
}
SvxEditViewForwarder* ScAccessibleCellTextData::GetEditViewForwarder( bool /* bCreate */ )
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index c36c63f02cab..fcf14945a80c 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -90,8 +90,7 @@ public:
virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate ) override;
private:
- ScViewForwarder* mpViewForwarder;
- ScEditViewForwarder* mpEditViewForwarder;
+ std::unique_ptr<ScViewForwarder> mpViewForwarder;
ScTabViewShell* mpViewShell;
ScSplitPos meSplitPos;
ScAccessibleCell* mpAccessibleCell;
More information about the Libreoffice-commits
mailing list