loplugin:useuniqueptr in ScAccessibleDocument

Change-Id: I199b5f3bd0d8555dc01d6f51208ebe4526a32f9a
Reviewed-on: https://gerrit.libreoffice.org/56559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-06-27 13:56:55 +02:00
parent 4baf5adc8f
commit 2037e85b79
2 changed files with 4 additions and 7 deletions

View File

@@ -1417,7 +1417,7 @@ void ScAccessibleDocument::PreInit()
void ScAccessibleDocument::Init()
{
if(!mpChildrenShapes)
mpChildrenShapes = new ScChildrenShapes(this, mpViewShell, meSplitPos);
mpChildrenShapes.reset( new ScChildrenShapes(this, mpViewShell, meSplitPos) );
}
ScAccessibleDocument::~ScAccessibleDocument()
@@ -1443,8 +1443,7 @@ void SAL_CALL ScAccessibleDocument::disposing()
mpViewShell->RemoveAccessibilityObject(*this);
mpViewShell = nullptr;
}
if (mpChildrenShapes)
DELETEZ(mpChildrenShapes);
mpChildrenShapes.reset();
ScAccessibleDocumentBase::disposing();
}
@@ -1539,9 +1538,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// Shapes / form controls after reload not accessible, rebuild the
// mpChildrenShapes variable.
if (mpChildrenShapes)
DELETEZ(mpChildrenShapes);
mpChildrenShapes = new ScChildrenShapes( this, mpViewShell, meSplitPos );
mpChildrenShapes.reset( new ScChildrenShapes( this, mpViewShell, meSplitPos ) );
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::INVALIDATE_ALL_CHILDREN;

View File

@@ -229,7 +229,7 @@ private:
ScTabViewShell* mpViewShell;
ScSplitPos meSplitPos;
rtl::Reference<ScAccessibleSpreadsheet> mpAccessibleSpreadsheet;
ScChildrenShapes* mpChildrenShapes;
std::unique_ptr<ScChildrenShapes> mpChildrenShapes;
ScAccessibleEditObject* mpTempAccEdit;
css::uno::Reference<css::accessibility::XAccessible> mxTempAcc;
tools::Rectangle maVisArea;