diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-28 10:41:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-29 08:36:36 +0200 |
commit | f36e3dc1a16b02aac07df4cf9fc35d488ba7c416 (patch) | |
tree | 7c73f5fadd65a8fe1d6edccba37bc8e9653d1972 /sw | |
parent | e014ca57fdd40d4e6486cc105d3bb2b32b060b1a (diff) |
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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentFieldsManager.hxx | 5 |
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! }; |