[Libreoffice-commits] core.git: sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Mar 23 06:25:38 UTC 2018
sw/source/core/doc/DocumentChartDataProviderManager.cxx | 3 +--
sw/source/core/inc/DocumentChartDataProviderManager.hxx | 6 +++---
2 files changed, 4 insertions(+), 5 deletions(-)
New commits:
commit 75bea88a78071ac4336d2593512e1dbf3a865876
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Mar 22 13:32:56 2018 +0200
loplugin:useuniqueptr in DocumentChartDataProviderManager
Change-Id: I4b6c5996bbf0be3998925655a44ba02bc197607e
Reviewed-on: https://gerrit.libreoffice.org/51739
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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;
};
}
More information about the Libreoffice-commits
mailing list