diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2005-02-02 12:45:19 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2005-02-02 12:45:19 +0000 |
commit | c6eb044c6d7fe1cb30a50c4d9810d4fb7f673f87 (patch) | |
tree | ba28aaf7cc0fc68adc5b889be0f99ddfd56ef3d4 /desktop | |
parent | 66d1c1297864b37520530255571de1a352d00264 (diff) |
INTEGRATION: CWS imprec01 (1.162.12); FILE MERGED
2005/01/24 09:43:44 lo 1.162.12.3: disable session manager
2005/01/21 11:00:10 lo 1.162.12.2: #i34170# combine session management and autorecovery
2005/01/12 08:33:32 as 1.162.12.1: #i39434# trigger event OnStartApp manually from Desktop::Main()
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cddb424c71fa..844b5b63b867 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2,9 +2,9 @@ * * $RCSfile: app.cxx,v $ * - * $Revision: 1.165 $ + * $Revision: 1.166 $ * - * last change: $Author: rt $ $Date: 2005-01-31 09:29:39 $ + * last change: $Author: rt $ $Date: 2005-02-02 13:45:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ #include "javainteractionhandler.hxx" #include "../migration/wizard.hxx" +#ifndef _COM_SUN_STAR_FRAME_XSESSIONMANAGERLISTENER_HPP_ +#include <com/sun/star/frame/XSessionManagerListener.hpp> +#endif #ifndef _COM_SUN_STAR_FRAME_XSYNCHRONOUSDISPATCH_HPP_ #include <com/sun/star/frame/XSynchronousDispatch.hpp> #endif @@ -189,6 +192,9 @@ #ifndef _COM_SUN_STAR_TASK_XJOB_HPP_ #include <com/sun/star/task/XJob.hpp> #endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_ +#include <com/sun/star/document/XEventListener.hpp> +#endif #include <com/sun/star/java/XJavaVM.hpp> @@ -1473,7 +1479,7 @@ void Desktop::Main() Resource::SetResManager( pOffResMgr ); // create service for loadin SFX (still needed in startup) - Reference < XInterface >( xSMgr->createInstance( + Reference < css::document::XEventListener > xGlobalBroadcaster( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); // initialize test-tool library (if available) @@ -1488,6 +1494,13 @@ void Desktop::Main() return; } + if (xGlobalBroadcaster.is()) + { + css::document::EventObject aEvent; + aEvent.EventName = ::rtl::OUString::createFromAscii("OnStartApp"); + xGlobalBroadcaster->notifyEvent(aEvent); + } + SetSplashScreenProgress(50); // Backing Component @@ -2023,6 +2036,30 @@ void Desktop::OpenClients() if ( xList->hasElements() ) bLoaded = sal_True; } + + // session management +#if 0 + // disabled + try + { + Reference< XInitialization > aListener(::comphelper::getProcessServiceFactory()->createInstance( + OUString::createFromAscii("com.sun.star.frame.SessionListener")), UNO_QUERY); + if (aListener.is()) + { + aListener->initialize(Sequence< Any >(0)); + Reference< XSessionManagerListener > r(aListener, UNO_QUERY); + if (r.is() && !bLoaded) + bLoaded = r->doRestore(); + } + } + catch (com::sun::star::uno::Exception& e) + { + OUString aMessage = OUString::createFromAscii("Error in session management\n") + + e.Message; + OSL_ENSURE(sal_False, OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr()); + } +#endif + } if ( !pArgs->IsServer() ) |