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

Noel Grandin noel at peralex.com
Mon Nov 16 22:24:06 PST 2015


 include/xmloff/SchXMLExportHelper.hxx   |    3 ++-
 include/xmloff/animationexport.hxx      |    3 ++-
 include/xmloff/animexp.hxx              |    3 ++-
 include/xmloff/attrlist.hxx             |    3 ++-
 include/xmloff/formlayerexport.hxx      |    5 +++--
 include/xmloff/formlayerimport.hxx      |    3 ++-
 include/xmloff/prhdlfac.hxx             |    3 ++-
 include/xmloff/shapeimport.hxx          |    3 ++-
 include/xmloff/xmlaustp.hxx             |    3 ++-
 include/xmloff/xmlexp.hxx               |    3 ++-
 include/xmloff/xmlexppr.hxx             |    3 ++-
 include/xmloff/xmlimp.hxx               |    3 ++-
 include/xmloff/xmlprmap.hxx             |    3 ++-
 include/xmloff/xmlstyle.hxx             |    3 ++-
 include/xmloff/xmltkmap.hxx             |    3 ++-
 xmloff/source/chart/SchXMLExport.cxx    |    1 -
 xmloff/source/core/attrlist.cxx         |    9 ++++-----
 xmloff/source/core/xmlexp.cxx           |    2 --
 xmloff/source/core/xmlimp.cxx           |    2 --
 xmloff/source/core/xmltkmap.cxx         |   29 +++++++++--------------------
 xmloff/source/draw/animationexport.cxx  |    3 +--
 xmloff/source/draw/animexp.cxx          |    4 +---
 xmloff/source/draw/shapeimport.cxx      |    6 ++----
 xmloff/source/draw/ximpshow.cxx         |    6 ++----
 xmloff/source/draw/ximpshow.hxx         |    3 ++-
 xmloff/source/forms/formlayerexport.cxx |    6 +-----
 xmloff/source/forms/formlayerimport.cxx |    4 +---
 xmloff/source/forms/layerimport.hxx     |    2 +-
 xmloff/source/style/prhdlfac.cxx        |    2 --
 xmloff/source/style/xmlaustp.cxx        |    3 +--
 xmloff/source/style/xmlexppr.cxx        |    1 -
 xmloff/source/style/xmlprmap.cxx        |    1 -
 xmloff/source/style/xmlstyle.cxx        |    1 -
 xmloff/source/text/txtprhdl.cxx         |    1 -
 xmloff/source/text/txtprhdl.hxx         |    3 ++-
 35 files changed, 58 insertions(+), 78 deletions(-)

New commits:
commit e1d88a574562b5c36b01eafdaa0670e5cc1a7c39
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Nov 17 08:03:48 2015 +0200

    use unique_ptr for pImpl's in xmloff/
    
    Change-Id: Ib95118941938af83fed566a085837e17f092017a

diff --git a/include/xmloff/SchXMLExportHelper.hxx b/include/xmloff/SchXMLExportHelper.hxx
index 36f8d40..dae6f7f 100644
--- a/include/xmloff/SchXMLExportHelper.hxx
+++ b/include/xmloff/SchXMLExportHelper.hxx
@@ -31,6 +31,7 @@
 
 #include <queue>
 #include <vector>
+#include <memory>
 
 class SvXMLAutoStylePoolP;
 class SvXMLExport;
@@ -60,7 +61,7 @@ private:
     void operator =(SchXMLExportHelper &) = delete;
 
 private:
-    SchXMLExportHelper_Impl* m_pImpl;
+    std::unique_ptr<SchXMLExportHelper_Impl> m_pImpl;
     friend class SchXMLExport;
 };
 
diff --git a/include/xmloff/animationexport.hxx b/include/xmloff/animationexport.hxx
index 4142910..d07678f 100644
--- a/include/xmloff/animationexport.hxx
+++ b/include/xmloff/animationexport.hxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/animations/XAnimationNode.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <salhelper/simplereferenceobject.hxx>
+#include <memory>
 
 class SvXMLExport;
 
