Kaydet (Commit) 0d62716f authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr for pImpl in svl/

Change-Id: Ieef897314ac0f056c0a09a5182ca59800fd58f41
üst f43db673
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#define INCLUDED_SVL_BRDCST_HXX #define INCLUDED_SVL_BRDCST_HXX
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <memory>
class SfxListener; class SfxListener;
class SfxHint; class SfxHint;
...@@ -28,7 +29,7 @@ class SfxBroadcasterTest; ...@@ -28,7 +29,7 @@ class SfxBroadcasterTest;
class SVL_DLLPUBLIC SfxBroadcaster class SVL_DLLPUBLIC SfxBroadcaster
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
private: private:
void AddListener( SfxListener& rListener ); void AddListener( SfxListener& rListener );
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <memory>
namespace svl { namespace svl {
...@@ -22,7 +23,7 @@ namespace svl { ...@@ -22,7 +23,7 @@ namespace svl {
class SVL_DLLPUBLIC GridPrinter class SVL_DLLPUBLIC GridPrinter
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
public: public:
GridPrinter( size_t nRows, size_t nCols, bool bPrint = true ); GridPrinter( size_t nRows, size_t nCols, bool bPrint = true );
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <svl/hint.hxx> #include <svl/hint.hxx>
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <memory>
class INetURLHistory_Impl; class INetURLHistory_Impl;
class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster
...@@ -35,7 +36,7 @@ class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster ...@@ -35,7 +36,7 @@ class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster
/** Representation. /** Representation.
*/ */
INetURLHistory_Impl *m_pImpl; std::unique_ptr<INetURLHistory_Impl> m_pImpl;
/** Construction/Destruction. /** Construction/Destruction.
*/ */
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <svl/itemset.hxx> #include <svl/itemset.hxx>
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <vector> #include <vector>
#include <memory>
/// map a property between beans::XPropertySet and SfxPoolItem /// map a property between beans::XPropertySet and SfxPoolItem
struct SfxItemPropertyMapEntry struct SfxItemPropertyMapEntry
...@@ -87,7 +88,7 @@ typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t; ...@@ -87,7 +88,7 @@ typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t;
class SfxItemPropertyMap_Impl; class SfxItemPropertyMap_Impl;
class SVL_DLLPUBLIC SfxItemPropertyMap class SVL_DLLPUBLIC SfxItemPropertyMap
{ {
SfxItemPropertyMap_Impl* m_pImpl; std::unique_ptr<SfxItemPropertyMap_Impl> m_pImpl;
public: public:
SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ); SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries );
SfxItemPropertyMap( const SfxItemPropertyMap& rSource ); SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
...@@ -156,7 +157,7 @@ public: ...@@ -156,7 +157,7 @@ public:
struct SfxItemPropertySetInfo_Impl; struct SfxItemPropertySetInfo_Impl;
class SVL_DLLPUBLIC SfxItemPropertySetInfo : public cppu::WeakImplHelper1<css::beans::XPropertySetInfo> class SVL_DLLPUBLIC SfxItemPropertySetInfo : public cppu::WeakImplHelper1<css::beans::XPropertySetInfo>
{ {
SfxItemPropertySetInfo_Impl* m_pImpl; std::unique_ptr<SfxItemPropertySetInfo_Impl> m_pImpl;
public: public:
SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap ); SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap );
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#define INCLUDED_SVL_LSTNER_HXX #define INCLUDED_SVL_LSTNER_HXX
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <memory>
class SfxBroadcaster; class SfxBroadcaster;
class SfxHint; class SfxHint;
...@@ -27,7 +28,7 @@ class SfxHint; ...@@ -27,7 +28,7 @@ class SfxHint;
class SVL_DLLPUBLIC SfxListener class SVL_DLLPUBLIC SfxListener
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
private: private:
const SfxListener& operator=(const SfxListener &) = delete; const SfxListener& operator=(const SfxListener &) = delete;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
#include <memory>
class SvNumberFormatter; class SvNumberFormatter;
class SvNumFmtSuppl_Impl; class SvNumFmtSuppl_Impl;
...@@ -51,7 +52,7 @@ class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2 ...@@ -51,7 +52,7 @@ class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2
css::lang::XUnoTunnel> css::lang::XUnoTunnel>
{ {
private: private:
SvNumFmtSuppl_Impl* pImpl; std::unique_ptr<SvNumFmtSuppl_Impl> pImpl;
public: public:
SvNumberFormatsSupplierObj(); SvNumberFormatsSupplierObj();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <memory>
class CharClass; class CharClass;
...@@ -27,7 +28,7 @@ class SharedString; ...@@ -27,7 +28,7 @@ class SharedString;
class SVL_DLLPUBLIC SharedStringPool class SVL_DLLPUBLIC SharedStringPool
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
SharedStringPool( const SharedStringPool& ) = delete; SharedStringPool( const SharedStringPool& ) = delete;
SharedStringPool& operator=( const SharedStringPool& ) = delete; SharedStringPool& operator=( const SharedStringPool& ) = delete;
......
...@@ -29,7 +29,7 @@ class IStylePoolIteratorAccess; ...@@ -29,7 +29,7 @@ class IStylePoolIteratorAccess;
class SVL_DLLPUBLIC StylePool class SVL_DLLPUBLIC StylePool
{ {
private: private:
StylePoolImpl *pImpl; std::unique_ptr<StylePoolImpl> pImpl;
public: public:
typedef std::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t; typedef std::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
......
...@@ -83,7 +83,7 @@ typedef sal_Int32 UndoStackMark; ...@@ -83,7 +83,7 @@ typedef sal_Int32 UndoStackMark;
class SVL_DLLPUBLIC SfxUndoActions class SVL_DLLPUBLIC SfxUndoActions
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
public: public:
SfxUndoActions(); SfxUndoActions();
...@@ -133,7 +133,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra ...@@ -133,7 +133,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
*/ */
{ {
struct Impl; struct Impl;
Impl* mpImpl; std::unique_ptr<Impl> mpImpl;
public: public:
......
...@@ -71,13 +71,12 @@ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ...@@ -71,13 +71,12 @@ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries
} }
SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMap& rSource ) : SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMap& rSource ) :
m_pImpl( new SfxItemPropertyMap_Impl( rSource.m_pImpl ) ) m_pImpl( new SfxItemPropertyMap_Impl( rSource.m_pImpl.get() ) )
{ {
} }
SfxItemPropertyMap::~SfxItemPropertyMap() SfxItemPropertyMap::~SfxItemPropertyMap()
{ {
delete m_pImpl;
} }
const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const OUString &rName ) const const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const OUString &rName ) const
...@@ -344,7 +343,6 @@ Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( ) ...@@ -344,7 +343,6 @@ Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( )
SfxItemPropertySetInfo::~SfxItemPropertySetInfo() SfxItemPropertySetInfo::~SfxItemPropertySetInfo()
{ {
delete m_pImpl->m_pOwnMap; delete m_pImpl->m_pOwnMap;
delete m_pImpl;
} }
Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const OUString& rName ) Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const OUString& rName )
......
...@@ -467,6 +467,7 @@ IStylePoolIteratorAccess* StylePool::createIterator( const bool bSkipUnusedItemS ...@@ -467,6 +467,7 @@ IStylePoolIteratorAccess* StylePool::createIterator( const bool bSkipUnusedItemS
return pImpl->createIterator( bSkipUnusedItemSets, bSkipIgnorableItems ); return pImpl->createIterator( bSkipUnusedItemSets, bSkipIgnorableItems );
} }
StylePool::~StylePool() { delete pImpl; } StylePool::~StylePool()
{}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -64,7 +64,6 @@ GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) : ...@@ -64,7 +64,6 @@ GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) :
GridPrinter::~GridPrinter() GridPrinter::~GridPrinter()
{ {
delete mpImpl;
} }
void GridPrinter::set( size_t nRow, size_t nCol, const OUString& rStr ) void GridPrinter::set( size_t nRow, size_t nCol, const OUString& rStr )
......
...@@ -312,7 +312,6 @@ INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl()) ...@@ -312,7 +312,6 @@ INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl())
INetURLHistory::~INetURLHistory() INetURLHistory::~INetURLHistory()
{ {
DELETEZ (m_pImpl);
} }
/* /*
......
...@@ -65,7 +65,6 @@ SharedStringPool::SharedStringPool( const CharClass* pCharClass ) : ...@@ -65,7 +65,6 @@ SharedStringPool::SharedStringPool( const CharClass* pCharClass ) :
SharedStringPool::~SharedStringPool() SharedStringPool::~SharedStringPool()
{ {
delete mpImpl;
} }
SharedString SharedStringPool::intern( const OUString& rStr ) SharedString SharedStringPool::intern( const OUString& rStr )
......
...@@ -64,8 +64,6 @@ SfxBroadcaster::~SfxBroadcaster() ...@@ -64,8 +64,6 @@ SfxBroadcaster::~SfxBroadcaster()
if (pListener) if (pListener)
pListener->RemoveBroadcaster_Impl(*this); pListener->RemoveBroadcaster_Impl(*this);
} }
delete mpImpl;
} }
......
...@@ -58,8 +58,6 @@ SfxListener::~SfxListener() ...@@ -58,8 +58,6 @@ SfxListener::~SfxListener()
SfxBroadcaster *pBC = mpImpl->maBCs[nPos]; SfxBroadcaster *pBC = mpImpl->maBCs[nPos];
pBC->RemoveListener(*this); pBC->RemoveListener(*this);
} }
delete mpImpl;
} }
......
...@@ -40,18 +40,17 @@ public: ...@@ -40,18 +40,17 @@ public:
// Default ctor for getReflection // Default ctor for getReflection
SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj() SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj()
: pImpl( new SvNumFmtSuppl_Impl(nullptr) )
{ {
pImpl = new SvNumFmtSuppl_Impl(nullptr);
} }
SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj(SvNumberFormatter* pForm) SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj(SvNumberFormatter* pForm)
: pImpl( new SvNumFmtSuppl_Impl(pForm) )
{ {
pImpl = new SvNumFmtSuppl_Impl(pForm);
} }
SvNumberFormatsSupplierObj::~SvNumberFormatsSupplierObj() SvNumberFormatsSupplierObj::~SvNumberFormatsSupplierObj()
{ {
delete pImpl;
} }
::comphelper::SharedMutex& SvNumberFormatsSupplierObj::getSharedMutex() const ::comphelper::SharedMutex& SvNumberFormatsSupplierObj::getSharedMutex() const
......
...@@ -169,7 +169,6 @@ SfxUndoActions::SfxUndoActions( const SfxUndoActions& r ) : ...@@ -169,7 +169,6 @@ SfxUndoActions::SfxUndoActions( const SfxUndoActions& r ) :
SfxUndoActions::~SfxUndoActions() SfxUndoActions::~SfxUndoActions()
{ {
delete mpImpl;
} }
bool SfxUndoActions::empty() const bool SfxUndoActions::empty() const
...@@ -1335,7 +1334,6 @@ SfxListUndoAction::SfxListUndoAction( ...@@ -1335,7 +1334,6 @@ SfxListUndoAction::SfxListUndoAction(
SfxListUndoAction::~SfxListUndoAction() SfxListUndoAction::~SfxListUndoAction()
{ {
delete mpImpl;
} }
void SfxListUndoAction::Undo() void SfxListUndoAction::Undo()
......
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