diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-28 13:53:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-28 17:21:08 +0100 |
commit | d9bda6f84c5f8c0f87545de22014ee64fbdf0c2f (patch) | |
tree | 72dd1feca60a52fe795e23921c665f8634f59185 /svx | |
parent | 4c8aba408c806830fd2f3fba5181469257d264c9 (diff) |
use more OInterfaceContainerHelper3 in svx
Change-Id: I409872c4484748d9e4dc1a2c64d3ccabfc3fb550
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125976
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 24 | ||||
-rw-r--r-- | svx/source/form/formfeaturedispatcher.cxx | 4 | ||||
-rw-r--r-- | svx/source/inc/formcontroller.hxx | 22 | ||||
-rw-r--r-- | svx/source/inc/formfeaturedispatcher.hxx | 4 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 30 | ||||
-rw-r--r-- | svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 3 |
8 files changed, 53 insertions, 46 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index c99547c8c8fc..e6a0f960395e 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -4302,7 +4302,7 @@ IMPL_LINK(FmXListBoxCell, ChangedHdl, bool, bInteractive, void) void FmXListBoxCell::OnDoubleClick() { - ::comphelper::OInterfaceIteratorHelper2 aIt( m_aActionListeners ); + ::comphelper::OInterfaceIteratorHelper3 aIt( m_aActionListeners ); css::awt::ActionEvent aEvent; aEvent.Source = *this; @@ -4310,7 +4310,7 @@ void FmXListBoxCell::OnDoubleClick() aEvent.ActionCommand = rBox.get_active_text(); while( aIt.hasMoreElements() ) - static_cast< css::awt::XActionListener *>(aIt.next())->actionPerformed( aEvent ); + aIt.next()->actionPerformed( aEvent ); } FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, std::unique_ptr<DbCellControl> pControl ) @@ -4621,11 +4621,11 @@ void SAL_CALL FmXFilterCell::setMaxTextLen( sal_Int16 /*nLen*/ ) IMPL_LINK_NOARG(FmXFilterCell, OnCommit, DbFilterField&, void) { - ::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners ); + ::comphelper::OInterfaceIteratorHelper3 aIt( m_aTextListeners ); css::awt::TextEvent aEvt; aEvt.Source = *this; while( aIt.hasMoreElements() ) - static_cast< css::awt::XTextListener *>(aIt.next())->textChanged( aEvt ); + aIt.next()->textChanged( aEvt ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 50e0d4f592d9..71be6e43fe21 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3589,13 +3589,13 @@ sal_Bool SAL_CALL FormController::approveRowChange(const RowChangeEvent& _rEvent ::osl::ClearableMutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aRowSetApproveListeners); bool bValid = true; if (aIter.hasMoreElements()) { RowChangeEvent aEvt( _rEvent ); aEvt.Source = *this; - bValid = static_cast<XRowSetApproveListener*>(aIter.next())->approveRowChange(aEvt); + bValid = aIter.next()->approveRowChange(aEvt); } if ( !bValid ) @@ -3677,12 +3677,12 @@ sal_Bool SAL_CALL FormController::approveCursorMove(const EventObject& event) ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aRowSetApproveListeners); if (aIter.hasMoreElements()) { EventObject aEvt(event); aEvt.Source = *this; - return static_cast<XRowSetApproveListener*>(aIter.next())->approveCursorMove(aEvt); + return aIter.next()->approveCursorMove(aEvt); } return true; @@ -3694,12 +3694,12 @@ sal_Bool SAL_CALL FormController::approveRowSetChange(const EventObject& event) ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aRowSetApproveListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aRowSetApproveListeners); if (aIter.hasMoreElements()) { EventObject aEvt(event); aEvt.Source = *this; - return static_cast<XRowSetApproveListener*>(aIter.next())->approveRowSetChange(aEvt); + return aIter.next()->approveRowSetChange(aEvt); } return true; @@ -3731,12 +3731,12 @@ void SAL_CALL FormController::errorOccured(const SQLErrorEvent& aEvent) ::osl::ClearableMutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aErrorListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aErrorListeners); if (aIter.hasMoreElements()) { SQLErrorEvent aEvt(aEvent); aEvt.Source = *this; - static_cast<XSQLErrorListener*>(aIter.next())->errorOccured(aEvt); + aIter.next()->errorOccured(aEvt); } else { @@ -3804,12 +3804,12 @@ sal_Bool SAL_CALL FormController::approveParameter(const DatabaseParameterEvent& ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aParameterListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aParameterListeners); if (aIter.hasMoreElements()) { DatabaseParameterEvent aEvt(aEvent); aEvt.Source = *this; - return static_cast<XDatabaseParameterListener*>(aIter.next())->approveParameter(aEvt); + return aIter.next()->approveParameter(aEvt); } else { @@ -3899,12 +3899,12 @@ sal_Bool SAL_CALL FormController::confirmDelete(const RowChangeEvent& aEvent) ::osl::MutexGuard aGuard( m_aMutex ); impl_checkDisposed_throw(); - ::comphelper::OInterfaceIteratorHelper2 aIter(m_aDeleteListeners); + ::comphelper::OInterfaceIteratorHelper3 aIter(m_aDeleteListeners); if (aIter.hasMoreElements()) { RowChangeEvent aEvt(aEvent); aEvt.Source = *this; - return static_cast<XConfirmDeleteListener*>(aIter.next())->confirmDelete(aEvt); + return aIter.next()->confirmDelete(aEvt); } // default handling: instantiate an interaction handler and let it handle the request diff --git a/svx/source/form/formfeaturedispatcher.cxx b/svx/source/form/formfeaturedispatcher.cxx index 2224adabe3d9..b90cd4c92366 100644 --- a/svx/source/form/formfeaturedispatcher.cxx +++ b/svx/source/form/formfeaturedispatcher.cxx @@ -96,14 +96,14 @@ namespace svx } else { - ::comphelper::OInterfaceIteratorHelper2 aIter( m_aStatusListeners ); + ::comphelper::OInterfaceIteratorHelper3 aIter( m_aStatusListeners ); _rFreeForNotification.clear(); while ( aIter.hasMoreElements() ) { try { - static_cast< XStatusListener* >( aIter.next() )->statusChanged( aUnoState ); + aIter.next()->statusChanged( aUnoState ); } catch( const DisposedException& ) { diff --git a/svx/source/inc/formcontroller.hxx b/svx/source/inc/formcontroller.hxx index a45046c39c65..22e3bcb432a9 100644 --- a/svx/source/inc/formcontroller.hxx +++ b/svx/source/inc/formcontroller.hxx @@ -61,7 +61,7 @@ #include <com/sun/star/util/XModifyListener.hpp> #include <comphelper/proparrhlp.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/propshlp.hxx> #include <rtl/ref.hxx> @@ -136,13 +136,19 @@ namespace svxform css::uno::Reference< css::form::runtime::XFormControllerContext > m_xFormControllerContext; css::uno::Sequence< css::uno::Reference< css::awt::XControl> > m_aControls; - ::comphelper::OInterfaceContainerHelper2 - m_aActivateListeners, - m_aModifyListeners, - m_aErrorListeners, - m_aDeleteListeners, - m_aRowSetApproveListeners, - m_aParameterListeners, + ::comphelper::OInterfaceContainerHelper3<css::form::XFormControllerListener> + m_aActivateListeners; + ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener> + m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper3<css::sdb::XSQLErrorListener> + m_aErrorListeners; + ::comphelper::OInterfaceContainerHelper3<css::form::XConfirmDeleteListener> + m_aDeleteListeners; + ::comphelper::OInterfaceContainerHelper3<css::sdb::XRowSetApproveListener> + m_aRowSetApproveListeners; + ::comphelper::OInterfaceContainerHelper3<css::form::XDatabaseParameterListener> + m_aParameterListeners; + ::comphelper::OInterfaceContainerHelper3<css::form::runtime::XFilterControllerListener> m_aFilterListeners; std::vector< css::uno::Reference< css::form::runtime::XFormController > > diff --git a/svx/source/inc/formfeaturedispatcher.hxx b/svx/source/inc/formfeaturedispatcher.hxx index b7a664c736e4..a57453dc8df2 100644 --- a/svx/source/inc/formfeaturedispatcher.hxx +++ b/svx/source/inc/formfeaturedispatcher.hxx @@ -24,7 +24,7 @@ #include <com/sun/star/form/runtime/XFormOperations.hpp> #include <cppuhelper/implbase.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> namespace svx @@ -92,7 +92,7 @@ namespace svx void getUnoState( css::frame::FeatureStateEvent& /* [out] */ _rState ) const; ::osl::Mutex& m_rMutex; - ::comphelper::OInterfaceContainerHelper2 m_aStatusListeners; + ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener> m_aStatusListeners; css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations; const css::util::URL m_aFeatureURL; diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 07e45e3cbbfe..62b983b616bc 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -41,7 +41,7 @@ #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <comphelper/propmultiplex.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <comphelper/uno3.hxx> #include <connectivity/formattedcolumnvalue.hxx> #include <cppuhelper/component.hxx> @@ -693,11 +693,11 @@ protected: std::unique_ptr<DbCellControl> m_pCellControl; private: - ::comphelper::OInterfaceContainerHelper2 m_aWindowListeners; - ::comphelper::OInterfaceContainerHelper2 m_aFocusListeners; - ::comphelper::OInterfaceContainerHelper2 m_aKeyListeners; - ::comphelper::OInterfaceContainerHelper2 m_aMouseListeners; - ::comphelper::OInterfaceContainerHelper2 m_aMouseMotionListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XWindowListener> m_aWindowListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XFocusListener> m_aFocusListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XKeyListener> m_aKeyListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XMouseListener> m_aMouseListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XMouseMotionListener> m_aMouseMotionListeners; protected: virtual ~FmXGridCell() override; @@ -877,8 +877,8 @@ private: void onTextChanged(); OUString m_sValueOnEnter; - ::comphelper::OInterfaceContainerHelper2 m_aTextListeners; - ::comphelper::OInterfaceContainerHelper2 m_aChangeListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XTextListener> m_aTextListeners; + ::comphelper::OInterfaceContainerHelper3<css::form::XChangeListener> m_aChangeListeners; ::svt::IEditImplementation* m_pEditImplementation; bool m_bOwnEditImplementation; }; @@ -889,8 +889,8 @@ typedef ::cppu::ImplHelper2 < css::awt::XCheckBox class FmXCheckBoxCell final : public FmXDataCell, public FmXCheckBoxCell_Base { - ::comphelper::OInterfaceContainerHelper2 m_aItemListeners; - ::comphelper::OInterfaceContainerHelper2 m_aActionListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XItemListener> m_aItemListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XActionListener> m_aActionListeners; OUString m_aActionCommand; VclPtr<::svt::CheckBoxControl> m_pBox; @@ -972,8 +972,8 @@ private: void OnDoubleClick(); - ::comphelper::OInterfaceContainerHelper2 m_aItemListeners, - m_aActionListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XItemListener> m_aItemListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XActionListener> m_aActionListeners; VclPtr<::svt::ListBoxControl> m_pBox; sal_uInt16 m_nLines; bool m_bMulti; @@ -986,8 +986,8 @@ class FmXComboBoxCell final : public FmXTextCell , public FmXComboBoxCell_Base { private: - ::comphelper::OInterfaceContainerHelper2 m_aItemListeners, - m_aActionListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XItemListener> m_aItemListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XActionListener> m_aActionListeners; VclPtr<::svt::ComboBoxControl> m_pComboBox; sal_uInt16 m_nLines; @@ -1067,7 +1067,7 @@ private: DECL_LINK( OnCommit, DbFilterField&, void ); virtual ~FmXFilterCell() override; - ::comphelper::OInterfaceContainerHelper2 m_aTextListeners; + ::comphelper::OInterfaceContainerHelper3<css::awt::XTextListener> m_aTextListeners; }; #endif // INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx index dbfae4d74697..a0faff6c9852 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx @@ -29,7 +29,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <cppuhelper/implbase.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> namespace textconversiondlgs @@ -109,7 +109,7 @@ private: bool m_bDisposed; ///Dispose call ready. bool m_bInDispose;///In dispose call osl::Mutex m_aContainerMutex; - comphelper::OInterfaceContainerHelper2 m_aDisposeEventListeners; + comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aDisposeEventListeners; }; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 98a104c49fc8..f55c4b179c6e 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -30,6 +30,7 @@ #include <svx/svdobj.hxx> #include <svx/svdoole2.hxx> #include <svx/shapepropertynotifier.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <comphelper/scopeguard.hxx> #include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -123,7 +124,7 @@ struct SvxShapeImpl ::tools::WeakReference< SdrObject > mpCreatedObj; // for xComponent - ::comphelper::OInterfaceContainerHelper2 maDisposeListeners; + ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> maDisposeListeners; svx::PropertyChangeNotifier maPropertyNotifier; SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex ) |