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 @@
#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 );
......
......@@ -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 );
......
......@@ -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.
*/
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
......@@ -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:
......
......@@ -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 )
......
......@@ -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: */
......@@ -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 )
......
......@@ -312,7 +312,6 @@ INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl())
INetURLHistory::~INetURLHistory()
{
DELETEZ (m_pImpl);
}
/*
......
......@@ -65,7 +65,6 @@ SharedStringPool::SharedStringPool( const CharClass* pCharClass ) :
SharedStringPool::~SharedStringPool()
{
delete mpImpl;
}
SharedString SharedStringPool::intern( const OUString& rStr )
......
......@@ -64,8 +64,6 @@ SfxBroadcaster::~SfxBroadcaster()
if (pListener)
pListener->RemoveBroadcaster_Impl(*this);
}
delete mpImpl;
}
......
......@@ -58,8 +58,6 @@ SfxListener::~SfxListener()
SfxBroadcaster *pBC = mpImpl->maBCs[nPos];
pBC->RemoveListener(*this);
}
delete mpImpl;
}
......
......@@ -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
......
......@@ -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()
......
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