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 | |
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
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 39 | ||||
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 11 |
2 files changed, 46 insertions, 4 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; } diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 3a6c6ec8d1b5..c0169f7a490c 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -189,14 +189,17 @@ void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeE sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException) { - uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW ); - return xWindow2->isVisible(); + sal_Bool bVisible( sal_True ); + m_xProps->getPropertyValue + (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) )) >>= bVisible; + return bVisible; } void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) { - uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW ); - xWindow2->setVisible( bVisible ); + uno::Any aValue( bVisible ); + m_xProps->setPropertyValue + (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ), aValue); } double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException) { |