diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-27 10:19:04 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-27 10:30:42 +0200 |
commit | 272f0e97b12e634cdf49a1bff45e1b9068af7d9c (patch) | |
tree | d3ba7bf2885c4d5e2285caf3bb89aaedacc08a4c /sfx2 | |
parent | fdo#46808, Adapt frame::GlobalEventBroadcaster UNO service to new style (diff) | |
download | core-272f0e97b12e634cdf49a1bff45e1b9068af7d9c.tar.gz core-272f0e97b12e634cdf49a1bff45e1b9068af7d9c.zip |
Improvements on previous commit
* Made XGlobalEventBroadcaster inherit document::XDocumentEventBroadcaster/
Listener replacements for obsolete document::XEventBroadcaster/Listener. This
means some client sides unfortunately still need to use UNO_QUERY_THROW to
obtain the obsolete interfaces; those client sides should be cleaned up to use
the replacement interfaces instead.
* Added @since tag (even to unpublished entities, on "it doesn't hurt" grounds).
* Made client sides use XGlobalEventBroadcaster directly instead of querying for
its super-interfaces.
* Replaced new uses of comphelper::ComponentContext::getUNOContext with
comphelper::getComponentContext (see 03a9f139bd9ea1a4f9096fc982e6b326def58532
"ComponentContext::getUnoContext -> getComponentContext simplification;" I
intend to get rid of comphelper/componentcontext.hxx much sooner than of
comphelper/processfactory.hxx).
Change-Id: I6d971ebdaea83d0c3fa9ba299fb6b37e58cdfe9b
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appinit.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/eventsupplier.hxx | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 0a778788b7fc..4d53e49d5fc5 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -113,7 +113,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a pApp->Get_Impl()->pAppDispatch->release(); css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - css::uno::Reference< css::frame::XGlobalEventBroadcaster > xGlobalBroadcaster = css::frame::GlobalEventBroadcaster::create(xContext); + css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(css::frame::GlobalEventBroadcaster::create(xContext), css::uno::UNO_QUERY_THROW); css::document::EventObject aEvent2; aEvent2.EventName = "OnCloseApp"; diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index 6bd1f284ee36..a7aefd20753b 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/container/XSet.hpp> #include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XEventBroadcaster.hpp> -#include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <com/sun/star/document/XDocumentEventListener.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/frame/XGlobalEventBroadcaster.hpp> @@ -38,7 +37,6 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> -#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase4.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequenceasvector.hxx> @@ -172,11 +170,12 @@ class ModelCollectionEnumeration : public ModelCollectionMutexBase }; //============================================================================= +//TODO: remove support of obsolete document::XEventBroadcaster/Listener class SfxGlobalEvents_Impl : public ModelCollectionMutexBase , public ::cppu::WeakImplHelper4< ::com::sun::star::lang::XServiceInfo , ::com::sun::star::frame::XGlobalEventBroadcaster - , ::com::sun::star::document::XDocumentEventBroadcaster - , ::com::sun::star::document::XDocumentEventListener + , ::com::sun::star::document::XEventBroadcaster + , ::com::sun::star::document::XEventListener > { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMGR; |