Kaydet (Commit) 4ba6b71a authored tarafından Andreas Bregas's avatar Andreas Bregas

#102653# 32 bit arrays

üst 7e1536e3
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: methods.cxx,v $ * $RCSfile: methods.cxx,v $
* *
* $Revision: 1.45 $ * $Revision: 1.46 $
* *
* last change: $Author: ab $ $Date: 2002-10-17 14:30:00 $ * last change: $Author: ab $ $Date: 2002-11-18 08:36:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -3480,12 +3480,12 @@ RTLFUNC(LBound) ...@@ -3480,12 +3480,12 @@ RTLFUNC(LBound)
SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
if( pArr ) if( pArr )
{ {
short nLower, nUpper; INT32 nLower, nUpper;
short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1;
if( !pArr->GetDim( nDim, nLower, nUpper ) ) if( !pArr->GetDim32( nDim, nLower, nUpper ) )
StarBASIC::Error( SbERR_OUT_OF_RANGE ); StarBASIC::Error( SbERR_OUT_OF_RANGE );
else else
rPar.Get(0)->PutInteger( (INT16)nLower ); rPar.Get(0)->PutLong( nLower );
} }
else else
StarBASIC::Error( SbERR_MUST_HAVE_DIMS ); StarBASIC::Error( SbERR_MUST_HAVE_DIMS );
...@@ -3504,12 +3504,12 @@ RTLFUNC(UBound) ...@@ -3504,12 +3504,12 @@ RTLFUNC(UBound)
SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
if( pArr ) if( pArr )
{ {
short nLower, nUpper; INT32 nLower, nUpper;
short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1;
if( !pArr->GetDim( nDim, nLower, nUpper ) ) if( !pArr->GetDim32( nDim, nLower, nUpper ) )
StarBASIC::Error( SbERR_OUT_OF_RANGE ); StarBASIC::Error( SbERR_OUT_OF_RANGE );
else else
rPar.Get(0)->PutInteger( (INT16)nUpper ); rPar.Get(0)->PutLong( nUpper );
} }
else else
StarBASIC::Error( SbERR_MUST_HAVE_DIMS ); StarBASIC::Error( SbERR_MUST_HAVE_DIMS );
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: methods1.cxx,v $ * $RCSfile: methods1.cxx,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: ab $ $Date: 2002-10-08 09:05:47 $ * last change: $Author: ab $ $Date: 2002-11-18 08:36:36 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -594,19 +594,19 @@ RTLFUNC(Array) ...@@ -594,19 +594,19 @@ RTLFUNC(Array)
// Das Array ist immer vom Typ Variant // Das Array ist immer vom Typ Variant
RTLFUNC(DimArray) RTLFUNC(DimArray)
{ {
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); SbxDimArray * pArray = new SbxDimArray( SbxVARIANT );
USHORT nArrayDims = rPar.Count() - 1; USHORT nArrayDims = rPar.Count() - 1;
if( nArrayDims > 0 ) if( nArrayDims > 0 )
{ {
for( USHORT i = 0; i < nArrayDims ; i++ ) for( USHORT i = 0; i < nArrayDims ; i++ )
{ {
INT16 ub = rPar.Get(i+1)->GetInteger(); INT32 ub = rPar.Get(i+1)->GetLong();
if( ub < 0 ) if( ub < 0 )
{ {
StarBASIC::Error( SbERR_OUT_OF_RANGE ); StarBASIC::Error( SbERR_OUT_OF_RANGE );
ub = 0; ub = 0;
} }
pArray->AddDim( 0, ub ); pArray->AddDim32( 0, ub );
} }
} }
// Array zurueckliefern // Array zurueckliefern
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: step0.cxx,v $ * $RCSfile: step0.cxx,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: ab $ $Date: 2002-08-15 07:34:08 $ * last change: $Author: ab $ $Date: 2002-11-18 08:38:20 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -391,11 +391,11 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) ...@@ -391,11 +391,11 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar )
{ {
for( USHORT i = 1; i < pDims->Count(); ) for( USHORT i = 1; i < pDims->Count(); )
{ {
INT16 lb = pDims->Get( i++ )->GetInteger(); INT32 lb = pDims->Get( i++ )->GetLong();
INT16 ub = pDims->Get( i++ )->GetInteger(); INT32 ub = pDims->Get( i++ )->GetLong();
if( ub < lb ) if( ub < lb )
Error( SbERR_OUT_OF_RANGE ), ub = lb; Error( SbERR_OUT_OF_RANGE ), ub = lb;
pArray->AddDim( lb, ub ); pArray->AddDim32( lb, ub );
} }
} }
else else
...@@ -426,9 +426,9 @@ void SbiRuntime::StepREDIM() ...@@ -426,9 +426,9 @@ void SbiRuntime::StepREDIM()
// Helper function for StepREDIMP // Helper function for StepREDIMP
void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex, void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex,
short nActualDim, short* pActualIndices, short* pLowerBounds, short* pUpperBounds ) short nActualDim, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
{ {
short& ri = pActualIndices[nActualDim]; sal_Int32& ri = pActualIndices[nActualDim];
for( ri = pLowerBounds[nActualDim] ; ri <= pUpperBounds[nActualDim] ; ri++ ) for( ri = pLowerBounds[nActualDim] ; ri <= pUpperBounds[nActualDim] ; ri++ )
{ {
if( nActualDim < nMaxDimIndex ) if( nActualDim < nMaxDimIndex )
...@@ -438,8 +438,8 @@ void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMa ...@@ -438,8 +438,8 @@ void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMa
} }
else else
{ {
SbxVariable* pSource = pOldArray->Get( pActualIndices ); SbxVariable* pSource = pOldArray->Get32( pActualIndices );
SbxVariable* pDest = pNewArray->Get( pActualIndices ); SbxVariable* pDest = pNewArray->Get32( pActualIndices );
if( pSource && pDest ) if( pSource && pDest )
*pDest = *pSource; *pDest = *pSource;
} }
...@@ -469,9 +469,9 @@ void SbiRuntime::StepREDIMP() ...@@ -469,9 +469,9 @@ void SbiRuntime::StepREDIMP()
BOOL bRangeError = FALSE; BOOL bRangeError = FALSE;
// Store dims to use them for copying later // Store dims to use them for copying later
short* pLowerBounds = new short[nDims]; sal_Int32* pLowerBounds = new sal_Int32[nDims];
short* pUpperBounds = new short[nDims]; sal_Int32* pUpperBounds = new sal_Int32[nDims];
short* pActualIndices = new short[nDims]; sal_Int32* pActualIndices = new sal_Int32[nDims];
if( nDimsOld != nDimsNew ) if( nDimsOld != nDimsNew )
{ {
bRangeError = TRUE; bRangeError = TRUE;
...@@ -481,10 +481,10 @@ void SbiRuntime::StepREDIMP() ...@@ -481,10 +481,10 @@ void SbiRuntime::StepREDIMP()
// Compare bounds // Compare bounds
for( short i = 1 ; i <= nDims ; i++ ) for( short i = 1 ; i <= nDims ; i++ )
{ {
short lBoundNew, uBoundNew; sal_Int32 lBoundNew, uBoundNew;
short lBoundOld, uBoundOld; sal_Int32 lBoundOld, uBoundOld;
pNewArray->GetDim( i, lBoundNew, uBoundNew ); pNewArray->GetDim32( i, lBoundNew, uBoundNew );
pOldArray->GetDim( i, lBoundOld, uBoundOld ); pOldArray->GetDim32( i, lBoundOld, uBoundOld );
/* #69094 Allow all dimensions to be changed /* #69094 Allow all dimensions to be changed
although Visual Basic is not able to do so. although Visual Basic is not able to do so.
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: step2.cxx,v $ * $RCSfile: step2.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: ab $ $Date: 2002-09-30 08:54:11 $ * last change: $Author: ab $ $Date: 2002-11-18 08:38:47 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -838,14 +838,14 @@ void SbiRuntime::StepDCREATE( USHORT nOp1, USHORT nOp2 ) ...@@ -838,14 +838,14 @@ void SbiRuntime::StepDCREATE( USHORT nOp1, USHORT nOp2 )
// Dimensionen auswerten // Dimensionen auswerten
short nDims = pArray->GetDims(); short nDims = pArray->GetDims();
USHORT nTotalSize = 0; UINT32 nTotalSize = 0;
// es muss ein eindimensionales Array sein // es muss ein eindimensionales Array sein
short nLower, nUpper, nSize; INT32 nLower, nUpper, nSize;
USHORT i; UINT32 i;
for( i = 0 ; i < nDims ; i++ ) for( i = 0 ; i < nDims ; i++ )
{ {
pArray->GetDim( i+1, nLower, nUpper ); pArray->GetDim32( i+1, nLower, nUpper );
nSize = nUpper - nLower + 1; nSize = nUpper - nLower + 1;
if( i == 0 ) if( i == 0 )
nTotalSize = nSize; nTotalSize = nSize;
...@@ -869,7 +869,7 @@ void SbiRuntime::StepDCREATE( USHORT nOp1, USHORT nOp2 ) ...@@ -869,7 +869,7 @@ void SbiRuntime::StepDCREATE( USHORT nOp1, USHORT nOp2 )
pObj->SetName( aName ); pObj->SetName( aName );
// Das Objekt muss BASIC rufen koennen // Das Objekt muss BASIC rufen koennen
pObj->SetParent( &rBasic ); pObj->SetParent( &rBasic );
pArray->SbxArray::Put( pObj, i ); pArray->SbxArray::Put32( pObj, i );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment