summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/appinit.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/appl/appinit.cxx')
-rw-r--r--sfx2/source/appl/appinit.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index d5f776b6e384..0a778788b7fc 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -21,6 +21,7 @@
#include <sfx2/app.hxx>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/frame/GlobalEventBroadcaster.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -111,14 +112,12 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
pApp->Get_Impl()->pAppDispatch->ReleaseAll();
pApp->Get_Impl()->pAppDispatch->release();
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance("com.sun.star.frame.GlobalEventBroadcaster"), css::uno::UNO_QUERY);
- if (xGlobalBroadcaster.is())
- {
- css::document::EventObject aEvent2;
- aEvent2.EventName = "OnCloseApp";
- xGlobalBroadcaster->notifyEvent(aEvent2);
- }
+ css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ css::uno::Reference< css::frame::XGlobalEventBroadcaster > xGlobalBroadcaster = css::frame::GlobalEventBroadcaster::create(xContext);
+
+ css::document::EventObject aEvent2;
+ aEvent2.EventName = "OnCloseApp";
+ xGlobalBroadcaster->notifyEvent(aEvent2);
delete pApp;
Application::Quit();