summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2001-11-05 06:18:26 +0000
committerCarsten Driesner <cd@openoffice.org>2001-11-05 06:18:26 +0000
commitaf78d4d6c4bb682944658248eb2ef475caf1cd27 (patch)
tree74fb446a15fe9cb498f48f4e3ae3a9422bb0fd6e /desktop/source
parent3a33ca881975dba7e5299a5ca461f2a7ec6d43fd (diff)
#88164# use dispatch watcher to watch slot URLs and shutdown office if necessary
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/app.cxx17
-rw-r--r--desktop/source/app/makefile.mk7
2 files changed, 19 insertions, 5 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 984182313617..b88808f707e9 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: app.cxx,v $
*
- * $Revision: 1.57 $
+ * $Revision: 1.58 $
*
- * last change: $Author: hr $ $Date: 2001-11-01 17:04:49 $
+ * last change: $Author: cd $ $Date: 2001-11-05 07:17:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,7 @@
#include "officeacceptthread.hxx"
#include "pluginacceptthread.hxx"
#include "desktopresid.hxx"
+#include "dispatchwatcher.hxx"
#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
#include <com/sun/star/frame/XStorable.hpp>
@@ -1206,6 +1207,7 @@ void Desktop::Main()
Reference< XConnectionBroker > xServiceManagerBroker;
Reference< XConnectionBroker > xPalmPilotManagerBroker;
+ Reference< XStatusListener > xDispatchWatcherStatusListener;
InitTestToolLib();
@@ -1268,6 +1270,9 @@ void Desktop::Main()
UNO_QUERY );
if ( xDesktop.is() )
xDesktop->addTerminateListener( new OfficeIPCThreadController );
+
+ // Create dispatch watcher service to control dispatches of "dangerous" slot: URLs
+ xDispatchWatcherStatusListener = DispatchWatcher::GetDispatchWatcher();
}
// Release solar mutex just before we wait for our client to connect
@@ -1687,7 +1692,15 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
xDispatcher = xProvider->queryDispatch( aURL, ::rtl::OUString(), 0 );
if( xDispatcher.is() == sal_True )
+ {
+ // Special case: Start template wizard!
+ // We have to be listener to catch errors during dispatching this slot-URL.
+ // Otherwise it would be possible to have an office running without an open
+ // window!!
+ if ( aName.CompareToAscii( "slot:5500" ) == COMPARE_EQUAL )
+ xDispatcher->addStatusListener( DispatchWatcher::GetDispatchWatcher(), aURL );
xDispatcher->dispatch( aURL, aArgs );
+ }
}
else
{
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index cbf4db0fae33..2065666ac27a 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: vg $ $Date: 2001-10-16 17:16:54 $
+# last change: $Author: cd $ $Date: 2001-11-05 07:17:36 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -93,7 +93,8 @@ OBJFILES = \
$(OBJ)$/oinstanceprovider.obj \
$(OBJ)$/opluginframefactory.obj \
$(OBJ)$/appsys.obj \
- $(OBJ)$/desktopresid.obj
+ $(OBJ)$/desktopresid.obj \
+ $(OBJ)$/dispatchwatcher.obj
SRC1FILES= desktop.src
SRS1NAME= desktop