diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx index 697954de0bc1..68cd57388bcd 100644 --- a/comphelper/source/misc/asyncnotification.cxx +++ b/comphelper/source/misc/asyncnotification.cxx @@ -173,6 +173,8 @@ namespace comphelper static std::vector> g_Notifiers; + template class EventHolder; + void JoinAsyncEventNotifiers() { std::vector> notifiers; diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx index 475b16c0b551..a5c678579253 100644 --- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx +++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx @@ -40,9 +40,6 @@ namespace dbaccess using namespace ::com::sun::star; - // DocumentEventHolder - typedef ::comphelper::EventHolder< DocumentEvent > DocumentEventHolder; - // DocumentEventNotifier_Impl class DocumentEventNotifier_Impl : public ::comphelper::IEventProcessor { @@ -218,7 +215,7 @@ namespace dbaccess ::comphelper::AsyncEventNotifierAutoJoin::launch(m_pEventBroadcaster); } } - m_pEventBroadcaster->addEvent( new DocumentEventHolder( _rEvent ), this ); + m_pEventBroadcaster->addEvent( new comphelper::DocumentEventHolder( _rEvent ), this ); } void DocumentEventNotifier_Impl::processEvent( const ::comphelper::AnyEvent& _rEvent ) @@ -229,7 +226,7 @@ namespace dbaccess if ( m_bDisposed ) return; } - const DocumentEventHolder& rEventHolder = dynamic_cast< const DocumentEventHolder& >( _rEvent ); + const comphelper::DocumentEventHolder& rEventHolder = dynamic_cast< const comphelper::DocumentEventHolder& >( _rEvent ); impl_notifyEvent_nothrow( rEventHolder.getEventObject() ); } diff --git a/include/comphelper/asyncnotification.hxx b/include/comphelper/asyncnotification.hxx index 16b36593b963..ae241e4bc997 100644 --- a/include/comphelper/asyncnotification.hxx +++ b/include/comphelper/asyncnotification.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -199,7 +200,7 @@ namespace comphelper /** AnyEvent derivee holding a foreign event instance */ template < typename EVENT_OBJECT > - class SAL_DLLPUBLIC_RTTI EventHolder final : public AnyEvent + class SAL_DLLPUBLIC_TEMPLATE EventHolder final : public AnyEvent { public: typedef EVENT_OBJECT EventObjectType; @@ -216,6 +217,9 @@ namespace comphelper const EventObjectType& getEventObject() const { return m_aEvent; } }; + extern template class EventHolder; + using DocumentEventHolder = EventHolder; + COMPHELPER_DLLPUBLIC void JoinAsyncEventNotifiers(); } // namespace comphelper