use unique_ptr for pImpl in extensions,hwpfilter/

Change-Id: I476ba7ec2ebee8c61bf9bb6ff0309cc40affb275
This commit is contained in:
Noel Grandin 2015-11-17 15:40:14 +02:00
parent 2e9277c050
commit 21c5ff1287
4 changed files with 8 additions and 14 deletions

View file

@ -219,7 +219,6 @@ namespace abp
}
ODataSourceContext::~ODataSourceContext()
{
delete(m_pImpl);
}

View file

@ -22,6 +22,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <memory>
#include "abptypes.hxx"
@ -45,7 +46,7 @@ namespace abp
class ODataSourceContext
{
private:
ODataSourceContextImpl* m_pImpl;
std::unique_ptr<ODataSourceContextImpl> m_pImpl;
public:
explicit ODataSourceContext(

View file

@ -52,10 +52,10 @@ sal_Int16 SAL_CALL AttributeListImpl::getLength() throw (RuntimeException, std::
}
AttributeListImpl::AttributeListImpl( const AttributeListImpl &r ) :
cppu::WeakImplHelper<css::xml::sax::XAttributeList>( r )
AttributeListImpl::AttributeListImpl( const AttributeListImpl &r )
: cppu::WeakImplHelper<css::xml::sax::XAttributeList>( r ),
m_pImpl( new AttributeListImpl_impl )
{
m_pImpl = new AttributeListImpl_impl;
*m_pImpl = *(r.m_pImpl);
}
@ -125,14 +125,13 @@ OUString AttributeListImpl::getValueByName(const OUString& sName) throw (Runtime
AttributeListImpl::AttributeListImpl()
: m_pImpl( new AttributeListImpl_impl )
{
m_pImpl = new AttributeListImpl_impl;
}
AttributeListImpl::~AttributeListImpl()
{
delete m_pImpl;
}

View file

@ -23,12 +23,7 @@
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <cppuhelper/implbase.hxx>
/*----------------------------------------
*
* Attributlist implementation
*
*----------------------------------------*/
#include <memory>
using namespace ::cppu;
using namespace ::com::sun::star::xml::sax;
@ -57,7 +52,7 @@ public:
void clear();
private:
struct AttributeListImpl_impl *m_pImpl;
std::unique_ptr<AttributeListImpl_impl> m_pImpl;
};
#endif // INCLUDED_HWPFILTER_SOURCE_ATTRIBUTES_HXX