diff options
author | Noel Power <npower@openoffice.org> | 2009-09-29 14:47:18 +0000 |
---|---|---|
committer | Noel Power <npower@openoffice.org> | 2009-09-29 14:47:18 +0000 |
commit | f212afb71b988cb4ca694aac303f6e4edf5ee1a6 (patch) | |
tree | e6a0fc3449968eee61cee3aa967ddad672d7c22f /basic | |
parent | 118c7e834667c41575754b79a9c0435106520e9e (diff) |
tweak VBAGlobals creation/insertion, also restore overwritten visibility
controls bits to moved ( erm delete and created in another director )
file. Add missing bits to enable Application.Quit and use preprocessor
to include some uncompiled code
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index b8c8447bf4af..2d5f4f7cdf89 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -119,6 +119,33 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ ) return 0L; } +#if 0 +bool UnlockControllerHack( StarBASIC* pBasic ) +{ + bool bRes = false; + if ( pBasic && pBasic->IsDocBasic() ) + { + uno::Any aUnoVar; + ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( "ThisComponent" ) ); + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( pBasic->Find( sVarName, SbxCLASS_DONTCARE ) ); + if ( pGlobs ) + aUnoVar = pGlobs->getUnoAny(); + uno::Reference< frame::XModel > xModel( aUnoVar, uno::UNO_QUERY); + if ( xModel.is() ) + { + try + { + xModel->unlockControllers(); + bRes = true; + } + catch( uno::Exception& ) + { + } + } + } + return bRes; +} +#endif ///////////////////////////////////////////////////////////////////////////// // Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen @@ -730,6 +757,13 @@ USHORT SbModule::Run( SbMethod* pMeth ) pINST->nCallLvl--; // Call-Level wieder runter StarBASIC::FatalError( SbERR_STACK_OVERFLOW ); } + + // VBA always ensure screenupdating is enabled after completing + StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent()); +#if 0 + if ( pBasic && pBasic->IsDocBasic() && !pINST ) + UnlockControllerHack( pBasic ); +#endif if( bDelInst ) { // #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, @@ -739,6 +773,11 @@ USHORT SbModule::Run( SbMethod* pMeth ) delete pINST; pINST = NULL; } + if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !pINST ) + { + Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ), NULL ); + } + return nRes; } |