diff options
author | Mathias Bauer <mba@openoffice.org> | 2001-06-19 15:07:12 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2001-06-19 15:07:12 +0000 |
commit | be868fec8f94d14e4516d9081c5a11e0c7a0eead (patch) | |
tree | c05d43025cfe337edcb72d2ca614d8c1e715fa93 | |
parent | ce1ca3cc1209f2cce084ce2e48bc0f02d18fa67a (diff) |
#88443#: APPEAR event implemented
-rw-r--r-- | sfx2/source/appl/app.cxx | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index b12c43518286..d2b2ab1f58e3 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -2,9 +2,9 @@ * * $RCSfile: app.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: mba $ $Date: 2001-06-18 10:05:25 $ + * last change: $Author: mba $ $Date: 2001-06-19 16:07:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -163,6 +163,7 @@ #include <tools/isolang.hxx> #endif #include <basic/basmgr.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <appuno.hxx> #include "sfxhelp.hxx" @@ -587,6 +588,36 @@ void SfxApplication::HandleAppEvent( const ApplicationEvent& rAppEvent ) } } } + else if ( rAppEvent.GetEvent() == "APPEAR" ) + { + if( !pAppData_Impl->bInvisible ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTasksSupplier > + xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), + ::com::sun::star::uno::UNO_QUERY ); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTask > xTask = xDesktop->getActiveTask(); + if ( !xTask.is() ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > xList = xDesktop->getTasks()->createEnumeration(); + if( xList->hasMoreElements() ) + xList->nextElement() >>= xTask; + else + pAppData_Impl->bInvisible = TRUE; + } + + if ( xTask.is() ) + { + Window* pWindow = VCLUnoHelper::GetWindow( xTask->getContainerWindow() ); + pWindow->ToTop(); + } + } + + if( pAppData_Impl->bInvisible ) + { + pAppData_Impl->bInvisible = FALSE; + OpenClients(); + } + } } //-------------------------------------------------------------------- |