diff options
author | Noel Power <npower@openoffice.org> | 2009-09-18 15:24:22 +0000 |
---|---|---|
committer | Noel Power <npower@openoffice.org> | 2009-09-18 15:24:22 +0000 |
commit | 4cea79ccdfde2c25b376ca46fdcbe3e91e2405ec (patch) | |
tree | f7156472b9939e17e6fbaae57cd89e133307b403 /basic/source/classes/sb.cxx | |
parent | Create DEV300_m58 milestone tag from trunk@276042 (diff) | |
download | core-4cea79ccdfde2c25b376ca46fdcbe3e91e2405ec.tar.gz core-4cea79ccdfde2c25b376ca46fdcbe3e91e2405ec.zip |
initial commit of code reorg, existing files that are modified
Diffstat (limited to 'basic/source/classes/sb.cxx')
-rw-r--r-- | basic/source/classes/sb.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 7ff7cb76c7c5..7436c8361da9 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -65,7 +65,29 @@ SV_IMPL_VARARR(SbTextPortions,SbTextPortion) TYPEINIT1(StarBASIC,SbxObject) #define RTLNAME "@SBRTL" +// i#i68894# +const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); +const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); + +SbxObject* StarBASIC::getVBAGlobals( ) +{ + if ( !pVBAGlobals ) + pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE ); + return pVBAGlobals; +} + +// i#i68894# +SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t ) +{ + if( rName == aThisComponent ) + return NULL; + // rename to init globals + if ( getVBAGlobals( ) ) + return pVBAGlobals->Find( rName, t ); + return NULL; + +} // Create array for conversion SFX <-> VB error code struct SFX_VB_ErrorItem { @@ -654,6 +676,8 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this ); // Search via StarBasic is always global SetFlag( SBX_GBLSEARCH ); + pVBAGlobals = NULL; + bQuit = FALSE; } // #51727 Override SetModified so that the modified state @@ -968,6 +992,12 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy return pVar; } +void StarBASIC::QuitAndExitApplication() +{ + Stop(); + bQuit = TRUE; +} + void StarBASIC::Stop() { SbiInstance* p = pINST; @@ -1506,6 +1536,18 @@ BOOL StarBASIC::LoadOldModules( SvStream& ) return FALSE; } +bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ) +{ + bool bRes = false; + ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) ); + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) ); + if ( pGlobs ) + { + aOut = pGlobs->getUnoAny(); + bRes = true; + } + return bRes; +} //======================================================================== // #118116 Implementation Collection object |