[Libreoffice-commits] core.git: sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 12 12:25:53 UTC 2020
sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx | 25 ++++++-------
sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx | 2 -
2 files changed, 13 insertions(+), 14 deletions(-)
New commits:
commit 05bf4b0a3af2e55501f8ce73cc97ca5e2caa54c2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 12 10:29:35 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 12 14:25:16 2020 +0200
fix leak in ScAccessiblePreviewHeaderCell
Change-Id: I0bafbe6d60980146006825229c0476fc22d1510f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100585
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 380b173d9845..ea6997331638 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -57,7 +57,6 @@ ScAccessiblePreviewHeaderCell::ScAccessiblePreviewHeaderCell( const css::uno::Re
sal_Int32 nIndex ) :
ScAccessibleContextBase( rxParent, AccessibleRole::TABLE_CELL ),
mpViewShell( pViewShell ),
- mpTextHelper( nullptr ),
mnIndex( nIndex ),
maCellPos( rCellPos ),
mbColumnHeader( bIsColHdr ),
@@ -94,8 +93,8 @@ void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint&
const SfxHintId nId = rHint.GetId();
if (nId == SfxHintId::ScAccVisAreaChanged)
{
- if (mpTextHelper)
- mpTextHelper->UpdateChildren();
+ if (mxTextHelper)
+ mxTextHelper->UpdateChildren();
}
else if ( nId == SfxHintId::DataChanged )
{
@@ -178,10 +177,10 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessi
SolarMutexGuard aGuard;
IsObjectValid();
- if(!mpTextHelper)
+ if(!mxTextHelper)
CreateTextHelper();
- xRet = mpTextHelper->GetAt(rPoint);
+ xRet = mxTextHelper->GetAt(rPoint);
}
return xRet;
@@ -205,18 +204,18 @@ sal_Int32 SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleChildCount()
{
SolarMutexGuard aGuard;
IsObjectValid();
- if (!mpTextHelper)
+ if (!mxTextHelper)
CreateTextHelper();
- return mpTextHelper->GetChildCount();
+ return mxTextHelper->GetChildCount();
}
uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleChild(sal_Int32 nIndex)
{
SolarMutexGuard aGuard;
IsObjectValid();
- if (!mpTextHelper)
+ if (!mxTextHelper)
CreateTextHelper();
- return mpTextHelper->GetChild(nIndex);
+ return mxTextHelper->GetChild(nIndex);
}
sal_Int32 SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleIndexInParent()
@@ -377,14 +376,14 @@ bool ScAccessiblePreviewHeaderCell::IsDefunc( const uno::Reference<XAccessibleSt
void ScAccessiblePreviewHeaderCell::CreateTextHelper()
{
- if (!mpTextHelper)
+ if (!mxTextHelper)
{
- mpTextHelper = new ::accessibility::AccessibleTextHelper(
+ mxTextHelper.reset( new ::accessibility::AccessibleTextHelper(
std::make_unique<ScAccessibilityEditSource>(
std::make_unique<ScAccessiblePreviewHeaderCellTextData>(
mpViewShell, getAccessibleName(), maCellPos,
- mbColumnHeader, mbRowHeader)));
- mpTextHelper->SetEventSource(this);
+ mbColumnHeader, mbRowHeader))) );
+ mxTextHelper->SetEventSource(this);
}
}
diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
index 7af796fb6563..e18c7eb54a6b 100644
--- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
@@ -113,7 +113,7 @@ protected:
private:
ScPreviewShell* mpViewShell;
- accessibility::AccessibleTextHelper* mpTextHelper;
+ std::unique_ptr<accessibility::AccessibleTextHelper> mxTextHelper;
sal_Int32 mnIndex;
ScAddress maCellPos;
bool mbColumnHeader;
More information about the Libreoffice-commits
mailing list