From 9a7e3bb552d4c2078353e0e9496c0eaf27d21b82 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Thu, 27 Jan 2005 09:18:43 +0000 Subject: INTEGRATION: CWS cd04 (1.27.174); FILE MERGED 2005/01/25 10:20:52 cd 1.27.174.1: #i40980# Use asynchronous dispatch to fix VCL reentrance problem --- sfx2/source/inet/inettbc.cxx | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'sfx2/source/inet/inettbc.cxx') diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 75a5d9e8d272..046988648282 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: inettbc.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: rt $ $Date: 2004-09-09 09:55:13 $ + * last change: $Author: rt $ $Date: 2005-01-27 10:18:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -189,11 +189,35 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, BOOL bNew ) const aArgs[3].Value = makeAny( OUString( aFilter )); } - xDispatch->dispatch( aTargetURL, aArgs ); + SfxURLToolBoxControl_Impl::ExecuteInfo* pExecuteInfo = new SfxURLToolBoxControl_Impl::ExecuteInfo; + pExecuteInfo->xDispatch = xDispatch; + pExecuteInfo->aTargetURL = aTargetURL; + pExecuteInfo->aArgs = aArgs; + Application::PostUserEvent( STATIC_LINK( 0, SfxURLToolBoxControl_Impl, ExecuteHdl_Impl), pExecuteInfo ); } } } +//-------------------------------------------------------------------- + +IMPL_STATIC_LINK( SfxURLToolBoxControl_Impl, ExecuteHdl_Impl, ExecuteInfo*, pExecuteInfo ) +{ + try + { + // Asynchronous execution as this can lead to our own destruction! + // Framework can recycle our current frame and the layout manager disposes all user interface + // elements if a component gets detached from its frame! + pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs ); + } + catch ( Exception& ) + { + } + + delete pExecuteInfo; + return 0; +} + + Window* SfxURLToolBoxControl_Impl::CreateItemWindow( Window* pParent ) { SvtURLBox* pURLBox = new SvtURLBox( pParent ); -- cgit