diff options
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleDocumentPagePreview.hxx | 4 |
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; |