summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/shutdownicon.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 10:29:38 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 10:29:38 +0000
commit4e1edac3df8d6dfc72e3930fa882ea3b046bd703 (patch)
tree5c1484f395203db6b59dd7f590e6016cbdcc6f06 /sfx2/source/appl/shutdownicon.cxx
parent125572e1573d4ae8db86b706155925d888834bc0 (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'sfx2/source/appl/shutdownicon.cxx')
-rw-r--r--sfx2/source/appl/shutdownicon.cxx52
1 files changed, 29 insertions, 23 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 4ac4335695..1517e81c02 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shutdownicon.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: mav $ $Date: 2002-09-30 15:16:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 11:27:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,6 +64,7 @@
#include <app.hxx>
#include <vos/mutex.hxx>
#include <svtools/imagemgr.hxx>
+// #include <cmdlineargs.hxx>
#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
#include <com/sun/star/task/XInteractionHandler.hpp>
@@ -466,12 +467,15 @@ void ShutdownIcon::terminateDesktop()
getInstance()->m_xDesktop->removeTerminateListener( getInstance() );
// terminate desktop only if no tasks exist
- Reference < XFramesSupplier > xTasksSupplier( getInstance()->m_xDesktop, UNO_QUERY );
- if( xTasksSupplier.is() )
+ Reference < XFramesSupplier > xSupplier( getInstance()->m_xDesktop, UNO_QUERY );
+ if( xSupplier.is() )
{
- Reference < XElementAccess > xCont( xTasksSupplier->getFrames(), UNO_QUERY );
- if( !xCont->hasElements() )
- getInstance()->m_xDesktop->terminate();
+ Reference < XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
+ if( xTasks.is() )
+ {
+ if( xTasks->getCount()<1 )
+ getInstance()->m_xDesktop->terminate();
+ }
}
}
}
@@ -530,30 +534,32 @@ void SAL_CALL ShutdownIcon::initialize( const ::com::sun::star::uno::Sequence< :
if ( aArguments.getLength() > 0 )
{
- try
+ if ( !ShutdownIcon::pShutdownIcon )
{
- sal_Bool bQuickstart = sal_False;
- bQuickstart = ::cppu::any2bool( aArguments[0] );
- if( Application::IsRemoteServer() || ( !bQuickstart && !GetAutostart() ) )
- return;
+ try
+ {
+ sal_Bool bQuickstart = sal_False;
+ bQuickstart = ::cppu::any2bool( aArguments[0] );
+ if( Application::IsRemoteServer() || ( !bQuickstart && !GetAutostart() ) )
+ return;
- m_pResMgr = SFX_APP()->GetSfxResManager();
+ m_pResMgr = SFX_APP()->GetSfxResManager();
- m_xDesktop = Reference < XDesktop >( m_xServiceManager->createInstance(
- DEFINE_CONST_UNICODE( "com.sun.star.frame.Desktop" )),
- UNO_QUERY );
+ m_xDesktop = Reference < XDesktop >( m_xServiceManager->createInstance(
+ DEFINE_CONST_UNICODE( "com.sun.star.frame.Desktop" )),
+ UNO_QUERY );
- if ( !m_xDesktop.is() )
- return;
+ if ( !m_xDesktop.is() )
+ return;
- if ( !ShutdownIcon::pShutdownIcon )
ShutdownIcon::pShutdownIcon = this;
#ifdef WNT
- initSystray();
+ initSystray();
#endif
- }
- catch(const ::com::sun::star::lang::IllegalArgumentException&)
- {
+ }
+ catch(const ::com::sun::star::lang::IllegalArgumentException&)
+ {
+ }
}
}
}