Kaydet (Commit) 9c205723 authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr for pImpl in sax/

Change-Id: I0bef03451437cbdc5b0fed6b67690ac1d547291d
üst b442d5dd
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
#include <sax/fastsaxdllapi.h> #include <sax/fastsaxdllapi.h>
#include <memory>
namespace com { namespace sun { namespace star { namespace xml { namespace sax { namespace com { namespace sun { namespace star { namespace xml { namespace sax {
...@@ -46,7 +47,7 @@ class FASTSAX_DLLPUBLIC FastSaxParser ...@@ -46,7 +47,7 @@ class FASTSAX_DLLPUBLIC FastSaxParser
css::xml::sax::XFastParser, css::xml::sax::XFastParser,
css::lang::XServiceInfo > css::lang::XServiceInfo >
{ {
FastSaxParserImpl* mpImpl; std::unique_ptr<FastSaxParserImpl> mpImpl;
public: public:
FastSaxParser(); FastSaxParser();
......
...@@ -64,9 +64,9 @@ sal_Int16 AttributeList::getLength() throw (RuntimeException, std::exception) ...@@ -64,9 +64,9 @@ sal_Int16 AttributeList::getLength() throw (RuntimeException, std::exception)
AttributeList::AttributeList( const AttributeList &r ) : AttributeList::AttributeList( const AttributeList &r ) :
cppu::WeakImplHelper<XAttributeList, XCloneable>() cppu::WeakImplHelper<XAttributeList, XCloneable>(),
m_pImpl( new AttributeList_impl )
{ {
m_pImpl = new AttributeList_impl;
*m_pImpl = *(r.m_pImpl); *m_pImpl = *(r.m_pImpl);
} }
...@@ -134,15 +134,14 @@ Reference< XCloneable > AttributeList::createClone() throw (RuntimeException, st ...@@ -134,15 +134,14 @@ Reference< XCloneable > AttributeList::createClone() throw (RuntimeException, st
AttributeList::AttributeList() AttributeList::AttributeList()
: m_pImpl( new AttributeList_impl )
{ {
m_pImpl = new AttributeList_impl;
} }
AttributeList::~AttributeList() AttributeList::~AttributeList()
{ {
delete m_pImpl;
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <memory>
namespace sax_expatwrap namespace sax_expatwrap
{ {
...@@ -65,7 +66,7 @@ public: ...@@ -65,7 +66,7 @@ public:
createClone() throw(css::uno::RuntimeException, std::exception) override; createClone() throw(css::uno::RuntimeException, std::exception) override;
private: private:
struct AttributeList_impl *m_pImpl; std::unique_ptr<AttributeList_impl> m_pImpl;
}; };
} }
......
...@@ -1288,7 +1288,6 @@ FastSaxParser::FastSaxParser() : mpImpl(new FastSaxParserImpl(this)) {} ...@@ -1288,7 +1288,6 @@ FastSaxParser::FastSaxParser() : mpImpl(new FastSaxParserImpl(this)) {}
FastSaxParser::~FastSaxParser() FastSaxParser::~FastSaxParser()
{ {
delete mpImpl;
} }
void FastSaxParser::parseStream( const xml::sax::InputSource& aInputSource ) void FastSaxParser::parseStream( const xml::sax::InputSource& aInputSource )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment