include/svx/clipfmtitem.hxx | 6 ++++-- include/svx/rubydialog.hxx | 7 +++++-- include/svx/srchdlg.hxx | 2 +- include/svx/swframeposstrings.hxx | 5 ++++- svx/source/dialog/rubydialog.cxx | 3 ++- svx/source/dialog/srchdlg.cxx | 5 ++--- svx/source/dialog/swframeposstrings.cxx | 1 - svx/source/items/clipfmtitem.cxx | 1 - 8 files changed, 18 insertions(+), 12 deletions(-)
New commits: commit f88cf9129d5b81cf9dd380f63be87ba196121e42 Author: Xisco Fauli <aniste...@gmail.com> Date: Wed May 18 20:38:55 2016 +0200 tdf#89329: use unique_ptr for pImpl in svx/ Change-Id: I6c252272feb9915b580b3525a606c26c19cbe773 Reviewed-on: https://gerrit.libreoffice.org/25114 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/include/svx/clipfmtitem.hxx b/include/svx/clipfmtitem.hxx index e66b337..1da7095 100644 --- a/include/svx/clipfmtitem.hxx +++ b/include/svx/clipfmtitem.hxx @@ -23,14 +23,13 @@ #include <sot/formats.hxx> #include <svl/poolitem.hxx> #include <svx/svxdllapi.h> +#include <memory> struct SvxClipboardFormatItem_Impl; class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxClipboardFormatItem : public SfxPoolItem { - SvxClipboardFormatItem_Impl* pImpl; protected: - virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; @@ -50,6 +49,9 @@ public: SotClipboardFormatId GetClipbrdFormatId( sal_uInt16 nPos ) const; const OUString GetClipbrdFormatName( sal_uInt16 nPos ) const; + +private: + std::unique_ptr<SvxClipboardFormatItem_Impl> pImpl; }; #endif diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx index 78a2c7f..d5414be 100644 --- a/include/svx/rubydialog.hxx +++ b/include/svx/rubydialog.hxx @@ -122,7 +122,6 @@ class SvxRubyDialog : public SfxModelessDialog css::uno::Reference<css::view::XSelectionChangeListener> xImpl; SfxBindings* pBindings; - SvxRubyData_Impl* pImpl; DECL_LINK_TYPED(ApplyHdl_Impl, Button*, void); DECL_LINK_TYPED(CloseHdl_Impl, Button*, void); @@ -154,10 +153,11 @@ class SvxRubyDialog : public SfxModelessDialog void GetCurrentText(OUString& rBase, OUString& rRuby); void UpdateColors(); + protected: virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; -public: +public: SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window* pParent); virtual ~SvxRubyDialog(); @@ -165,6 +165,9 @@ public: virtual void Activate() override; virtual void Deactivate() override; + +private: + std::unique_ptr<SvxRubyData_Impl> pImpl; }; #endif // INCLUDED_SVX_RUBYDIALOG_HXX diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 570d795..05729bc 100755 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -221,7 +221,7 @@ private: std::vector<OUString> aSearchStrings; std::vector<OUString> aReplaceStrings; - SearchDlg_Impl* pImpl; + std::unique_ptr<SearchDlg_Impl> pImpl; SearchAttrItemList* pSearchList; SearchAttrItemList* pReplaceList; SvxSearchItem* pSearchItem; diff --git a/include/svx/swframeposstrings.hxx b/include/svx/swframeposstrings.hxx index 22ac89e..b81765a 100644 --- a/include/svx/swframeposstrings.hxx +++ b/include/svx/swframeposstrings.hxx @@ -21,6 +21,7 @@ #include <rtl/ustring.hxx> #include <svx/svxdllapi.h> +#include <memory> /* contains strings needed for positioning dialogs @@ -29,7 +30,6 @@ class SvxSwFramePosString_Impl; class SVX_DLLPUBLIC SvxSwFramePosString { - SvxSwFramePosString_Impl* pImpl; public: SvxSwFramePosString(); ~SvxSwFramePosString(); @@ -81,6 +81,9 @@ public: STR_MAX }; const OUString& GetString(StringId eId); + +private: + std::unique_ptr<SvxSwFramePosString_Impl> pImpl; }; #endif diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 85f31a4..90b7e62 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -207,8 +207,9 @@ SvxRubyDialog::SvxRubyDialog(SfxBindings* pBind, SfxChildWindow* pCW, vcl::Windo , nCurrentEdit(0) , bModified(false) , pBindings(pBind) + , pImpl( new SvxRubyData_Impl ) { - xImpl = pImpl = new SvxRubyData_Impl; + xImpl = pImpl.get(); get(m_pLeftFT, "basetextft"); get(m_pRightFT, "rubytextft"); get(m_pAdjustLB, "adjustlb"); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 426d8e7..de310ce 100755 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -257,7 +257,6 @@ SvxSearchDialog::SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWi , bSet(false) , bConstruct(true) , nModifyFlag(0) - , pImpl(nullptr) , pSearchList(nullptr) , pReplaceList(new SearchAttrItemList) , pSearchItem(nullptr) @@ -360,7 +359,7 @@ void SvxSearchDialog::dispose() rBindings.LeaveRegistrations(); delete pSearchItem; - delete pImpl; + pImpl.reset(); delete pSearchList; delete pReplaceList; mpDocWin.clear(); @@ -414,7 +413,7 @@ void SvxSearchDialog::dispose() void SvxSearchDialog::Construct_Impl() { // temporary to avoid incompatibility - pImpl = new SearchDlg_Impl(); + pImpl.reset( new SearchDlg_Impl() ); pImpl->aSelectionTimer.SetTimeout( 500 ); pImpl->aSelectionTimer.SetTimeoutHdl( LINK( this, SvxSearchDialog, TimeoutHdl_Impl ) ); diff --git a/svx/source/dialog/swframeposstrings.cxx b/svx/source/dialog/swframeposstrings.cxx index 3729bb6..a055b77 100644 --- a/svx/source/dialog/swframeposstrings.cxx +++ b/svx/source/dialog/swframeposstrings.cxx @@ -48,7 +48,6 @@ SvxSwFramePosString::SvxSwFramePosString() : SvxSwFramePosString::~SvxSwFramePosString() { - delete pImpl; } const OUString& SvxSwFramePosString::GetString(StringId eId) diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index 9b1c2c0..2cd8929 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -55,7 +55,6 @@ SvxClipboardFormatItem::SvxClipboardFormatItem( const SvxClipboardFormatItem& rC SvxClipboardFormatItem::~SvxClipboardFormatItem() { - delete pImpl; } bool SvxClipboardFormatItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits