summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-22 13:32:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-23 07:25:13 +0100
commit75bea88a78071ac4336d2593512e1dbf3a865876 (patch)
treead5e90bcef143d0a7bb3e675a748613ca1e99fe2
parent5053b8cd3f18cb5baa039c343e20b1b87e7b25a5 (diff)
loplugin:useuniqueptr in DocumentChartDataProviderManager
Change-Id: I4b6c5996bbf0be3998925655a44ba02bc197607e Reviewed-on: https://gerrit.libreoffice.org/51739 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/doc/DocumentChartDataProviderManager.cxx3
-rw-r--r--sw/source/core/inc/DocumentChartDataProviderManager.hxx6
2 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/doc/DocumentChartDataProviderManager.cxx b/sw/source/core/doc/DocumentChartDataProviderManager.cxx
index 7f11c2c3e1d0..4ef6ce2c7861 100644
--- a/sw/source/core/doc/DocumentChartDataProviderManager.cxx
+++ b/sw/source/core/doc/DocumentChartDataProviderManager.cxx
@@ -88,7 +88,7 @@ SwChartLockController_Helper & DocumentChartDataProviderManager::GetChartControl
{
if (!mpChartControllerHelper)
{
- mpChartControllerHelper = new SwChartLockController_Helper( & m_rDoc );
+ mpChartControllerHelper.reset(new SwChartLockController_Helper( & m_rDoc ));
}
return *mpChartControllerHelper;
}
@@ -100,7 +100,6 @@ DocumentChartDataProviderManager::~DocumentChartDataProviderManager()
// since all UNO API related functionality requires an existing SwDocShell
// this assures that dispose gets called if there is need for it.
maChartDataProviderImplRef.clear();
- delete mpChartControllerHelper;
}
}
diff --git a/sw/source/core/inc/DocumentChartDataProviderManager.hxx b/sw/source/core/inc/DocumentChartDataProviderManager.hxx
index 916a78ef046e..a30194473ec5 100644
--- a/sw/source/core/inc/DocumentChartDataProviderManager.hxx
+++ b/sw/source/core/inc/DocumentChartDataProviderManager.hxx
@@ -21,8 +21,8 @@
#define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTCHARTDATAPROVIDEMANAGER_HXX
#include <IDocumentChartDataProviderAccess.hxx>
-
#include <rtl/ref.hxx>
+#include <memory>
namespace com { namespace sun { namespace star { namespace frame {
class XModel;
@@ -58,8 +58,8 @@ private:
SwDoc& m_rDoc;
- mutable rtl::Reference<SwChartDataProvider> maChartDataProviderImplRef;
- SwChartLockController_Helper *mpChartControllerHelper;
+mutable rtl::Reference<SwChartDataProvider> maChartDataProviderImplRef;
+ std::unique_ptr<SwChartLockController_Helper> mpChartControllerHelper;
};
}