Kaydet (Commit) 032dae36 authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr for pImpl in sfx2/

Change-Id: I564fa80a2642a4849127f3c25236634289b5b93d
üst 9c205723
......@@ -28,6 +28,7 @@
#include <rtl/ustring.hxx>
#include <sfx2/objsh.hxx>
#include <memory>
class SfxMedium;
class SfxFilter;
......@@ -43,7 +44,7 @@ class SFX2_DLLPUBLIC SfxObjectFactory
{
private:
const char* pShortName;
SfxObjectFactory_Impl* pImpl; // Additional Data
std::unique_ptr<SfxObjectFactory_Impl> pImpl; // Additional Data
SfxObjectShellFlags nFlags;
public:
......
......@@ -31,6 +31,7 @@
#include <sfx2/docfilt.hxx>
#include <tools/ref.hxx>
#include <memory>
namespace vcl { class Window; }
class SfxFilter;
......@@ -67,7 +68,7 @@ typedef sal_uIntPtr (*SfxDetectFilter)( SfxMedium& rMedium, const SfxFilter **,
class SFX2_DLLPUBLIC SfxFilterContainer
{
SfxFilterContainer_Impl *pImpl;
std::unique_ptr<SfxFilterContainer_Impl> pImpl;
public:
SfxFilterContainer( const OUString& rName );
......
......@@ -25,6 +25,7 @@
#include <tools/link.hxx>
#include <tools/ref.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#include <memory>
namespace com { namespace sun { namespace star { namespace uno
{
......@@ -52,7 +53,7 @@ struct SvLinkSource_Impl;
class SFX2_DLLPUBLIC SvLinkSource : public SvRefBase
{
private:
SvLinkSource_Impl* pImpl; // compatible area
std::unique_ptr<SvLinkSource_Impl> pImpl; // compatible area
public:
......
......@@ -26,6 +26,7 @@
#include <sfx2/linksrc.hxx>
#include <sot/exchange.hxx>
#include <tools/ref.hxx>
#include <memory>
namespace com { namespace sun { namespace star { namespace uno
{
......@@ -71,7 +72,7 @@ private:
SvLinkSourceRef xObj;
OUString aLinkName;
BaseLink_Impl* pImpl;
std::unique_ptr<BaseLink_Impl> pImpl;
sal_uInt16 nObjType;
bool bVisible : 1;
bool bSynchron : 1;
......
......@@ -210,7 +210,6 @@ SvLinkSource::SvLinkSource()
SvLinkSource::~SvLinkSource()
{
delete pImpl;
}
......
......@@ -123,9 +123,9 @@ public:
SvBaseLink::SvBaseLink()
: m_bIsReadOnly(false)
: pImpl ( new BaseLink_Impl ),
m_bIsReadOnly(false)
{
pImpl = new BaseLink_Impl();
nObjType = OBJECT_CLIENT_SO;
pImplData = new ImplBaseLinkData;
bVisible = bSynchron = bUseCache = true;
......@@ -135,9 +135,9 @@ SvBaseLink::SvBaseLink()
SvBaseLink::SvBaseLink( SfxLinkUpdateMode nUpdateMode, SotClipboardFormatId nContentType )
: m_bIsReadOnly(false)
: pImpl( new BaseLink_Impl ),
m_bIsReadOnly(false)
{
pImpl = new BaseLink_Impl();
nObjType = OBJECT_CLIENT_SO;
pImplData = new ImplBaseLinkData;
bVisible = bSynchron = bUseCache = true;
......@@ -243,7 +243,6 @@ SvBaseLink::~SvBaseLink()
}
delete pImplData;
delete pImpl;
}
IMPL_LINK_TYPED( SvBaseLink, EndEditHdl, const OUString&, _rNewName, void )
......
......@@ -182,15 +182,14 @@ const SfxFilter* SfxFilterContainer::GetAnyFilter( SfxFilterFlags nMust, SfxFilt
SfxFilterContainer::SfxFilterContainer( const OUString& rName )
: pImpl( new SfxFilterContainer_Impl( rName ) )
{
pImpl = new SfxFilterContainer_Impl( rName );
}
SfxFilterContainer::~SfxFilterContainer()
{
delete pImpl;
}
......
......@@ -122,10 +122,8 @@ SfxObjectFactory::SfxObjectFactory
SfxObjectFactory::~SfxObjectFactory()
{
delete pImpl->pNameResId;
delete pImpl->pFilterContainer;
delete pImpl;
}
......
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