diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-17 15:00:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-24 17:59:30 +0200 |
commit | 13bedc55b1d533eadcfd4932ef57076e3642caaf (patch) | |
tree | 5133f5888e3e7abaf5b83093f0c24b1d274c2d42 /framework | |
parent | Related fdo#46808: Improve previous commit slightly (diff) | |
download | core-13bedc55b1d533eadcfd4932ef57076e3642caaf.tar.gz core-13bedc55b1d533eadcfd4932ef57076e3642caaf.zip |
fdo#46808, use service constructor for frame::GlobalEventBroadcaster
Add document::XEventBroadcaster interface to XGlobalEventBroadcaster,
because a client uses it, and the service always implements it.
This is safe to do because we haven't released an LO version with
XGlobalEventBroadcaster in it yet.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/services.h | 1 | ||||
-rw-r--r-- | framework/inc/services/autorecovery.hxx | 3 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h index 7d30422db854..cfbee13ab804 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -81,7 +81,6 @@ namespace framework{ #define SERVICENAME_TOOLBARCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.ToolBarControllerFactory" ) #define SERVICENAME_LICENSE SERVICENAME_JOB #define SERVICENAME_AUTORECOVERY DECLARE_ASCII("com.sun.star.frame.AutoRecovery" ) -#define SERVICENAME_GLOBALEVENTBROADCASTER DECLARE_ASCII("com.sun.star.frame.GlobalEventBroadcaster" ) #define SERVICENAME_STATUSBARFACTORY DECLARE_ASCII("com.sun.star.ui.StatusBarFactory" ) #define SERVICENAME_UICATEGORYDESCRIPTION DECLARE_ASCII("com.sun.star.ui.UICategoryDescription" ) #define SERVICENAME_STATUSBARCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.StatusbarControllerFactory" ) diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx index 9f7c61c681c8..94347a0050ab 100644 --- a/framework/inc/services/autorecovery.hxx +++ b/framework/inc/services/autorecovery.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/document/XEventListener.hpp> @@ -344,7 +345,7 @@ class AutoRecovery : public css::lang::XTypeProvider /** @short holds the global event broadcaster alive, where we listen for new created documents. */ - css::uno::Reference< css::document::XEventBroadcaster > m_xNewDocBroadcaster; + css::uno::Reference< css::frame::XGlobalEventBroadcaster > m_xNewDocBroadcaster; //--------------------------------------- /** @short proxy weak binding to forward Events to ourself without diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 6390970898e7..d6928eb28533 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/ucb/NameClash.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XLoadable.hpp> #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/frame/ModuleManager.hpp> @@ -1365,7 +1366,7 @@ void AutoRecovery::implts_startListening() ReadGuard aReadLock(m_aLock); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::util::XChangesNotifier > xCFG (m_xRecoveryCFG, css::uno::UNO_QUERY); - css::uno::Reference< css::document::XEventBroadcaster > xBroadcaster = m_xNewDocBroadcaster; + css::uno::Reference< css::frame::XGlobalEventBroadcaster > xBroadcaster = m_xNewDocBroadcaster; sal_Bool bListenForDocEvents = m_bListenForDocEvents; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -1382,7 +1383,7 @@ void AutoRecovery::implts_startListening() if (!xBroadcaster.is()) { - xBroadcaster = css::uno::Reference< css::document::XEventBroadcaster >(xSMGR->createInstance(SERVICENAME_GLOBALEVENTBROADCASTER), css::uno::UNO_QUERY_THROW); + xBroadcaster = css::frame::GlobalEventBroadcaster::create( comphelper::getComponentContext(xSMGR) ); // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); m_xNewDocBroadcaster = xBroadcaster; |