loplugin:useuniqueptr in ScAccessibleDocumentPagePreview
Change-Id: I0b90d59e627691c6c187f34591992301102afcfe Reviewed-on: https://gerrit.libreoffice.org/56556 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1189,11 +1189,9 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
|
||||
|
||||
// no need to Dispose the AccessibleTextHelper,
|
||||
// as long as mpNotesChildren are destructed here
|
||||
if (mpNotesChildren)
|
||||
DELETEZ(mpNotesChildren);
|
||||
mpNotesChildren.reset();
|
||||
|
||||
if (mpShapeChildren)
|
||||
DELETEZ(mpShapeChildren);
|
||||
mpShapeChildren.reset();
|
||||
|
||||
ScAccessibleDocumentBase::disposing();
|
||||
}
|
||||
@@ -1541,7 +1539,7 @@ ScNotesChildren* ScAccessibleDocumentPagePreview::GetNotesChildren()
|
||||
{
|
||||
if (!mpNotesChildren && mpViewShell)
|
||||
{
|
||||
mpNotesChildren = new ScNotesChildren(mpViewShell, this);
|
||||
mpNotesChildren.reset( new ScNotesChildren(mpViewShell, this) );
|
||||
|
||||
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
|
||||
ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChildren(), GetShapeChildren() );
|
||||
@@ -1549,18 +1547,18 @@ ScNotesChildren* ScAccessibleDocumentPagePreview::GetNotesChildren()
|
||||
//! order is background shapes, header, table or notes, footer, foreground shapes, controls
|
||||
mpNotesChildren->Init(aCount.aVisRect, aCount.nBackShapes + aCount.nHeaders);
|
||||
}
|
||||
return mpNotesChildren;
|
||||
return mpNotesChildren.get();
|
||||
}
|
||||
|
||||
ScShapeChildren* ScAccessibleDocumentPagePreview::GetShapeChildren()
|
||||
{
|
||||
if (!mpShapeChildren && mpViewShell)
|
||||
{
|
||||
mpShapeChildren = new ScShapeChildren(mpViewShell, this);
|
||||
mpShapeChildren.reset( new ScShapeChildren(mpViewShell, this) );
|
||||
mpShapeChildren->Init();
|
||||
}
|
||||
|
||||
return mpShapeChildren;
|
||||
return mpShapeChildren.get();
|
||||
}
|
||||
|
||||
OUString ScAccessibleDocumentPagePreview::getAccessibleName()
|
||||
|
@@ -117,8 +117,8 @@ protected:
|
||||
|
||||
private:
|
||||
ScPreviewShell* mpViewShell;
|
||||
ScNotesChildren* mpNotesChildren;
|
||||
ScShapeChildren* mpShapeChildren;
|
||||
std::unique_ptr<ScNotesChildren> mpNotesChildren;
|
||||
std::unique_ptr<ScShapeChildren> mpShapeChildren;
|
||||
rtl::Reference<ScAccessiblePreviewTable> mpTable;
|
||||
rtl::Reference<ScAccessiblePageHeader> mpHeader;
|
||||
rtl::Reference<ScAccessiblePageHeader> mpFooter;
|
||||
|
Reference in New Issue
Block a user