summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-28 10:41:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-29 08:36:36 +0200
commitf36e3dc1a16b02aac07df4cf9fc35d488ba7c416 (patch)
tree7c73f5fadd65a8fe1d6edccba37bc8e9653d1972
parentloplugin:useuniqueptr in DocumentDeviceManager (diff)
downloadcore-f36e3dc1a16b02aac07df4cf9fc35d488ba7c416.tar.gz
core-f36e3dc1a16b02aac07df4cf9fc35d488ba7c416.zip
loplugin:useuniqueptr in DocumentFieldsManager
Change-Id: I79d18cb8fdb029afbe6008edd058265b1503e5eb Reviewed-on: https://gerrit.libreoffice.org/52031 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx6
-rw-r--r--sw/source/core/inc/DocumentFieldsManager.hxx5
2 files changed, 6 insertions, 5 deletions
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!
};