diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-08-30 08:59:44 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-08-30 08:59:44 +0000 |
commit | a8911b849f4b114ea7eb1b4f76229e9d3aa5f1c6 (patch) | |
tree | a54b09f46c6000fbf4965a4567455444564e65e2 /basic/source | |
parent | INTEGRATION: CWS npower7 (1.16.42); FILE MERGED (diff) | |
download | core-a8911b849f4b114ea7eb1b4f76229e9d3aa5f1c6.tar.gz core-a8911b849f4b114ea7eb1b4f76229e9d3aa5f1c6.zip |
INTEGRATION: CWS npower7 (1.26.42); FILE MERGED
2007/05/02 09:44:56 npower 1.26.42.2: #i#68898#,#i76819#
2007/02/16 17:06:53 npower 1.26.42.1: #i70380 compatible erase behaviour
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/comp/dim.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 04e3abbf1892..984145f5b025 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dim.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: hr $ $Date: 2007-06-27 14:20:05 $ + * last change: $Author: vg $ $Date: 2007-08-30 09:59:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -203,6 +203,10 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) if( eCurTok == GLOBAL ) bPersistantGlobal = TRUE; } + // behavior in VBA is that a module scope variable's lifetime is + // tied to the document. e.g. a module scope variable is global + if( GetBasic()->IsDocBasic() && bVBASupportOn && !pProc ) + bPersistantGlobal = TRUE; // PRIVATE ist Synonym fuer DIM // _CONST_? BOOL bConst = FALSE; @@ -334,7 +338,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) { case SbGLOBAL: eOp2 = bPersistantGlobal ? _GLOBAL_P : _GLOBAL; goto global; - case SbPUBLIC: eOp2 = _PUBLIC; + case SbPUBLIC: eOp2 = bPersistantGlobal ? _PUBLIC_P : _PUBLIC; // AB 9.7.97, #40689, kein eigener Opcode mehr /* if( bStatic ) @@ -439,7 +443,14 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) { SbiExpression aExpr( this, *pDef, NULL ); aExpr.Gen(); - aGen.Gen( _ERASE ); + if ( bVBASupportOn ) + // delete the array but + // clear the variable ( this + // allows the processing of + // the param to happen as normal without errors ( ordinary ERASE just clears the array ) + aGen.Gen( _ERASE_CLEAR ); + else + aGen.Gen( _ERASE ); } else if( eOp == _REDIMP ) { |