diff options
Diffstat (limited to 'dbaccess/source/ui/inc/sbamultiplex.hxx')
-rw-r--r-- | dbaccess/source/ui/inc/sbamultiplex.hxx | 450 |
1 files changed, 225 insertions, 225 deletions
diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx index 0fe8ba96aae6..23d5035f0594 100644 --- a/dbaccess/source/ui/inc/sbamultiplex.hxx +++ b/dbaccess/source/ui/inc/sbamultiplex.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,7 @@ namespace dbaui class OSbaWeakSubObject : public ::cppu::OWeakObject { protected: - ::cppu::OWeakObject& m_rParent; + ::cppu::OWeakObject& m_rParent; public: OSbaWeakSubObject(::cppu::OWeakObject& rParent) : m_rParent(rParent) { } @@ -72,132 +72,132 @@ namespace dbaui //------------------------------------------------------------------ // declaration of a listener multiplexer class - #define BEGIN_DECLARE_LISTENER_MULTIPLEXER(classname, listenerclass) \ - class classname \ - :public OSbaWeakSubObject \ - ,public listenerclass \ - ,public ::cppu::OInterfaceContainerHelper \ - { \ - public: \ - classname( ::cppu::OWeakObject& rSource, \ - ::osl::Mutex& rMutex); \ - DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject); \ - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( \ + #define BEGIN_DECLARE_LISTENER_MULTIPLEXER(classname, listenerclass) \ + class classname \ + :public OSbaWeakSubObject \ + ,public listenerclass \ + ,public ::cppu::OInterfaceContainerHelper \ + { \ + public: \ + classname( ::cppu::OWeakObject& rSource, \ + ::osl::Mutex& rMutex); \ + DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject); \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( \ const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); \ \ - /* ::com::sun::star::lang::XEventListener */ \ - virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException); \ + /* ::com::sun::star::lang::XEventListener */ \ + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException); \ - #define DECLARE_MULTIPLEXER_VOID_METHOD(methodname, eventtype) \ + #define DECLARE_MULTIPLEXER_VOID_METHOD(methodname, eventtype) \ virtual void SAL_CALL methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException); \ - #define DECLARE_MULTIPLEXER_BOOL_METHOD(methodname, eventtype) \ - virtual sal_Bool SAL_CALL methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException); \ + #define DECLARE_MULTIPLEXER_BOOL_METHOD(methodname, eventtype) \ + virtual sal_Bool SAL_CALL methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException); \ - #define END_DECLARE_LISTENER_MULTIPLEXER() \ - /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators */ \ - void * SAL_CALL operator new( size_t size ) throw() { return OSbaWeakSubObject::operator new(size); } \ - void SAL_CALL operator delete( void * p ) throw() { OSbaWeakSubObject::operator delete(p); } \ - }; \ + #define END_DECLARE_LISTENER_MULTIPLEXER() \ + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators */ \ + void * SAL_CALL operator new( size_t size ) throw() { return OSbaWeakSubObject::operator new(size); } \ + void SAL_CALL operator delete( void * p ) throw() { OSbaWeakSubObject::operator delete(p); } \ + }; \ //------------------------------------------------------------------ // implementation of a listener multiplexer class - #define IMPLEMENT_LISTENER_MULTIPLEXER_CORE(classname, listenerclass) \ + #define IMPLEMENT_LISTENER_MULTIPLEXER_CORE(classname, listenerclass) \ \ - /*................................................................*/ \ - classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \ - :OSbaWeakSubObject(rSource) \ - ,OInterfaceContainerHelper(_rMutex) \ - { \ - } \ + /*................................................................*/ \ + classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \ + :OSbaWeakSubObject(rSource) \ + ,OInterfaceContainerHelper(_rMutex) \ + { \ + } \ \ - ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( \ + ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( \ const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \ - { \ - ::com::sun::star::uno::Any aReturn = \ - OSbaWeakSubObject::queryInterface(_rType); \ - if (!aReturn.hasValue()) \ - aReturn = ::cppu::queryInterface(_rType, \ - static_cast< listenerclass* >(this), \ - static_cast< ::com::sun::star::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ - ); \ + { \ + ::com::sun::star::uno::Any aReturn = \ + OSbaWeakSubObject::queryInterface(_rType); \ + if (!aReturn.hasValue()) \ + aReturn = ::cppu::queryInterface(_rType, \ + static_cast< listenerclass* >(this), \ + static_cast< ::com::sun::star::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ + ); \ \ - return aReturn; \ - } \ - /*................................................................*/ \ + return aReturn; \ + } \ + /*................................................................*/ \ void SAL_CALL classname::disposing(const ::com::sun::star::lang::EventObject& ) throw(::com::sun::star::uno::RuntimeException)\ - { \ - } \ - - - #define IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(classname, listenerclass, methodname, eventtype) \ - void SAL_CALL classname::methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(*this); \ - while (aIt.hasMoreElements()) \ - static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - } \ - - #define IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(classname, listenerclass, methodname, eventtype) \ - /*................................................................*/ \ - sal_Bool SAL_CALL classname::methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(*this); \ - sal_Bool bResult = sal_True; \ - while (bResult && aIt.hasMoreElements()) \ - bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - return bResult; \ - } \ + { \ + } \ + + + #define IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(classname, listenerclass, methodname, eventtype) \ + void SAL_CALL classname::methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException) \ + { \ + eventtype aMulti(e); \ + aMulti.Source = &m_rParent; \ + ::cppu::OInterfaceIteratorHelper aIt(*this); \ + while (aIt.hasMoreElements()) \ + static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ + } \ + + #define IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(classname, listenerclass, methodname, eventtype) \ + /*................................................................*/ \ + sal_Bool SAL_CALL classname::methodname(const eventtype& e) throw (::com::sun::star::uno::RuntimeException) \ + { \ + eventtype aMulti(e); \ + aMulti.Source = &m_rParent; \ + ::cppu::OInterfaceIteratorHelper aIt(*this); \ + sal_Bool bResult = sal_True; \ + while (bResult && aIt.hasMoreElements()) \ + bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ + return bResult; \ + } \ //------------------------------------------------------------------ // helper for classes which do event multiplexing #define IMPLEMENT_LISTENER_ADMINISTRATION(classname, listenernamespace, listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - /*................................................................*/ \ + /*................................................................*/ \ void SAL_CALL classname::add##listenerdesc(const ::com::sun::star::uno::Reference< ::com::sun::star::listenernamespace::X##listenerdesc >& l) throw(::com::sun::star::uno::RuntimeException)\ - { \ - multiplexer.addInterface(l); \ - if (multiplexer.getLength() == 1) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(&multiplexer); \ - } \ - } \ - /*................................................................*/ \ + { \ + multiplexer.addInterface(l); \ + if (multiplexer.getLength() == 1) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->add##listenerdesc(&multiplexer); \ + } \ + } \ + /*................................................................*/ \ void SAL_CALL classname::remove##listenerdesc(const ::com::sun::star::uno::Reference< ::com::sun::star::listenernamespace::X##listenerdesc >& l) throw(::com::sun::star::uno::RuntimeException)\ - { \ - if (multiplexer.getLength() == 1) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(&multiplexer); \ - } \ - multiplexer.removeInterface(l); \ - } \ + { \ + if (multiplexer.getLength() == 1) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->remove##listenerdesc(&multiplexer); \ + } \ + multiplexer.removeInterface(l); \ + } \ #define STOP_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - if (multiplexer.getLength()) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(&multiplexer); \ - } \ + if (multiplexer.getLength()) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->remove##listenerdesc(&multiplexer); \ + } \ #define START_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - if (multiplexer.getLength()) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(&multiplexer); \ - } \ + if (multiplexer.getLength()) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->add##listenerdesc(&multiplexer); \ + } \ @@ -205,160 +205,160 @@ namespace dbaui // declaration of property listener multiplexers // (with support for specialized and unspecialized property listeners) - #define DECLARE_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype, exceptions) \ - class classname \ - :public OSbaWeakSubObject \ - ,public listenerclass \ - { \ - typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< \ - ::rtl::OUString, ::comphelper::UStringHash, ::comphelper::UStringEqual > ListenerContainerMap; \ - ListenerContainerMap m_aListeners; \ + #define DECLARE_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype, exceptions) \ + class classname \ + :public OSbaWeakSubObject \ + ,public listenerclass \ + { \ + typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< \ + ::rtl::OUString, ::comphelper::UStringHash, ::comphelper::UStringEqual > ListenerContainerMap; \ + ListenerContainerMap m_aListeners; \ \ - public: \ - classname( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); \ - DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject); \ - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( \ + public: \ + classname( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); \ + DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject); \ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( \ const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); \ \ - /* ::com::sun::star::lang::XEventListener */ \ - virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException); \ + /* ::com::sun::star::lang::XEventListener */ \ + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException); \ \ - virtual void SAL_CALL methodname(const eventtype& e) throw exceptions; \ + virtual void SAL_CALL methodname(const eventtype& e) throw exceptions; \ \ - public: \ - void addInterface(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rListener); \ - void removeInterface(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rListener); \ + public: \ + void addInterface(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rListener); \ + void removeInterface(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rListener); \ \ - void disposeAndClear(); \ + void disposeAndClear(); \ \ - sal_Int32 getOverallLen() const; \ + sal_Int32 getOverallLen() const; \ \ - ::cppu::OInterfaceContainerHelper* getContainer(const ::rtl::OUString& rName) \ - { return m_aListeners.getContainer(rName); } \ + ::cppu::OInterfaceContainerHelper* getContainer(const ::rtl::OUString& rName) \ + { return m_aListeners.getContainer(rName); } \ \ - protected: \ - void Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e); \ - }; \ + protected: \ + void Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e); \ + }; \ //------------------------------------------------------------------ // implementation of property listener multiplexers - #define IMPLEMENT_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype, exceptions) \ - /*................................................................*/ \ - classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex) \ - :OSbaWeakSubObject(rSource) \ - ,m_aListeners(rMutex) \ - { \ - } \ + #define IMPLEMENT_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype, exceptions) \ + /*................................................................*/ \ + classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex) \ + :OSbaWeakSubObject(rSource) \ + ,m_aListeners(rMutex) \ + { \ + } \ \ - ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( \ + ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( \ const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \ - { \ - ::com::sun::star::uno::Any aReturn = \ - OSbaWeakSubObject::queryInterface(_rType); \ - if (!aReturn.hasValue()) \ - aReturn = ::cppu::queryInterface(_rType, \ - static_cast< listenerclass* >(this), \ - static_cast< ::com::sun::star::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ - ); \ + { \ + ::com::sun::star::uno::Any aReturn = \ + OSbaWeakSubObject::queryInterface(_rType); \ + if (!aReturn.hasValue()) \ + aReturn = ::cppu::queryInterface(_rType, \ + static_cast< listenerclass* >(this), \ + static_cast< ::com::sun::star::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ + ); \ \ - return aReturn; \ - } \ - /*................................................................*/ \ + return aReturn; \ + } \ + /*................................................................*/ \ void SAL_CALL classname::disposing(const ::com::sun::star::lang::EventObject& ) throw(::com::sun::star::uno::RuntimeException)\ - { \ - } \ + { \ + } \ \ - void SAL_CALL classname::methodname(const eventtype& e) throw exceptions \ - { \ - ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(e.PropertyName); \ - if (pListeners) \ - Notify(*pListeners, e); \ + void SAL_CALL classname::methodname(const eventtype& e) throw exceptions \ + { \ + ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(e.PropertyName); \ + if (pListeners) \ + Notify(*pListeners, e); \ \ - /* do the notification for the unspecialized listeners, too */ \ - pListeners = m_aListeners.getContainer(::rtl::OUString()); \ - if (pListeners) \ - Notify(*pListeners, e); \ - } \ + /* do the notification for the unspecialized listeners, too */ \ + pListeners = m_aListeners.getContainer(::rtl::OUString()); \ + if (pListeners) \ + Notify(*pListeners, e); \ + } \ \ - void classname::addInterface(const ::rtl::OUString& rName, \ - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener) \ - { \ - m_aListeners.addInterface(rName, rListener); \ - } \ + void classname::addInterface(const ::rtl::OUString& rName, \ + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener) \ + { \ + m_aListeners.addInterface(rName, rListener); \ + } \ \ - void classname::removeInterface(const ::rtl::OUString& rName, \ - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener) \ - { \ - m_aListeners.removeInterface(rName, rListener); \ - } \ + void classname::removeInterface(const ::rtl::OUString& rName, \ + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rListener) \ + { \ + m_aListeners.removeInterface(rName, rListener); \ + } \ \ - void classname::disposeAndClear() \ - { \ - ::com::sun::star::lang::EventObject aEvt(m_rParent); \ - m_aListeners.disposeAndClear(aEvt); \ - } \ + void classname::disposeAndClear() \ + { \ + ::com::sun::star::lang::EventObject aEvt(m_rParent); \ + m_aListeners.disposeAndClear(aEvt); \ + } \ \ - sal_Int32 classname::getOverallLen() const \ - { \ - sal_Int32 nLen = 0; \ - ::com::sun::star::uno::Sequence< ::rtl::OUString > aContained = m_aListeners.getContainedTypes(); \ - const ::rtl::OUString* pContained = aContained.getConstArray(); \ - for ( sal_Int32 i=0; i<aContained.getLength(); ++i, ++pContained) \ - nLen += m_aListeners.getContainer(*pContained)->getLength(); \ - return nLen; \ - } \ + sal_Int32 classname::getOverallLen() const \ + { \ + sal_Int32 nLen = 0; \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aContained = m_aListeners.getContainedTypes(); \ + const ::rtl::OUString* pContained = aContained.getConstArray(); \ + for ( sal_Int32 i=0; i<aContained.getLength(); ++i, ++pContained) \ + nLen += m_aListeners.getContainer(*pContained)->getLength(); \ + return nLen; \ + } \ \ - void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(rListeners); \ - while (aIt.hasMoreElements()) \ - static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - } \ + void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e) \ + { \ + eventtype aMulti(e); \ + aMulti.Source = &m_rParent; \ + ::cppu::OInterfaceIteratorHelper aIt(rListeners); \ + while (aIt.hasMoreElements()) \ + static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ + } \ //------------------------------------------------------------------ // helper for classes which do property event multiplexing #define IMPLEMENT_PROPERTY_LISTENER_ADMINISTRATION(classname, listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - /*................................................................*/ \ + /*................................................................*/ \ void SAL_CALL classname::add##listenerdesc(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::X##listenerdesc >& l ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)\ - { \ - multiplexer.addInterface(rName, l); \ - if (multiplexer.getOverallLen() == 1) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(::rtl::OUString(), &multiplexer); \ - } \ - } \ - /*................................................................*/ \ + { \ + multiplexer.addInterface(rName, l); \ + if (multiplexer.getOverallLen() == 1) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->add##listenerdesc(::rtl::OUString(), &multiplexer); \ + } \ + } \ + /*................................................................*/ \ void SAL_CALL classname::remove##listenerdesc(const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::X##listenerdesc >& l ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)\ - { \ - if (multiplexer.getOverallLen() == 1) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(::rtl::OUString(), &multiplexer); \ - } \ - multiplexer.removeInterface(rName, l); \ - } \ + { \ + if (multiplexer.getOverallLen() == 1) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->remove##listenerdesc(::rtl::OUString(), &multiplexer); \ + } \ + multiplexer.removeInterface(rName, l); \ + } \ #define STOP_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - if (multiplexer.getOverallLen()) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(::rtl::OUString(), &multiplexer); \ - } \ + if (multiplexer.getOverallLen()) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->remove##listenerdesc(::rtl::OUString(), &multiplexer); \ + } \ #define START_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, braodcasterclass, broadcaster) \ - if (multiplexer.getOverallLen()) \ - { \ - ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(::rtl::OUString(), &multiplexer); \ - } \ + if (multiplexer.getOverallLen()) \ + { \ + ::com::sun::star::uno::Reference< braodcasterclass > xBroadcaster(broadcaster, ::com::sun::star::uno::UNO_QUERY); \ + if (xBroadcaster.is()) \ + xBroadcaster->add##listenerdesc(::rtl::OUString(), &multiplexer); \ + } \ @@ -370,8 +370,8 @@ namespace dbaui DECLARE_MULTIPLEXER_VOID_METHOD(statusChanged, ::com::sun::star::frame::FeatureStateEvent) private: - ::com::sun::star::frame::FeatureStateEvent m_aLastKnownStatus; - public: \ + ::com::sun::star::frame::FeatureStateEvent m_aLastKnownStatus; + public: \ inline ::com::sun::star::frame::FeatureStateEvent getLastEvent( ) const { return m_aLastKnownStatus; } END_DECLARE_LISTENER_MULTIPLEXER() @@ -404,19 +404,19 @@ namespace dbaui BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetMultiplexer, ::com::sun::star::sdbc::XRowSetListener) DECLARE_MULTIPLEXER_VOID_METHOD(cursorMoved, ::com::sun::star::lang::EventObject) DECLARE_MULTIPLEXER_VOID_METHOD(rowChanged, ::com::sun::star::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(rowSetChanged, ::com::sun::star::lang::EventObject) + DECLARE_MULTIPLEXER_VOID_METHOD(rowSetChanged, ::com::sun::star::lang::EventObject) END_DECLARE_LISTENER_MULTIPLEXER() // ::com::sun::star::sdb::XRowSetApproveListener BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetApproveMultiplexer, ::com::sun::star::sdb::XRowSetApproveListener) DECLARE_MULTIPLEXER_BOOL_METHOD(approveCursorMove, ::com::sun::star::lang::EventObject) DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowChange, ::com::sun::star::sdb::RowChangeEvent) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowSetChange, ::com::sun::star::lang::EventObject) + DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowSetChange, ::com::sun::star::lang::EventObject) END_DECLARE_LISTENER_MULTIPLEXER() // ::com::sun::star::sdb::XSQLErrorListener BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXSQLErrorMultiplexer, ::com::sun::star::sdb::XSQLErrorListener) - DECLARE_MULTIPLEXER_VOID_METHOD(errorOccured, ::com::sun::star::sdb::SQLErrorEvent) + DECLARE_MULTIPLEXER_VOID_METHOD(errorOccured, ::com::sun::star::sdb::SQLErrorEvent) END_DECLARE_LISTENER_MULTIPLEXER() // ::com::sun::star::beans::XPropertyChangeListener |