[Libreoffice-commits] core.git: sw/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Mar 29 06:37:02 UTC 2018


 sw/source/core/doc/DocumentFieldsManager.cxx |    6 +++---
 sw/source/core/inc/DocumentFieldsManager.hxx |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit f36e3dc1a16b02aac07df4cf9fc35d488ba7c416
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 28 10:41:55 2018 +0200

    loplugin:useuniqueptr in DocumentFieldsManager
    
    Change-Id: I79d18cb8fdb029afbe6008edd058265b1503e5eb
    Reviewed-on: https://gerrit.libreoffice.org/52031
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index a8d78988346c..c261d9eee8a5 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -153,7 +153,7 @@ DocumentFieldsManager::DocumentFieldsManager( SwDoc& i_rSwdoc ) : m_rDoc( i_rSwd
 
 const SwFieldTypes* DocumentFieldsManager::GetFieldTypes() const
 {
-    return mpFieldTypes;
+    return mpFieldTypes.get();
 }
 
 /** Insert field types
@@ -1701,8 +1701,8 @@ void DocumentFieldsManager::UpdateDBNumFields( SwDBNameInfField& rDBField, SwCal
 
 DocumentFieldsManager::~DocumentFieldsManager()
 {
-    delete mpUpdateFields;
-    delete mpFieldTypes;
+    mpUpdateFields.reset();
+    mpFieldTypes.reset();
 }
 
 }
diff --git a/sw/source/core/inc/DocumentFieldsManager.hxx b/sw/source/core/inc/DocumentFieldsManager.hxx
index d87f848d34b5..0475eb345492 100644
--- a/sw/source/core/inc/DocumentFieldsManager.hxx
+++ b/sw/source/core/inc/DocumentFieldsManager.hxx
@@ -21,6 +21,7 @@
 
 #include <IDocumentFieldsAccess.hxx>
 #include <sal/types.h>
+#include <memory>
 
 class SwDoc;
 class SwDBNameInfField;
@@ -97,8 +98,8 @@ private:
     SwDoc& m_rDoc;
 
     bool mbNewFieldLst; //< TRUE: Rebuild field-list.
-    SwDocUpdateField    *mpUpdateFields; //< Struct for updating fields
-    SwFieldTypes      *mpFieldTypes;
+    std::unique_ptr<SwDocUpdateField> mpUpdateFields; //< Struct for updating fields
+    std::unique_ptr<SwFieldTypes>     mpFieldTypes;
     sal_Int8    mnLockExpField;  //< If != 0 UpdateExpFields() has no effect!
 };
 


More information about the Libreoffice-commits mailing list