diff options
author | Andreas Bregas <ab@openoffice.org> | 2002-08-13 07:10:47 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2002-08-13 07:10:47 +0000 |
commit | d5259c5f3921292148d61c4f8c2e4b38327e8db6 (patch) | |
tree | 7a8f4b26fd7bc890f91abd364b155a1ce670ebd5 /basic/source | |
parent | acdb8250b7852fa762d6cbbc564933a07ed9fb67 (diff) |
#98536# StepLOCAL(): Check if variable exists before creating it
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/step2.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index b8b9bf29781c..05076a2e153d 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: step2.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mh $ $Date: 2001-10-17 18:35:14 $ + * last change: $Author: ab $ $Date: 2002-08-13 08:10:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -901,10 +901,13 @@ void SbiRuntime::StepLOCAL( USHORT nOp1, USHORT nOp2 ) if( !refLocals.Is() ) refLocals = new SbxArray; String aName( pImg->GetString( nOp1 ) ); - SbxDataType t = (SbxDataType) nOp2; - SbxVariable* p = new SbxVariable( t ); - p->SetName( aName ); - refLocals->Put( p, refLocals->Count() ); + if( refLocals->Find( aName, SbxCLASS_DONTCARE ) == NULL ) + { + SbxDataType t = (SbxDataType) nOp2; + SbxVariable* p = new SbxVariable( t ); + p->SetName( aName ); + refLocals->Put( p, refLocals->Count() ); + } } // Einrichten einer modulglobalen Variablen (+StringID+Typ) |