loplugin:useuniqueptr in ScAccessiblePreviewTable

Change-Id: I75b37dab51f3510f6e7155c191a85af99b0d350f
Reviewed-on: https://gerrit.libreoffice.org/56547
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-06-27 10:21:19 +02:00
parent f4dafe050a
commit 1113f93db3
2 changed files with 4 additions and 5 deletions

View File

@@ -76,8 +76,7 @@ void SAL_CALL ScAccessiblePreviewTable::disposing()
mpViewShell = nullptr; mpViewShell = nullptr;
} }
if (mpTableInfo) mpTableInfo.reset();
DELETEZ (mpTableInfo);
ScAccessibleContextBase::disposing(); ScAccessibleContextBase::disposing();
} }
@@ -91,7 +90,7 @@ void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{ {
// column / row layout may change with any document change, // column / row layout may change with any document change,
// so it must be invalidated // so it must be invalidated
DELETEZ( mpTableInfo ); mpTableInfo.reset();
} }
else if (nId == SfxHintId::ScAccVisAreaChanged) else if (nId == SfxHintId::ScAccVisAreaChanged)
{ {
@@ -637,7 +636,7 @@ void ScAccessiblePreviewTable::FillTableInfo() const
aOutputSize = pWindow->GetOutputSizePixel(); aOutputSize = pWindow->GetOutputSizePixel();
tools::Rectangle aVisRect( Point(), aOutputSize ); tools::Rectangle aVisRect( Point(), aOutputSize );
mpTableInfo = new ScPreviewTableInfo; mpTableInfo.reset( new ScPreviewTableInfo );
mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo ); mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
} }
} }

View File

@@ -124,7 +124,7 @@ protected:
private: private:
ScPreviewShell* mpViewShell; ScPreviewShell* mpViewShell;
sal_Int32 mnIndex; sal_Int32 mnIndex;
mutable ScPreviewTableInfo* mpTableInfo; mutable std::unique_ptr<ScPreviewTableInfo> mpTableInfo;
bool IsDefunc( bool IsDefunc(
const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates); const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);