summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-21 16:38:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-28 08:49:33 +0200
commit7f664b591fb9b82569885f8f243e2822fde3a0ae (patch)
tree38856b455f48d9be86ceb82dbe643e8f9036b96f /sd
parentf59d33a5302f20f98b0596c284116d1e30a17bd6 (diff)
loplugin:useuniqueptr in AccessibleDrawDocumentView
Change-Id: Ibec6b19e83a3c29299382c398ca6a40b92377ede Reviewed-on: https://gerrit.libreoffice.org/54860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx18
-rw-r--r--sd/source/ui/inc/AccessibleDrawDocumentView.hxx2
2 files changed, 5 insertions, 15 deletions
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 7899d7e03fa1..355c579d96ce 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -106,7 +106,7 @@ void AccessibleDrawDocumentView::Init()
xShapeList.set( xView->getCurrentPage(), uno::UNO_QUERY);
// Create the children manager.
- mpChildrenManager = new ChildrenManager(this, xShapeList, maShapeTreeInfo, *this);
+ mpChildrenManager.reset(new ChildrenManager(this, xShapeList, maShapeTreeInfo, *this));
rtl::Reference<AccessiblePageShape> xPage(CreateDrawPageShape());
if (xPage.is())
@@ -214,7 +214,7 @@ uno::Reference<XAccessible> SAL_CALL
// Create a copy of the pointer to the children manager and release the
// mutex before calling any of its methods.
- ChildrenManager* pChildrenManager = mpChildrenManager;
+ ChildrenManager* pChildrenManager = mpChildrenManager.get();
aGuard.clear();
// Forward request to children manager.
@@ -730,12 +730,7 @@ void AccessibleDrawDocumentView::Deactivated()
void AccessibleDrawDocumentView::impl_dispose()
{
- if (mpChildrenManager != nullptr)
- {
- delete mpChildrenManager;
- mpChildrenManager = nullptr;
- }
-
+ mpChildrenManager.reset();
AccessibleDocumentViewBase::impl_dispose();
}
@@ -744,13 +739,8 @@ void AccessibleDrawDocumentView::impl_dispose()
*/
void SAL_CALL AccessibleDrawDocumentView::disposing()
{
-
// Release resources.
- if (mpChildrenManager != nullptr)
- {
- delete mpChildrenManager;
- mpChildrenManager = nullptr;
- }
+ mpChildrenManager.reset();
// Forward call to base classes.
AccessibleDocumentViewBase::disposing ();
diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
index df03a3eee460..90a64a822967 100644
--- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
+++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
@@ -129,7 +129,7 @@ private:
responsible to determine the visible shapes and create on demand the
accessible objects representing them.
*/
- ChildrenManager* mpChildrenManager;
+ std::unique_ptr<ChildrenManager> mpChildrenManager;
// This method is called from the component helper base class while
// disposing.