diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-17 14:46:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-18 08:35:34 +0200 |
commit | 0d62716f67b6269448eeae1f012f9512b503f390 (patch) | |
tree | b390a03fed77b2bee5045f27d0609df1b863d92f | |
parent | f43db673558a1139fba783973c87de9b79033425 (diff) |
use unique_ptr for pImpl in svl/
Change-Id: Ieef897314ac0f056c0a09a5182ca59800fd58f41
-rw-r--r-- | include/svl/SfxBroadcaster.hxx | 3 | ||||
-rw-r--r-- | include/svl/gridprinter.hxx | 3 | ||||
-rw-r--r-- | include/svl/inethist.hxx | 3 | ||||
-rw-r--r-- | include/svl/itemprop.hxx | 5 | ||||
-rw-r--r-- | include/svl/lstner.hxx | 3 | ||||
-rw-r--r-- | include/svl/numuno.hxx | 3 | ||||
-rw-r--r-- | include/svl/sharedstringpool.hxx | 3 | ||||
-rw-r--r-- | include/svl/stylepool.hxx | 2 | ||||
-rw-r--r-- | include/svl/undo.hxx | 4 | ||||
-rw-r--r-- | svl/source/items/itemprop.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/stylepool.cxx | 3 | ||||
-rw-r--r-- | svl/source/misc/gridprinter.cxx | 1 | ||||
-rw-r--r-- | svl/source/misc/inethist.cxx | 1 | ||||
-rw-r--r-- | svl/source/misc/sharedstringpool.cxx | 1 | ||||
-rw-r--r-- | svl/source/notify/SfxBroadcaster.cxx | 2 | ||||
-rw-r--r-- | svl/source/notify/lstner.cxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/numuno.cxx | 5 | ||||
-rw-r--r-- | svl/source/undo/undo.cxx | 2 |
18 files changed, 23 insertions, 27 deletions
diff --git a/include/svl/SfxBroadcaster.hxx b/include/svl/SfxBroadcaster.hxx index 97afa702c224..e5fb5e16b96a 100644 --- a/include/svl/SfxBroadcaster.hxx +++ b/include/svl/SfxBroadcaster.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SVL_BRDCST_HXX #include <svl/svldllapi.h> +#include <memory> class SfxListener; class SfxHint; @@ -28,7 +29,7 @@ class SfxBroadcasterTest; class SVL_DLLPUBLIC SfxBroadcaster { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; private: void AddListener( SfxListener& rListener ); diff --git a/include/svl/gridprinter.hxx b/include/svl/gridprinter.hxx index 446072bcf2af..6f3f61b1a687 100644 --- a/include/svl/gridprinter.hxx +++ b/include/svl/gridprinter.hxx @@ -12,6 +12,7 @@ #include <rtl/ustring.hxx> #include <svl/svldllapi.h> +#include <memory> namespace svl { @@ -22,7 +23,7 @@ namespace svl { class SVL_DLLPUBLIC GridPrinter { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: GridPrinter( size_t nRows, size_t nCols, bool bPrint = true ); diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx index 90a12bbb70fd..2a03d3b90d91 100644 --- a/include/svl/inethist.hxx +++ b/include/svl/inethist.hxx @@ -23,6 +23,7 @@ #include <svl/hint.hxx> #include <svl/svldllapi.h> #include <tools/urlobj.hxx> +#include <memory> class INetURLHistory_Impl; class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster @@ -35,7 +36,7 @@ class SVL_DLLPUBLIC INetURLHistory : public SfxBroadcaster /** Representation. */ - INetURLHistory_Impl *m_pImpl; + std::unique_ptr<INetURLHistory_Impl> m_pImpl; /** Construction/Destruction. */ diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx index 56a82d9af91e..1c8923f4cee1 100644 --- a/include/svl/itemprop.hxx +++ b/include/svl/itemprop.hxx @@ -26,6 +26,7 @@ #include <svl/itemset.hxx> #include <svl/svldllapi.h> #include <vector> +#include <memory> /// map a property between beans::XPropertySet and SfxPoolItem struct SfxItemPropertyMapEntry @@ -87,7 +88,7 @@ typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t; class SfxItemPropertyMap_Impl; class SVL_DLLPUBLIC SfxItemPropertyMap { - SfxItemPropertyMap_Impl* m_pImpl; + std::unique_ptr<SfxItemPropertyMap_Impl> m_pImpl; public: SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ); SfxItemPropertyMap( const SfxItemPropertyMap& rSource ); @@ -156,7 +157,7 @@ public: struct SfxItemPropertySetInfo_Impl; class SVL_DLLPUBLIC SfxItemPropertySetInfo : public cppu::WeakImplHelper1<css::beans::XPropertySetInfo> { - SfxItemPropertySetInfo_Impl* m_pImpl; + std::unique_ptr<SfxItemPropertySetInfo_Impl> m_pImpl; public: SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap ); diff --git a/include/svl/lstner.hxx b/include/svl/lstner.hxx index bfa2330805ed..985ff526b7ee 100644 --- a/include/svl/lstner.hxx +++ b/include/svl/lstner.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SVL_LSTNER_HXX #include <svl/svldllapi.h> +#include <memory> class SfxBroadcaster; class SfxHint; @@ -27,7 +28,7 @@ class SfxHint; class SVL_DLLPUBLIC SfxListener { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; private: const SfxListener& operator=(const SfxListener &) = delete; diff --git a/include/svl/numuno.hxx b/include/svl/numuno.hxx index 4dab2ef8e908..827129393b1e 100644 --- a/include/svl/numuno.hxx +++ b/include/svl/numuno.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <cppuhelper/implbase2.hxx> +#include <memory> class SvNumberFormatter; class SvNumFmtSuppl_Impl; @@ -51,7 +52,7 @@ class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2 css::lang::XUnoTunnel> { private: - SvNumFmtSuppl_Impl* pImpl; + std::unique_ptr<SvNumFmtSuppl_Impl> pImpl; public: SvNumberFormatsSupplierObj(); diff --git a/include/svl/sharedstringpool.hxx b/include/svl/sharedstringpool.hxx index ae958ed220c4..88adc1b48b79 100644 --- a/include/svl/sharedstringpool.hxx +++ b/include/svl/sharedstringpool.hxx @@ -12,6 +12,7 @@ #include <svl/svldllapi.h> #include <rtl/ustring.hxx> +#include <memory> class CharClass; @@ -27,7 +28,7 @@ class SharedString; class SVL_DLLPUBLIC SharedStringPool { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; SharedStringPool( const SharedStringPool& ) = delete; SharedStringPool& operator=( const SharedStringPool& ) = delete; diff --git a/include/svl/stylepool.hxx b/include/svl/stylepool.hxx index f12528ad56c4..93caa6aea0f9 100644 --- a/include/svl/stylepool.hxx +++ b/include/svl/stylepool.hxx @@ -29,7 +29,7 @@ class IStylePoolIteratorAccess; class SVL_DLLPUBLIC StylePool { private: - StylePoolImpl *pImpl; + std::unique_ptr<StylePoolImpl> pImpl; public: typedef std::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t; diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx index d5bb705efbc6..3aac88f79965 100644 --- a/include/svl/undo.hxx +++ b/include/svl/undo.hxx @@ -83,7 +83,7 @@ typedef sal_Int32 UndoStackMark; class SVL_DLLPUBLIC SfxUndoActions { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: SfxUndoActions(); @@ -133,7 +133,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra */ { struct Impl; - Impl* mpImpl; + std::unique_ptr<Impl> mpImpl; public: diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index a815405a1afb..753602cd4090 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -71,13 +71,12 @@ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries } SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMap& rSource ) : - m_pImpl( new SfxItemPropertyMap_Impl( rSource.m_pImpl ) ) + m_pImpl( new SfxItemPropertyMap_Impl( rSource.m_pImpl.get() ) ) { } SfxItemPropertyMap::~SfxItemPropertyMap() { - delete m_pImpl; } const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const OUString &rName ) const @@ -344,7 +343,6 @@ Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( ) SfxItemPropertySetInfo::~SfxItemPropertySetInfo() { delete m_pImpl->m_pOwnMap; - delete m_pImpl; } Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const OUString& rName ) diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index 5e3afe6aadaf..c0947c450885 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -467,6 +467,7 @@ IStylePoolIteratorAccess* StylePool::createIterator( const bool bSkipUnusedItemS return pImpl->createIterator( bSkipUnusedItemSets, bSkipIgnorableItems ); } -StylePool::~StylePool() { delete pImpl; } +StylePool::~StylePool() +{} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/gridprinter.cxx b/svl/source/misc/gridprinter.cxx index f15c8e7658fb..4044b3ed9902 100644 --- a/svl/source/misc/gridprinter.cxx +++ b/svl/source/misc/gridprinter.cxx @@ -64,7 +64,6 @@ GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) : GridPrinter::~GridPrinter() { - delete mpImpl; } void GridPrinter::set( size_t nRow, size_t nCol, const OUString& rStr ) diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 68428ebda073..ce76e2bd6b99 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -312,7 +312,6 @@ INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl()) INetURLHistory::~INetURLHistory() { - DELETEZ (m_pImpl); } /* diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx index 435209a68874..70d76955ed50 100644 --- a/svl/source/misc/sharedstringpool.cxx +++ b/svl/source/misc/sharedstringpool.cxx @@ -65,7 +65,6 @@ SharedStringPool::SharedStringPool( const CharClass* pCharClass ) : SharedStringPool::~SharedStringPool() { - delete mpImpl; } SharedString SharedStringPool::intern( const OUString& rStr ) diff --git a/svl/source/notify/SfxBroadcaster.cxx b/svl/source/notify/SfxBroadcaster.cxx index 0a7ef4b4e963..eaeed4dbee49 100644 --- a/svl/source/notify/SfxBroadcaster.cxx +++ b/svl/source/notify/SfxBroadcaster.cxx @@ -64,8 +64,6 @@ SfxBroadcaster::~SfxBroadcaster() if (pListener) pListener->RemoveBroadcaster_Impl(*this); } - - delete mpImpl; } diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx index e24becc4f1e1..8c3bdfb58e76 100644 --- a/svl/source/notify/lstner.cxx +++ b/svl/source/notify/lstner.cxx @@ -58,8 +58,6 @@ SfxListener::~SfxListener() SfxBroadcaster *pBC = mpImpl->maBCs[nPos]; pBC->RemoveListener(*this); } - - delete mpImpl; } diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index 5f7bd780d1bc..21d211514f99 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -40,18 +40,17 @@ public: // Default ctor for getReflection SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj() + : pImpl( new SvNumFmtSuppl_Impl(nullptr) ) { - pImpl = new SvNumFmtSuppl_Impl(nullptr); } SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj(SvNumberFormatter* pForm) + : pImpl( new SvNumFmtSuppl_Impl(pForm) ) { - pImpl = new SvNumFmtSuppl_Impl(pForm); } SvNumberFormatsSupplierObj::~SvNumberFormatsSupplierObj() { - delete pImpl; } ::comphelper::SharedMutex& SvNumberFormatsSupplierObj::getSharedMutex() const diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index c65ea1bfef5f..7c3965de3585 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -169,7 +169,6 @@ SfxUndoActions::SfxUndoActions( const SfxUndoActions& r ) : SfxUndoActions::~SfxUndoActions() { - delete mpImpl; } bool SfxUndoActions::empty() const @@ -1335,7 +1334,6 @@ SfxListUndoAction::SfxListUndoAction( SfxListUndoAction::~SfxListUndoAction() { - delete mpImpl; } void SfxListUndoAction::Undo() |