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

Arnold Dumas arnold at dumas.at
Thu Aug 25 06:54:15 UTC 2016


 xmloff/source/forms/officeforms.cxx |    3 +--
 xmloff/source/forms/officeforms.hxx |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 89d3482b7a80c6fd508cf3954b7c52608445eae0
Author: Arnold Dumas <arnold at dumas.at>
Date:   Wed Aug 24 22:39:10 2016 +0200

    tdf#89329: use unique_ptr for pImpl in officeforms
    
    Change-Id: Icdf742cbdbecab11be6a3fdd4387ade1c8fd7c15
    Reviewed-on: https://gerrit.libreoffice.org/28368
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/xmloff/source/forms/officeforms.cxx b/xmloff/source/forms/officeforms.cxx
index bf27267..74a37ac 100644
--- a/xmloff/source/forms/officeforms.cxx
+++ b/xmloff/source/forms/officeforms.cxx
@@ -121,12 +121,11 @@ namespace xmloff
     {
         addModelAttributes(_rExp);
 
-        m_pImplElement = new SvXMLElementExport(_rExp, XML_NAMESPACE_OFFICE, XML_FORMS, true, true);
+        m_pImplElement.reset( new SvXMLElementExport(_rExp, XML_NAMESPACE_OFFICE, XML_FORMS, true, true) );
     }
 
     OFormsRootExport::~OFormsRootExport( )
     {
-        delete m_pImplElement;
     }
 
     void OFormsRootExport::implExportBool(SvXMLExport& _rExp, OfficeFormsAttributes _eAttribute,
diff --git a/xmloff/source/forms/officeforms.hxx b/xmloff/source/forms/officeforms.hxx
index 4c478ac..fbf5c70 100644
--- a/xmloff/source/forms/officeforms.hxx
+++ b/xmloff/source/forms/officeforms.hxx
@@ -22,6 +22,7 @@
 
 #include "formattributes.hxx"
 #include <xmloff/xmlictxt.hxx>
+#include <memory>
 #include "logging.hxx"
 
 class SvXMLElementExport;
@@ -61,7 +62,7 @@ namespace xmloff
     class OFormsRootExport
     {
     private:
-        SvXMLElementExport*     m_pImplElement;
+        std::unique_ptr<SvXMLElementExport>     m_pImplElement;
 
     public:
         explicit OFormsRootExport( SvXMLExport& _rExp );


More information about the Libreoffice-commits mailing list