diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-05-18 20:38:55 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-20 11:45:12 +0000 |
commit | f88cf9129d5b81cf9dd380f63be87ba196121e42 (patch) | |
tree | a7688ec48b4813d3a8198e336a43d379e742ce5f | |
parent | 7cffe9dd6440e0eb6a17c950b207f5fb669e8636 (diff) |
tdf#89329: use unique_ptr for pImpl in svx/
Change-Id: I6c252272feb9915b580b3525a606c26c19cbe773
Reviewed-on: https://gerrit.libreoffice.org/25114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/svx/clipfmtitem.hxx | 6 | ||||
-rw-r--r-- | include/svx/rubydialog.hxx | 7 | ||||
-rwxr-xr-x | include/svx/srchdlg.hxx | 2 | ||||
-rw-r--r-- | include/svx/swframeposstrings.hxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 3 | ||||
-rwxr-xr-x | svx/source/dialog/srchdlg.cxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/swframeposstrings.cxx | 1 | ||||
-rw-r--r-- | svx/source/items/clipfmtitem.cxx | 1 |
8 files changed, 18 insertions, 12 deletions
diff --git a/include/svx/clipfmtitem.hxx b/include/svx/clipfmtitem.hxx index e66b337af757..1da709582415 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 78a2c7fc43da..d5414be7dc07 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 570d795144e5..05729bcb3000 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 22ac89e1231f..b81765ab8641 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 85f31a4add60..90b7e623138e 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 426d8e79e502..de310ce10d08 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 3729bb6f5c14..a055b7789021 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 9b1c2c061f2f..2cd8929cfb92 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 |