@@ -36,7 +37,7 @@ class AnimationsExporterImpl;
 
 class XMLOFF_DLLPUBLIC AnimationsExporter : public salhelper::SimpleReferenceObject
 {
-    AnimationsExporterImpl*	mpImpl;
+    std::unique_ptr<AnimationsExporterImpl>  mpImpl;
 
 public:
     AnimationsExporter( SvXMLExport& rExport, const css::uno::Reference< css::beans::XPropertySet >& xPageProps  );
diff --git a/include/xmloff/animexp.hxx b/include/xmloff/animexp.hxx
index 3b44a18..7276b47 100644
--- a/include/xmloff/animexp.hxx
+++ b/include/xmloff/animexp.hxx
@@ -22,6 +22,7 @@
 
 #include <com/sun/star/drawing/XShape.hpp>
 #include <salhelper/simplereferenceobject.hxx>
+#include <memory>
 
 class AnimExpImpl;
 class SvXMLExport;
@@ -29,7 +30,7 @@ class XMLShapeExport;
 
 class XMLAnimationsExporter : public salhelper::SimpleReferenceObject
 {
-    AnimExpImpl*    mpImpl;
+    std::unique_ptr<AnimExpImpl> mpImpl;
 
 public:
     XMLAnimationsExporter( XMLShapeExport* pShapeExp );
diff --git a/include/xmloff/attrlist.hxx b/include/xmloff/attrlist.hxx
index 6eca0ce..55e3e4e 100644
--- a/include/xmloff/attrlist.hxx
+++ b/include/xmloff/attrlist.hxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 
 #include <cppuhelper/implbase3.hxx>
+#include <memory>
 
 struct SvXMLAttributeList_Impl;
 
@@ -40,7 +41,7 @@ class XMLOFF_DLLPUBLIC SvXMLAttributeList : public ::cppu::WeakImplHelper3<
         css::util::XCloneable,
         css::lang::XUnoTunnel>
 {
-    SvXMLAttributeList_Impl *m_pImpl;
+    std::unique_ptr<SvXMLAttributeList_Impl> m_pImpl;
 
 public:
     SvXMLAttributeList();
diff --git a/include/xmloff/formlayerexport.hxx b/include/xmloff/formlayerexport.hxx
index 1aeb85b..d3c7e14 100644
--- a/include/xmloff/formlayerexport.hxx
+++ b/include/xmloff/formlayerexport.hxx
@@ -29,6 +29,7 @@
 #include <rtl/ref.hxx>
 #include <salhelper/simplereferenceobject.hxx>
 #include <xmloff/xmlexppr.hxx>
+#include <memory>
 
 namespace com { namespace sun { namespace star { namespace awt {
     class XControlModel;
@@ -55,7 +56,7 @@ namespace xmloff
         /// our export context
         SvXMLExport&                m_rContext;
         // impl class
-        OFormLayerXMLExport_Impl*   m_pImpl;
+        std::unique_ptr<OFormLayerXMLExport_Impl> m_pImpl;
 
     protected:
         virtual ~OFormLayerXMLExport();
@@ -173,7 +174,7 @@ namespace xmloff
     class XMLOFF_DLLPUBLIC OOfficeFormsExport
     {
     private:
-        OFormsRootExport*   m_pImpl;
+        std::unique_ptr<OFormsRootExport>  m_pImpl;
 
     public:
         OOfficeFormsExport( SvXMLExport& _rExp );
diff --git a/include/xmloff/formlayerimport.hxx b/include/xmloff/formlayerimport.hxx
index 344bd4f..8b4ea5c 100644
--- a/include/xmloff/formlayerimport.hxx
+++ b/include/xmloff/formlayerimport.hxx
@@ -28,6 +28,7 @@
 #include <rtl/ref.hxx>
 #include <salhelper/simplereferenceobject.hxx>
 #include <xmloff/xmlimppr.hxx>
+#include <memory>
 
 class SvXMLImport;
 class SvXMLImportContext;
@@ -48,7 +49,7 @@ namespace xmloff
     class XMLOFF_DLLPUBLIC OFormLayerXMLImport
                 :public ::salhelper::SimpleReferenceObject
     {
-        OFormLayerXMLImport_Impl*   m_pImpl;
+        std::unique_ptr<OFormLayerXMLImport_Impl>   m_pImpl;
 
     public:
         OFormLayerXMLImport(SvXMLImport& _rImporter);
diff --git a/include/xmloff/prhdlfac.hxx b/include/xmloff/prhdlfac.hxx
index 515a69c..84827d6 100644
--- a/include/xmloff/prhdlfac.hxx
+++ b/include/xmloff/prhdlfac.hxx
@@ -24,6 +24,7 @@
 #include <sal/types.h>
 
 #include <salhelper/simplereferenceobject.hxx>
+#include <memory>
 
 class XMLPropertyHandler;
 
@@ -39,7 +40,7 @@ class XMLPropertyHandler;
 class XMLOFF_DLLPUBLIC XMLPropertyHandlerFactory : public salhelper::SimpleReferenceObject
 {
     struct Impl;
-    Impl* mpImpl;
+    std::unique_ptr<Impl> mpImpl;
 
     XMLPropertyHandlerFactory( const XMLPropertyHandlerFactory& ) = delete;
     XMLPropertyHandlerFactory& operator= ( const XMLPropertyHandlerFactory& ) = delete;
diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx
index 9ced9eb..b347ec4 100644
--- a/include/xmloff/shapeimport.hxx
+++ b/include/xmloff/shapeimport.hxx
@@ -35,6 +35,7 @@
 #include <xmloff/table/XMLTableImport.hxx>
 #include <basegfx/vector/b3dvector.hxx>
 #include <vector>
+#include <memory>
 
 class SvXMLImport;
 class SvXMLImportContext;
@@ -268,7 +269,7 @@ struct XMLShapeImportPageContextImpl;
 
 class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public salhelper::SimpleReferenceObject
 {
-    XMLShapeImportHelperImpl*   mpImpl;
+    std::unique_ptr<XMLShapeImportHelperImpl> mpImpl;
 
     XMLShapeImportPageContextImpl*  mpPageContext;
 
diff --git a/include/xmloff/xmlaustp.hxx b/include/xmloff/xmlaustp.hxx
index d7e8f4a..ac03690 100644
--- a/include/xmloff/xmlaustp.hxx
+++ b/include/xmloff/xmlaustp.hxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <xmloff/xmlprmap.hxx>
 #include <salhelper/simplereferenceobject.hxx>
+#include <memory>
 
 class SvXMLExportPropertyMapper;
 class SvXMLNamespaceMap;
@@ -40,7 +41,7 @@ class XMLOFF_DLLPUBLIC SvXMLAutoStylePoolP : public salhelper::SimpleReferenceOb
     friend class Test;
     friend class SvXMLAutoStylePoolP_Impl;
 
-    SvXMLAutoStylePoolP_Impl    *pImpl;
+    std::unique_ptr<SvXMLAutoStylePoolP_Impl>    pImpl;
 
 protected:
 
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index fbf4a19..4c4e9ef 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -61,6 +61,7 @@
 #include <tools/fldunit.hxx>
 
 #include <list>
+#include <memory>
 #include <o3tl/typed_flags_set.hxx>
 
 class SvXMLNamespaceMap;
@@ -115,7 +116,7 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
              css::container::XNamed,
              css::lang::XUnoTunnel>
 {
-    SvXMLExport_Impl            *mpImpl;            // dummy
+    std::unique_ptr<SvXMLExport_Impl>            mpImpl;            // dummy
 
     css::uno::Reference< css::uno::XComponentContext > m_xContext;
     OUString m_implementationName;
diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx
index 78f0678..ad990e1 100644
--- a/include/xmloff/xmlexppr.hxx
+++ b/include/xmloff/xmlexppr.hxx
@@ -28,6 +28,7 @@
 #include <o3tl/typed_flags_set.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <memory>
 
 enum class SvXmlExportFlags {
     NONE        = 0x0000,
@@ -52,7 +53,7 @@ class SvXMLExport;
 class XMLOFF_DLLPUBLIC SvXMLExportPropertyMapper : public salhelper::SimpleReferenceObject
 {
     struct Impl;
-    Impl* mpImpl;
+    std::unique_ptr<Impl> mpImpl;
 
 protected:
 
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 353b0ac..7da065e 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -57,6 +57,7 @@
 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
 #include <com/sun/star/xml/sax/XFastAttributeList.hpp>
 #include <o3tl/typed_flags_set.hxx>
+#include <memory>
 
 namespace com { namespace sun { namespace star {
     namespace frame { class XModel; }
@@ -140,7 +141,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7<
     css::uno::Reference< css::container::XNameContainer > mxNumberStyles;
     css::uno::Reference< css::lang::XEventListener > mxEventListener;
 
-    SvXMLImport_Impl            *mpImpl;            // dummy
+    std::unique_ptr<SvXMLImport_Impl>  mpImpl;            // dummy
 
     SvXMLNamespaceMap           *mpNamespaceMap;
     SvXMLUnitConverter          *mpUnitConv;
diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx
index 7fc7a72..a0793c8 100644
--- a/include/xmloff/xmlprmap.hxx
+++ b/include/xmloff/xmlprmap.hxx
@@ -26,6 +26,7 @@
 #include <rtl/ustring.hxx>
 
 #include <salhelper/simplereferenceobject.hxx>
+#include <memory>
 
 class SvXMLUnitConverter;
 class XMLPropertyHandler;
@@ -37,7 +38,7 @@ class XMLOFF_DLLPUBLIC XMLPropertySetMapper : public salhelper::SimpleReferenceO
 {
     struct Impl;
 
-    Impl* mpImpl;
+    std::unique_ptr<Impl> mpImpl;
 
     XMLPropertySetMapper( const XMLPropertySetMapper& ) = delete;
     XMLPropertySetMapper& operator= ( const XMLPropertySetMapper& ) = delete;
diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx
index 658cce3..a73a24f 100644
--- a/include/xmloff/xmlstyle.hxx
+++ b/include/xmloff/xmlstyle.hxx
@@ -27,6 +27,7 @@
 #include <rsc/rscsfx.hxx>
 #include <xmloff/xmltkmap.hxx>
 #include <xmloff/xmlictxt.hxx>
+#include <memory>
 
 class SvXMLStylesContext_Impl;
 class SvXMLUnitConverter;
@@ -154,7 +155,7 @@ class XMLOFF_DLLPUBLIC SvXMLStylesContext : public SvXMLImportContext
     const OUString msParaStyleServiceName;
     const OUString msTextStyleServiceName;
 
-    SvXMLStylesContext_Impl *mpImpl;
+    std::unique_ptr<SvXMLStylesContext_Impl> mpImpl;
     SvXMLTokenMap           *mpStyleStylesElemTokenMap;
 
 
diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx
index d0f2288..4cf6403 100644
--- a/include/xmloff/xmltkmap.hxx
+++ b/include/xmloff/xmltkmap.hxx
@@ -24,6 +24,7 @@
 #include <xmloff/dllapi.h>
 #include <sal/types.h>
 #include <xmloff/xmltoken.hxx>
+#include <memory>
 
 
 class SvXMLTokenMap_Impl;
@@ -40,7 +41,7 @@ struct SvXMLTokenMapEntry
 
 class XMLOFF_DLLPUBLIC SvXMLTokenMap
 {
-    SvXMLTokenMap_Impl      *m_pImpl;
+    std::unique_ptr<SvXMLTokenMap_Impl>  m_pImpl;
 
 public:
 
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 74a2ee3..13a13da 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -986,7 +986,6 @@ SchXMLExportHelper::SchXMLExportHelper( SvXMLExport& rExport, SvXMLAutoStylePool
 
 SchXMLExportHelper::~SchXMLExportHelper()
 {
-    delete m_pImpl;
 }
 
 const OUString& SchXMLExportHelper::getChartCLSID()
diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx
index f28a75c..6be5a3c 100644
--- a/xmloff/source/core/attrlist.cxx
+++ b/xmloff/source/core/attrlist.cxx
@@ -84,9 +84,9 @@ SvXMLAttributeList::SvXMLAttributeList( const SvXMLAttributeList &r ) :
 
 SvXMLAttributeList::SvXMLAttributeList( const uno::Reference<
         xml::sax::XAttributeList> & rAttrList )
-    : sType( GetXMLToken(XML_CDATA) )
+    : m_pImpl( new SvXMLAttributeList_Impl),
+      sType( GetXMLToken(XML_CDATA) )
 {
-    m_pImpl = new SvXMLAttributeList_Impl;
 
     SvXMLAttributeList* pImpl =
         SvXMLAttributeList::getImplementation( rAttrList );
@@ -139,16 +139,15 @@ uno::Reference< ::com::sun::star::util::XCloneable >  SvXMLAttributeList::create
 
 
 SvXMLAttributeList::SvXMLAttributeList()
-    : sType( GetXMLToken(XML_CDATA) )
+    : m_pImpl( new SvXMLAttributeList_Impl ),
+      sType( GetXMLToken(XML_CDATA) )
 {
-    m_pImpl = new SvXMLAttributeList_Impl;
 }
 
 
 
 SvXMLAttributeList::~SvXMLAttributeList()
 {
-    delete m_pImpl;
 }
 
 
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 877afda..1da587b 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -591,8 +591,6 @@ SvXMLExport::~SvXMLExport()
 
     if (mxEventListener.is() && mxModel.is())
         mxModel->removeEventListener(mxEventListener);
-
-    delete mpImpl;
 }
 
 // XExporter
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index e34de76..53adae8 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -464,8 +464,6 @@ SvXMLImport::~SvXMLImport() throw ()
     delete mpNumImport;
     delete mpProgressBarHelper;
 
-    delete mpImpl;
-
     if (mxEventListener.is() && mxModel.is())
         mxModel->removeEventListener(mxEventListener);
 }
diff --git a/xmloff/source/core/xmltkmap.cxx b/xmloff/source/core/xmltkmap.cxx
index 361cbf6..1b5810f 100644
--- a/xmloff/source/core/xmltkmap.cxx
+++ b/xmloff/source/core/xmltkmap.cxx
@@ -58,23 +58,6 @@ public:
 
 class SvXMLTokenMap_Impl : public std::set<SvXMLTokenMapEntry_Impl> {};
 
-SvXMLTokenMapEntry_Impl const* lcl_Find(
-        SvXMLTokenMap_Impl const* pImpl,
-        sal_uInt16 nKeyPrefix,
-        const OUString& rLName )
-{
-    SvXMLTokenMapEntry_Impl const* pRet = nullptr;
-    SvXMLTokenMapEntry_Impl aTst( nKeyPrefix, rLName );
-
-    SvXMLTokenMap_Impl::iterator it = pImpl->find( aTst );
-    if (it != pImpl->end())
-    {
-        pRet = &*it;
-    }
-
-    return pRet;
-}
-
 SvXMLTokenMap::SvXMLTokenMap( const SvXMLTokenMapEntry *pMap )
     : m_pImpl( new SvXMLTokenMap_Impl )
 {
@@ -87,14 +70,20 @@ SvXMLTokenMap::SvXMLTokenMap( const SvXMLTokenMapEntry *pMap )
 
 SvXMLTokenMap::~SvXMLTokenMap()
 {
-    delete m_pImpl;
 }
 
 sal_uInt16 SvXMLTokenMap::Get( sal_uInt16 nKeyPrefix,
                                const OUString& rLName ) const
 {
-    SvXMLTokenMapEntry_Impl const*const pEntry(
-            lcl_Find(m_pImpl, nKeyPrefix, rLName));
+    SvXMLTokenMapEntry_Impl const* pEntry = nullptr;
+    SvXMLTokenMapEntry_Impl aTst( nKeyPrefix, rLName );
+
+    SvXMLTokenMap_Impl::iterator it = m_pImpl->find( aTst );
+    if (it != m_pImpl->end())
+    {
+        pEntry = &*it;
+    }
+
     if( pEntry )
         return pEntry->GetToken();
     else
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 547bd69..f911e67 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1674,13 +1674,12 @@ void AnimationsExporterImpl::prepareValue( const Any& rValue )
 }
 
 AnimationsExporter::AnimationsExporter( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps )
+    : mpImpl( new AnimationsExporterImpl( rExport, xPageProps ) )
 {
-    mpImpl = new AnimationsExporterImpl( rExport, xPageProps );
 }
 
 AnimationsExporter::~AnimationsExporter()
 {
-    delete mpImpl;
 }
 
 void AnimationsExporter::prepare( Reference< XAnimationNode > xRootNode )
diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx
index 13d665a..bf4d60f 100644
--- a/xmloff/source/draw/animexp.cxx
+++ b/xmloff/source/draw/animexp.cxx
@@ -257,15 +257,13 @@ public:
 };
 
 XMLAnimationsExporter::XMLAnimationsExporter( XMLShapeExport* pShapeExp )
+    : mpImpl( new AnimExpImpl )
 {
-    mpImpl = new AnimExpImpl;
     mpImpl->mxShapeExp = pShapeExp;
 }
 
 XMLAnimationsExporter::~XMLAnimationsExporter()
 {
-    delete mpImpl;
-    mpImpl = nullptr;
 }
 
 void XMLAnimationsExporter::prepare( Reference< XShape > xShape, SvXMLExport& )
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 688d8c6..2000a4c 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -111,7 +111,8 @@ XMLShapeImportHelper::XMLShapeImportHelper(
         SvXMLImport& rImporter,
         const uno::Reference< frame::XModel>& rModel,
         SvXMLImportPropertyMapper *pExtMapper )
-:   mpPageContext(nullptr),
+:   mpImpl( new XMLShapeImportHelperImpl() ),
+    mpPageContext(nullptr),
     mxModel(rModel),
 
     mpPropertySetMapper(nullptr),
@@ -136,7 +137,6 @@ XMLShapeImportHelper::XMLShapeImportHelper(
 
     mrImporter( rImporter )
 {
-    mpImpl = new XMLShapeImportHelperImpl();
     mpImpl->mpSortContext = nullptr;
 
     // #88546# init to sal_False
@@ -224,8 +224,6 @@ XMLShapeImportHelper::~XMLShapeImportHelper()
         mpAutoStylesContext->Clear();
         mpAutoStylesContext->ReleaseRef();
     }
-
-    delete mpImpl;
 }
 
 const SvXMLTokenMap& XMLShapeImportHelper::GetGroupShapeElemTokenMap()
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx
index 4175ff7..baa9eb0 100644
--- a/xmloff/source/draw/ximpshow.cxx
+++ b/xmloff/source/draw/ximpshow.cxx
@@ -63,9 +63,9 @@ public:
 
 
 SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport,  sal_uInt16 nPrfx, const OUString& rLocalName,  const Reference< XAttributeList >& xAttrList )
-:   SvXMLImportContext(rImport, nPrfx, rLocalName)
+:   SvXMLImportContext(rImport, nPrfx, rLocalName),
+    mpImpl(new ShowsImpImpl( rImport ) )
 {
-    mpImpl = new ShowsImpImpl( rImport );
 
     Reference< XCustomPresentationSupplier > xShowsSupplier( rImport.GetModel(), UNO_QUERY );
     if( xShowsSupplier.is() )
@@ -186,8 +186,6 @@ SdXMLShowsContext::~SdXMLShowsContext()
         aAny <<= mpImpl->maCustomShowName;
         mpImpl->mxPresProps->setPropertyValue("CustomShow", aAny );
     }
-
-    delete mpImpl;
 }
 
 SvXMLImportContext * SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList )
diff --git a/xmloff/source/draw/ximpshow.hxx b/xmloff/source/draw/ximpshow.hxx
index 0eb6c9a..c186206 100644
--- a/xmloff/source/draw/ximpshow.hxx
+++ b/xmloff/source/draw/ximpshow.hxx
@@ -22,6 +22,7 @@
 
 #include <xmloff/xmlictxt.hxx>
 #include "sdxmlimp_impl.hxx"
+#include <memory>
 
 class ShowsImpImpl;
 
@@ -29,7 +30,7 @@ class ShowsImpImpl;
 
 class SdXMLShowsContext : public SvXMLImportContext
 {
-    ShowsImpImpl*   mpImpl;
+    std::unique_ptr<ShowsImpImpl>   mpImpl;
 
 public:
 
diff --git a/xmloff/source/forms/formlayerexport.cxx b/xmloff/source/forms/formlayerexport.cxx
index 5a632c3..69c5d42 100644
--- a/xmloff/source/forms/formlayerexport.cxx
+++ b/xmloff/source/forms/formlayerexport.cxx
@@ -50,8 +50,6 @@ namespace xmloff
 
     OFormLayerXMLExport::~OFormLayerXMLExport()
     {
-        delete m_pImpl;
-        m_pImpl = nullptr;
     }
 
     bool OFormLayerXMLExport::seekPage(const Reference< XDrawPage >& _rxDrawPage)
@@ -118,14 +116,12 @@ namespace xmloff
 
     //= OOfficeFormsExport
     OOfficeFormsExport::OOfficeFormsExport( SvXMLExport& _rExp )
-        :m_pImpl(nullptr)
+        :m_pImpl( new OFormsRootExport(_rExp) )
     {
-        m_pImpl = new OFormsRootExport(_rExp);
     }
 
     OOfficeFormsExport::~OOfficeFormsExport()
     {
-        delete m_pImpl;
     }
 
 }   // namespace xmloff
diff --git a/xmloff/source/forms/formlayerimport.cxx b/xmloff/source/forms/formlayerimport.cxx
index 00d64a0..118317d 100644
--- a/xmloff/source/forms/formlayerimport.cxx
+++ b/xmloff/source/forms/formlayerimport.cxx
@@ -33,14 +33,12 @@ namespace xmloff
     //= OFormLayerXMLExport
 
     OFormLayerXMLImport::OFormLayerXMLImport(SvXMLImport& _rImporter)
-        :m_pImpl(nullptr)
+        : m_pImpl( new OFormLayerXMLImport_Impl(_rImporter) )
     {
-        m_pImpl = new OFormLayerXMLImport_Impl(_rImporter);
     }
 
     OFormLayerXMLImport::~OFormLayerXMLImport()
     {
-        delete m_pImpl;
     }
 
     void OFormLayerXMLImport::setAutoStyleContext(SvXMLStylesContext* _pNewContext)
diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx
index 3cbcb79..641380c 100644
--- a/xmloff/source/forms/layerimport.hxx
+++ b/xmloff/source/forms/layerimport.hxx
@@ -129,9 +129,9 @@ namespace xmloff
             const OUString& _rSubmissionID
         );
 
+        virtual ~OFormLayerXMLImport_Impl();
     protected:
         explicit OFormLayerXMLImport_Impl(SvXMLImport& _rImporter);
-        virtual ~OFormLayerXMLImport_Impl();
 
         /** start importing the forms of the given page
         */
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 888983c..991ae88 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -112,8 +112,6 @@ XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory()
 {
     for( CacheMap::iterator pPos = mpImpl->maHandlerCache.begin(); pPos != mpImpl->maHandlerCache.end(); ++pPos )
         delete pPos->second;
-
-    delete mpImpl;
 }
 
 // Interface
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 46d2d47..c5d0cbc 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -262,13 +262,12 @@ void SvXMLAutoStylePoolP::exportStyleContent(
 }
 
 SvXMLAutoStylePoolP::SvXMLAutoStylePoolP( SvXMLExport& rExport )
+    : pImpl( new SvXMLAutoStylePoolP_Impl( rExport ) )
 {
-    pImpl = new SvXMLAutoStylePoolP_Impl( rExport );
 }
 
 SvXMLAutoStylePoolP::~SvXMLAutoStylePoolP()
 {
-    delete pImpl;
 }
 
 SvXMLExport& SvXMLAutoStylePoolP::GetExport() const
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index e03c6e4..a204b3e 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -537,7 +537,6 @@ SvXMLExportPropertyMapper::SvXMLExportPropertyMapper(
 
 SvXMLExportPropertyMapper::~SvXMLExportPropertyMapper()
 {
-    delete mpImpl;
 }
 
 void SvXMLExportPropertyMapper::ChainExportMapper(
diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index c340d2c..7c3cdaf 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -150,7 +150,6 @@ XMLPropertySetMapper::XMLPropertySetMapper(
 
 XMLPropertySetMapper::~XMLPropertySetMapper()
 {
-    delete mpImpl;
 }
 
 void XMLPropertySetMapper::AddMapperEntry(
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 9327778..47881cc 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -787,7 +787,6 @@ SvXMLStylesContext::SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
 SvXMLStylesContext::~SvXMLStylesContext()
 {
     delete mpStyleStylesElemTokenMap;
-    delete mpImpl;
 }
 
 SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 8b54a25..e3430fe 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -1448,7 +1448,6 @@ XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
 
 XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
 {
-    delete pImpl;
 }
 
 const XMLPropertyHandler *XMLTextPropertyHandlerFactory::GetPropertyHandler(
diff --git a/xmloff/source/text/txtprhdl.hxx b/xmloff/source/text/txtprhdl.hxx
index 0a04296..78aaa95 100644
--- a/xmloff/source/text/txtprhdl.hxx
+++ b/xmloff/source/text/txtprhdl.hxx
@@ -21,12 +21,13 @@
 
 
 #include <xmloff/prhdlfac.hxx>
+#include <memory>
 
 class XMLTextPropertyHandlerFactory_Impl;
 
 class XMLTextPropertyHandlerFactory : public XMLPropertyHandlerFactory
 {
-    XMLTextPropertyHandlerFactory_Impl *pImpl;
+    std::unique_ptr<XMLTextPropertyHandlerFactory_Impl> pImpl;
 
 public:
 


More information about the Libreoffice-commits mailing list