include/comphelper/listenernotification.hxx | 45 +++++++++------------------- 1 file changed, 16 insertions(+), 29 deletions(-)
New commits: commit b3847f3dfda6ed18f5f09f01354c529925c25889 Author: Stephan Bergmann <[email protected]> Date: Wed Mar 26 17:10:41 2014 +0100 Work around MSC "'override' cannot be used with 'inline'" bug Change-Id: Icd3b09f098c19268ac888dd6195fb535979557ed diff --git a/include/comphelper/listenernotification.hxx b/include/comphelper/listenernotification.hxx index cac3a79..5ae133b 100644 --- a/include/comphelper/listenernotification.hxx +++ b/include/comphelper/listenernotification.hxx @@ -203,10 +203,16 @@ namespace comphelper inline bool notify( const EventClass& _rEvent, NotificationMethod _pNotify ) SAL_THROW(( ::com::sun::star::uno::Exception )); protected: - inline virtual bool implNotify( + virtual bool implNotify( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener, const ::com::sun::star::lang::EventObject& _rEvent - ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE; + ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE + { + const EventClass& rTypedEvent( static_cast< const EventClass& >( _rEvent ) ); + ListenerClass* pTypedListener( static_cast< ListenerClass* >( _rxListener.get() ) ); + (pTypedListener->*m_pNotificationMethod)( rTypedEvent ); + return true; + } }; @@ -219,19 +225,6 @@ namespace comphelper return bRet; } - - template< class LISTENER, class EVENT > - inline bool OSimpleListenerContainer< LISTENER, EVENT >::implNotify( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener, - const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) - { - const EventClass& rTypedEvent( static_cast< const EventClass& >( _rEvent ) ); - ListenerClass* pTypedListener( static_cast< ListenerClass* >( _rxListener.get() ) ); - (pTypedListener->*m_pNotificationMethod)( rTypedEvent ); - return true; - } - - //= OListenerContainerBase /** is a specialization of OListenerContainer which saves you some additional type casts, @@ -267,10 +260,16 @@ namespace comphelper using OListenerContainer::impl_notify; protected: - inline virtual bool implNotify( + virtual bool implNotify( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener, const ::com::sun::star::lang::EventObject& _rEvent - ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE; + ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE + { + return implTypedNotify( + ::com::sun::star::uno::Reference< ListenerClass >( static_cast< ListenerClass* >( _rxListener.get() ) ), + static_cast< const EventClass& >( _rEvent ) + ); + } virtual bool implTypedNotify( const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener, @@ -278,18 +277,6 @@ namespace comphelper ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) = 0; }; - template< class LISTENER, class EVENT > - inline bool OListenerContainerBase< LISTENER, EVENT >::implNotify( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener, - const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) - { - return implTypedNotify( - ::com::sun::star::uno::Reference< ListenerClass >( static_cast< ListenerClass* >( _rxListener.get() ) ), - static_cast< const EventClass& >( _rEvent ) - ); - } - - } // namespace comphelper _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
