summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/appinit.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-11-04 14:49:08 +0000
committerKurt Zenker <kz@openoffice.org>2005-11-04 14:49:08 +0000
commitc2b2e3f19e4a7f30bd5c2f71e1fa3dcc2cc3ca83 (patch)
tree2de129e70a05ebd33cd9bb322f878c98f533d43f /sfx2/source/appl/appinit.cxx
parentbff1ee701fb596b61a190a97b16d6b657f5f25c1 (diff)
INTEGRATION: CWS fwk25 (1.50.28); FILE MERGED
2005/10/17 10:55:08 as 1.50.28.1: #126011# broadcast OnCloseApp event
Diffstat (limited to 'sfx2/source/appl/appinit.cxx')
-rw-r--r--sfx2/source/appl/appinit.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 89ef826b0d3e..b570d12961e3 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: appinit.cxx,v $
*
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
- * last change: $Author: kz $ $Date: 2005-11-03 12:05:19 $
+ * last change: $Author: kz $ $Date: 2005-11-04 15:49:08 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -148,6 +148,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star;
+namespace css = ::com::sun::star;
void doFirstTimeInit();
@@ -172,6 +173,9 @@ void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& aE
void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException )
{
+ static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER = ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster");
+ static ::rtl::OUString EVENT_QUIT_APP = ::rtl::OUString::createFromAscii("OnCloseApp");
+
Reference< XDesktop > xDesktop( aEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
@@ -184,6 +188,16 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
pApp->Get_Impl()->pAppDispatch->ReleaseAll();
pApp->Get_Impl()->pAppDispatch->release();
pApp->NotifyEvent(SfxEventHint( SFX_EVENT_CLOSEAPP) );
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+ css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance(SERVICE_GLOBALEVENTBROADCASTER), css::uno::UNO_QUERY);
+ if (xGlobalBroadcaster.is())
+ {
+ css::document::EventObject aEvent;
+ aEvent.EventName = EVENT_QUIT_APP;
+ xGlobalBroadcaster->notifyEvent(aEvent);
+ }
+
//pApp->Deinitialize();
delete pApp;
Application::Quit();