summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-27 11:30:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-28 08:33:00 +0200
commitf35ddce379cd6988af0b33abdff7ff343bd94049 (patch)
tree57a67a0bd61e7e5180b22e2603a292eaa9bb6e6e
parentb1b490ee356cf542e47065eb6795ed0b5e2f531b (diff)
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>
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx14
-rw-r--r--sc/source/ui/inc/AccessibleDocumentPagePreview.hxx4
2 files changed, 8 insertions, 10 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 96c0d8baed44..2c40ae3a7e06 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -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()
diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
index ff6d0981b69c..3532c36549de 100644
--- a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
+++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
@@ -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;