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.gran...@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 <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@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! }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits