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