summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-03-17 12:32:25 +0000
committerOliver Bolte <obo@openoffice.org>2004-03-17 12:32:25 +0000
commit1d2589fcab44283ad9009d1e95ccbcf86526e941 (patch)
tree9a1799a019f62c17e2533bd1735c29e76b4ba807 /basic
parent8308f6ddfe49b71b5e0f50749e7fcac44d3a71d8 (diff)
INTEGRATION: CWS jl5vba (1.15.72); FILE MERGED
2004/01/20 15:38:22 ab 1.15.72.1: #111934# Merge #111741# User defined types #112369# Decimal type #109170# Recursion limit
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx47
1 files changed, 44 insertions, 3 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 31422b025b24..f2f056351926 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sbxmod.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: vg $ $Date: 2003-07-01 14:52:35 $
+ * last change: $Author: obo $ $Date: 2004-03-17 13:32:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,6 +98,9 @@
#if defined(UNX) || defined(MAC)
#define CDECL
#endif
+#ifdef UNX
+#include <sys/resource.h>
+#endif
#include <stdio.h>
@@ -127,6 +130,7 @@ static char* strListBasicKeyWords[] = {
"base",
"binary",
"boolean",
+ "byref",
"byval",
"call",
"case",
@@ -267,6 +271,12 @@ BOOL SbModule::IsCompiled() const
return BOOL( pImage != 0 );
}
+const SbxObject* SbModule::FindType( String aTypeName ) const
+{
+ return pImage ? pImage->FindType( aTypeName ) : NULL;
+}
+
+
// Aus dem Codegenerator: Loeschen des Images und Invalidieren der Entries
void SbModule::StartDefinitions()
@@ -554,6 +564,12 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
if( pVar )
pVar->SbxValue::Clear();
+ // return-Wert von CreateUnoDialog loeschen
+ static String aName3( RTL_CONSTASCII_USTRINGPARAM("CDec") );
+ pVar = pBasic->GetRtl()->Find( aName3, SbxCLASS_METHOD );
+ if( pVar )
+ pVar->SbxValue::Clear();
+
// Ueber alle Sub-Basics gehen
SbxArray* pObjs = pBasic->GetObjects();
USHORT nCount = pObjs->Count();
@@ -584,6 +600,8 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic )
// Ausfuehren eines BASIC-Unterprogramms
USHORT SbModule::Run( SbMethod* pMeth )
{
+ static USHORT nMaxCallLevel = 0;
+
USHORT nRes = 0;
BOOL bDelInst = BOOL( pINST == NULL );
StarBASICRef xBasic;
@@ -598,9 +616,32 @@ USHORT SbModule::Run( SbMethod* pMeth )
SbErrorStack*& rErrStack = GetSbData()->pErrStack;
delete rErrStack;
rErrStack = NULL;
+
+ if( nMaxCallLevel == 0 )
+ {
+#ifdef UNX
+ struct rlimit rl;
+ getrlimit ( RLIMIT_STACK, &rl );
+ // printf( "RLIMIT_STACK = %ld\n", rl.rlim_cur );
+#endif
+#ifdef LINUX
+ // Empiric value, 900 = needed bytes/Basic call level
+ // for Linux including 10% safety margin
+ nMaxCallLevel = rl.rlim_cur / 900;
+#elif SOLARIS
+ // Empiric value, 1650 = needed bytes/Basic call level
+ // for Solaris including 10% safety margin
+ nMaxCallLevel = rl.rlim_cur / 1650;
+#elif WIN32
+ nMaxCallLevel = 5800;
+#else
+ nMaxCallLevel = MAXRECURSION;
+#endif
+ }
}
+
// Rekursion zu tief?
- if( ++pINST->nCallLvl <= MAXRECURSION )
+ if( ++pINST->nCallLvl <= nMaxCallLevel )
{
// Globale Variable in allen Mods definieren
GlobalRunInit( /* bBasicStart = */ bDelInst );