summaryrefslogtreecommitdiff
path: root/basic/source/classes/sbxmod.cxx
diff options
context:
space:
mode:
authorNoel Power <npower@openoffice.org>2009-09-29 14:47:18 +0000
committerNoel Power <npower@openoffice.org>2009-09-29 14:47:18 +0000
commitcd14284ac4a632af647249ecbc067e6cc99b016f (patch)
tree1c2f34540b2edbed927d2f04c8f00748f01a4df6 /basic/source/classes/sbxmod.cxx
parent87c2bb06d4fceb098831b87d814cc31e87823ca4 (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/source/classes/sbxmod.cxx')
-rw-r--r--basic/source/classes/sbxmod.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 30c0299be4..c96f55c981 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;
}