diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-05-30 06:37:16 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-05-30 06:37:16 +0000 |
commit | 40027307141a8b195e49e409595e38453160ab3b (patch) | |
tree | 2fc07aedce9cffe65c776402669fe4c21989cbe0 /framework/source/services | |
parent | 793b85a512ea922a91a8530e0ff21799d0332295 (diff) |
INTEGRATION: CWS aquavcl07 (1.4.8); FILE MERGED
2008/05/09 09:01:03 pl 1.4.8.4: RESYNC: (1.5-1.6); FILE MERGED
2008/04/17 08:19:52 pl 1.4.8.3: fix a warning
2008/04/17 05:33:35 pl 1.4.8.2: RESYNC: (1.4-1.5); FILE MERGED
2008/04/15 18:13:38 pl 1.4.8.1: #i88308# dispatch asynchronously
Diffstat (limited to 'framework/source/services')
-rw-r--r-- | framework/source/services/backingwindow.cxx | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index b4c7c22b60..14800c29db 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: backingwindow.cxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.8 $ * * This file is part of OpenOffice.org. * @@ -39,6 +39,7 @@ #include "vcl/gradient.hxx" #include "vcl/mnemonic.hxx" #include "vcl/menu.hxx" +#include "vcl/svapp.hxx" #include "tools/urlobj.hxx" @@ -776,6 +777,40 @@ Window* BackingWindow::GetParentLabeledBy( const Window* pLabeled ) const return const_cast<Window*>(pRet); } +struct ImplDelayedDispatch +{ + Reference< XDispatch > xDispatch; + com::sun::star::util::URL aDispatchURL; + Sequence< PropertyValue > aArgs; + + ImplDelayedDispatch( const Reference< XDispatch >& i_xDispatch, + const com::sun::star::util::URL& i_rURL, + const Sequence< PropertyValue >& i_rArgs ) + : xDispatch( i_xDispatch ), + aDispatchURL( i_rURL ), + aArgs( i_rArgs ) + { + } + ~ImplDelayedDispatch() {} +}; + +static long implDispatchDelayed( void*, void* pArg ) +{ + struct ImplDelayedDispatch* pDispatch = reinterpret_cast<ImplDelayedDispatch*>(pArg); + try + { + pDispatch->xDispatch->dispatch( pDispatch->aDispatchURL, pDispatch->aArgs ); + } + catch( Exception ) + { + } + + // clean up + delete pDispatch; + + return 0; +} + void BackingWindow::dispatchURL( const rtl::OUString& i_rURL, const rtl::OUString& rTarget, const Reference< XDispatchProvider >& i_xProv, @@ -807,7 +842,12 @@ void BackingWindow::dispatchURL( const rtl::OUString& i_rURL, ); // dispatch the URL if ( xDispatch.is() ) - xDispatch->dispatch( aDispatchURL, i_rArgs ); + { + ImplDelayedDispatch* pDisp = new ImplDelayedDispatch( xDispatch, aDispatchURL, i_rArgs ); + ULONG nEventId = 0; + if( ! Application::PostUserEvent( nEventId, Link( NULL, implDispatchDelayed ), pDisp ) ) + delete pDisp; // event could not be posted for unknown reason, at least don't leak + } } catch ( com::sun::star::uno::RuntimeException& ) { |