diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-09 11:37:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-12 09:13:33 +0200 |
commit | 529f15859b4699b01f32e4ac438b35afe05f9143 (patch) | |
tree | 137fd6897380ff17b2f5e863c0617d5b6958c017 | |
parent | 0f8873612829f7946ea6c3114b050320520eb75a (diff) |
loplugin:mergeclasses
Change-Id: I660b102e0e053e632ea6f1880e92652bc1ed5e5e
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | include/sfx2/sfxstatuslistener.hxx | 10 | ||||
-rw-r--r-- | include/sfx2/tbxctrl.hxx | 24 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 18 |
4 files changed, 21 insertions, 32 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 728b5b098f64..932862e19278 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -65,7 +65,6 @@ merge SdTransferable::UserData with sd::slidesorter::controller::TransferableDat merge SdwTextBoxRecord with SdwTextArt merge ServerFontLayoutEngine with HbLayoutEngine merge SfxSingleRecordReader with SfxMultiRecordReader -merge SfxStatusListenerInterface with SfxPopupWindow merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl merge StgReader with WW8Reader merge SvListView with SvTreeListBox diff --git a/include/sfx2/sfxstatuslistener.hxx b/include/sfx2/sfxstatuslistener.hxx index f01a2e4178d7..779a51c41e12 100644 --- a/include/sfx2/sfxstatuslistener.hxx +++ b/include/sfx2/sfxstatuslistener.hxx @@ -32,16 +32,6 @@ #include <cppuhelper/implbase2.hxx> -// Interface for implementations which needs to get notifications about state changes -class SfxStatusListenerInterface -{ - public: - virtual void StateChanged( sal_uInt16 nSlotId, SfxItemState eState, const SfxPoolItem* pState ) = 0; - - protected: - ~SfxStatusListenerInterface() {} -}; - class SFX2_DLLPUBLIC SfxStatusListener : public ::cppu::WeakImplHelper2< css::frame::XStatusListener, css::lang::XComponent> diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx index 2fbbcbfc20ad..e0a1f0563ada 100644 --- a/include/sfx2/tbxctrl.hxx +++ b/include/sfx2/tbxctrl.hxx @@ -61,31 +61,15 @@ struct SfxTbxCtrlFactory -class SfxFrameStatusListener : public svt::FrameStatusListener -{ - public: - SfxFrameStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, - SfxStatusListenerInterface* pCallee ); - virtual ~SfxFrameStatusListener(); - - // XStatusListener - virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) - throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - - private: - SfxStatusListenerInterface* m_pCallee; -}; - - /* Floating windows that can be torn from tool boxes should be derived from this class. Since it is also derived from SfxControllerItem, its instances will also receive the StateChanged calls. */ - -class SFX2_DLLPUBLIC SfxPopupWindow: public FloatingWindow, public SfxStatusListenerInterface +class SfxFrameStatusListener; +class SFX2_DLLPUBLIC SfxPopupWindow: public FloatingWindow { +friend class SfxFrameStatusListener; bool m_bFloating; bool m_bCascading; Link<SfxPopupWindow*,void> m_aDeleteLink; @@ -116,7 +100,7 @@ protected: // SfxStatusListenerInterface using FloatingWindow::StateChanged; virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState ) SAL_OVERRIDE; + const SfxPoolItem* pState ); public: SfxPopupWindow( sal_uInt16 nId, diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index b1aad075ba8a..f27542430d55 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -745,10 +745,25 @@ VclPtr<vcl::Window> SfxToolBoxControl::CreateItemWindow( vcl::Window * ) return VclPtr<vcl::Window>(); } +class SfxFrameStatusListener : public svt::FrameStatusListener +{ + public: + SfxFrameStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, + SfxPopupWindow* pCallee ); + virtual ~SfxFrameStatusListener(); + + // XStatusListener + virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) + throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + private: + VclPtr<SfxPopupWindow> m_pCallee; +}; SfxFrameStatusListener::SfxFrameStatusListener( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& xFrame, - SfxStatusListenerInterface* pCallee ) : + SfxPopupWindow* pCallee ) : svt::FrameStatusListener( rxContext, xFrame ), m_pCallee( pCallee ) { @@ -958,6 +973,7 @@ void SfxPopupWindow::dispose() { m_xStatusListener->dispose(); m_xStatusListener.clear(); + m_pStatusListener = nullptr; } vcl::Window* pWindow = GetTopMostParentSystemWindow( this ); |