diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-24 16:22:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-07-27 08:18:16 +0200 |
commit | 38ecca9b30e0fc5f7cc6264857f983e40dd58195 (patch) | |
tree | 3ad61e6d5cddcf161d27cfe4c6ca85fcf1cab8f6 /toolkit | |
parent | efac5fa06e2d00bd67c582d8a6b1f1fc69c9b9f5 (diff) |
inline a bunch of use-once macros
no point in having a macro unless it's actually going to reduce the
number of lines of code
Change-Id: Ic8760d6506cf272d7bd088f7b3b4dcbf288099fc
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 25 | ||||
-rw-r--r-- | toolkit/source/helper/listenermultiplexer.cxx | 31 |
2 files changed, 54 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 2022f0fd1ad7..c9d4bc65cc14 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -904,7 +904,30 @@ Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const // ::com::sun::star::lang::XUnoTunnel -IMPL_XUNOTUNNEL2( VCLXWindow, VCLXDevice ) +sal_Int64 VCLXWindow::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) +{ + if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( VCLXWindow::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) + { + return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); + } + return VCLXDevice::getSomething( rIdentifier ); +} +namespace +{ + class theVCLXWindowUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theVCLXWindowUnoTunnelId> {}; +} +const ::com::sun::star::uno::Sequence< sal_Int8 >& VCLXWindow::GetUnoTunnelId() throw() +{ + return theVCLXWindowUnoTunnelId::get().getSeq(); +} +VCLXWindow* VCLXWindow::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUT( rxIFace, ::com::sun::star::uno::UNO_QUERY ); + return xUT.is() ? reinterpret_cast<VCLXWindow*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( VCLXWindow::GetUnoTunnelId() ))) : NULL; +} + + + // ::com::sun::star::lang::Component void VCLXWindow::dispose( ) throw(::com::sun::star::uno::RuntimeException, std::exception) diff --git a/toolkit/source/helper/listenermultiplexer.cxx b/toolkit/source/helper/listenermultiplexer.cxx index b109c5f3dd5d..cd0dc5faef5a 100644 --- a/toolkit/source/helper/listenermultiplexer.cxx +++ b/toolkit/source/helper/listenermultiplexer.cxx @@ -155,14 +155,43 @@ IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( ItemListenerMultiplexer, ::com::sun::st // class TabListenerMultiplexer IMPL_LISTENERMULTIPLEXER_BASEMETHODS( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener ) + void TabListenerMultiplexer::inserted( sal_Int32 evt ) throw(::com::sun::star::uno::RuntimeException, std::exception) IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener, inserted, ::sal_Int32 ) + void TabListenerMultiplexer::removed( sal_Int32 evt ) throw(::com::sun::star::uno::RuntimeException, std::exception) IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener, removed, ::sal_Int32 ) + void TabListenerMultiplexer::changed( sal_Int32 evt, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& evt2 ) throw(::com::sun::star::uno::RuntimeException, std::exception) -IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_2PARAM( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener, changed, ::sal_Int32, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > ) +{ + sal_Int32 aMulti( evt ); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aMulti2( evt2 ); + ::cppu::OInterfaceIteratorHelper aIt( *this ); + while( aIt.hasMoreElements() ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener > xListener( + static_cast< ::com::sun::star::awt::XTabListener* >( aIt.next() ) ); + try + { + xListener->changed( aMulti, aMulti2 ); + } + catch(const ::com::sun::star::lang::DisposedException& e) + { + OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); + if ( e.Context == xListener || !e.Context.is() ) + aIt.remove(); + } + catch(const ::com::sun::star::uno::RuntimeException& e) + { + DISPLAY_EXCEPTION( TabListenerMultiplexer, changed, e ) + } + } +} + + void TabListenerMultiplexer::activated( sal_Int32 evt ) throw(::com::sun::star::uno::RuntimeException, std::exception) IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener, activated, ::sal_Int32 ) + void TabListenerMultiplexer::deactivated( sal_Int32 evt ) throw(::com::sun::star::uno::RuntimeException, std::exception) IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener, deactivated, ::sal_Int32 ) |