diff options
Diffstat (limited to 'sc/source/core/tool/interpr1.cxx')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 460 |
1 files changed, 230 insertions, 230 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index fcc7a24e7a42..23c13331db26 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -80,7 +80,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScTokenStack, 8, 4 ) IMPL_FIXEDMEMPOOL_NEWDEL( ScInterpreter, 32, 16 ) ScTokenStack* ScInterpreter::pGlobalStack = NULL; -BOOL ScInterpreter::bGlobalStackInUse = FALSE; +sal_Bool ScInterpreter::bGlobalStackInUse = sal_False; using namespace formula; using ::std::auto_ptr; @@ -270,7 +270,7 @@ void ScInterpreter::ScChoseJump() fVal = ::rtl::math::approxFloor( fVal); if ( (fVal < 1) || (fVal >= nJumpCount)) { - bIsValue = FALSE; + bIsValue = sal_False; fVal = CreateDoubleError( errIllegalArgument); } @@ -458,11 +458,11 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) // Do not modify the original range because we use it // to adjust the size of the result matrix if necessary. ScAddress aAdr( aRange.aStart); - ULONG nCol = (ULONG)aAdr.Col() + nC; - ULONG nRow = (ULONG)aAdr.Row() + nR; - if ((nCol > static_cast<ULONG>(aRange.aEnd.Col()) && + sal_uLong nCol = (sal_uLong)aAdr.Col() + nC; + sal_uLong nRow = (sal_uLong)aAdr.Row() + nR; + if ((nCol > static_cast<sal_uLong>(aRange.aEnd.Col()) && aRange.aEnd.Col() != aRange.aStart.Col()) - || (nRow > static_cast<ULONG>(aRange.aEnd.Row()) && + || (nRow > static_cast<sal_uLong>(aRange.aEnd.Row()) && aRange.aEnd.Row() != aRange.aStart.Row())) { fVal = CreateDoubleError( NOTAVAILABLE ); @@ -584,7 +584,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) { // push all results that have no jump path if ( pResMat ) { - // a FALSE without path results in an empty path value + // a sal_False without path results in an empty path value if ( fBool == 0.0 ) pResMat->PutEmptyPath( nC, nR ); else @@ -783,16 +783,16 @@ double ScInterpreter::Compare() { case svEmptyCell: Pop(); - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; break; case svMissing: case svDouble: aComp.nVal[ i ] = GetDouble(); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; break; case svString: *aComp.pVal[ i ] = GetString(); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = sal_False; break; case svDoubleRef : case svSingleRef : @@ -802,16 +802,16 @@ double ScInterpreter::Compare() break; ScBaseCell* pCell = GetCell( aAdr ); if (HasCellEmptyData( pCell)) - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; else if (HasCellStringData( pCell)) { GetCellString( *aComp.pVal[ i ], pCell); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = sal_False; } else { aComp.nVal[ i ] = GetCellValue( aAdr, pCell ); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; } } break; @@ -840,32 +840,32 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { case svEmptyCell: Pop(); - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; break; case svMissing: case svDouble: aComp.nVal[ i ] = GetDouble(); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; break; case svString: *aComp.pVal[ i ] = GetString(); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = sal_False; break; case svSingleRef: { PopSingleRef( aAdr ); ScBaseCell* pCell = GetCell( aAdr ); if (HasCellEmptyData( pCell)) - aComp.bEmpty[ i ] = TRUE; + aComp.bEmpty[ i ] = sal_True; else if (HasCellStringData( pCell)) { GetCellString( *aComp.pVal[ i ], pCell); - aComp.bVal[ i ] = FALSE; + aComp.bVal[ i ] = sal_False; } else { aComp.nVal[ i ] = GetCellValue( aAdr, pCell ); - aComp.bVal[ i ] = TRUE; + aComp.bVal[ i ] = sal_True; } } break; @@ -909,15 +909,15 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { if ( pMat[i]->IsString(j,k) ) { - aComp.bVal[i] = FALSE; + aComp.bVal[i] = sal_False; *aComp.pVal[i] = pMat[i]->GetString(j,k); aComp.bEmpty[i] = pMat[i]->IsEmpty(j,k); } else { - aComp.bVal[i] = TRUE; + aComp.bVal[i] = sal_True; aComp.nVal[i] = pMat[i]->GetDouble(j,k); - aComp.bEmpty[i] = FALSE; + aComp.bEmpty[i] = sal_False; } } pResMat->PutDouble( CompareFunc( aComp, pOptions ), j,k ); @@ -940,13 +940,13 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) { if ( pMat[i]->IsValue(j) ) { - aComp.bVal[i] = TRUE; + aComp.bVal[i] = sal_True; aComp.nVal[i] = pMat[i]->GetDouble(j); - aComp.bEmpty[i] = FALSE; + aComp.bEmpty[i] = sal_False; } else { - aComp.bVal[i] = FALSE; + aComp.bVal[i] = sal_False; *aComp.pVal[i] = pMat[i]->GetString(j); aComp.bEmpty[i] = pMat[i]->IsEmpty(j); } @@ -1126,8 +1126,8 @@ void ScInterpreter::ScAnd() short nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 1 ) ) { - BOOL bHaveValue = FALSE; - short nRes = TRUE; + sal_Bool bHaveValue = sal_False; + short nRes = sal_True; size_t nRefInList = 0; while( nParamCount-- > 0) { @@ -1136,7 +1136,7 @@ void ScInterpreter::ScAnd() switch ( GetStackType() ) { case svDouble : - bHaveValue = TRUE; + bHaveValue = sal_True; nRes &= ( PopDouble() != 0.0 ); break; case svString : @@ -1152,7 +1152,7 @@ void ScInterpreter::ScAnd() ScBaseCell* pCell = GetCell( aAdr ); if ( HasCellValueData( pCell ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; nRes &= ( GetCellValue( aAdr, pCell ) != 0.0 ); } // else: Xcl setzt hier keinen Fehler @@ -1167,11 +1167,11 @@ void ScInterpreter::ScAnd() if ( !nGlobalError ) { double fVal; - USHORT nErr = 0; + sal_uInt16 nErr = 0; ScValueIterator aValIter( pDok, aRange ); if ( aValIter.GetFirst( fVal, nErr ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; do { nRes &= ( fVal != 0.0 ); @@ -1187,13 +1187,13 @@ void ScInterpreter::ScAnd() ScMatrixRef pMat = GetMatrix(); if ( pMat ) { - bHaveValue = TRUE; + bHaveValue = sal_True; double fVal = pMat->And(); - USHORT nErr = GetDoubleErrorValue( fVal ); + sal_uInt16 nErr = GetDoubleErrorValue( fVal ); if ( nErr ) { SetError( nErr ); - nRes = FALSE; + nRes = sal_False; } else nRes &= (fVal != 0.0); @@ -1224,8 +1224,8 @@ void ScInterpreter::ScOr() short nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 1 ) ) { - BOOL bHaveValue = FALSE; - short nRes = FALSE; + sal_Bool bHaveValue = sal_False; + short nRes = sal_False; size_t nRefInList = 0; while( nParamCount-- > 0) { @@ -1234,7 +1234,7 @@ void ScInterpreter::ScOr() switch ( GetStackType() ) { case svDouble : - bHaveValue = TRUE; + bHaveValue = sal_True; nRes |= ( PopDouble() != 0.0 ); break; case svString : @@ -1250,7 +1250,7 @@ void ScInterpreter::ScOr() ScBaseCell* pCell = GetCell( aAdr ); if ( HasCellValueData( pCell ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; nRes |= ( GetCellValue( aAdr, pCell ) != 0.0 ); } // else: Xcl setzt hier keinen Fehler @@ -1265,11 +1265,11 @@ void ScInterpreter::ScOr() if ( !nGlobalError ) { double fVal; - USHORT nErr = 0; + sal_uInt16 nErr = 0; ScValueIterator aValIter( pDok, aRange ); if ( aValIter.GetFirst( fVal, nErr ) ) { - bHaveValue = TRUE; + bHaveValue = sal_True; do { nRes |= ( fVal != 0.0 ); @@ -1282,17 +1282,17 @@ void ScInterpreter::ScOr() break; case svMatrix: { - bHaveValue = TRUE; + bHaveValue = sal_True; ScMatrixRef pMat = GetMatrix(); if ( pMat ) { - bHaveValue = TRUE; + bHaveValue = sal_True; double fVal = pMat->Or(); - USHORT nErr = GetDoubleErrorValue( fVal ); + sal_uInt16 nErr = GetDoubleErrorValue( fVal ); if ( nErr ) { SetError( nErr ); - nRes = FALSE; + nRes = sal_False; } else nRes |= (fVal != 0.0); @@ -1363,7 +1363,7 @@ void ScInterpreter::ScPercentSign() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPercentSign" ); nFuncFmtType = NUMBERFORMAT_PERCENT; const FormulaToken* pSaveCur = pCur; - BYTE nSavePar = cPar; + sal_uInt8 nSavePar = cPar; PushInt( 100 ); cPar = 2; FormulaByteToken aDivOp( ocDiv, cPar ); @@ -1641,7 +1641,7 @@ void ScInterpreter::ScIsEmpty() pJumpMatrix->GetPos( nC, nR); if ( nC < nCols && nR < nRows ) nRes = pMat->IsEmpty( nC, nR); - // else: FALSE, not empty (which is what Xcl does) + // else: sal_False, not empty (which is what Xcl does) } } break; @@ -1745,7 +1745,7 @@ void ScInterpreter::ScIsLogical() { if (HasCellValueData(pCell)) { - ULONG nFormat = GetCellNumberFormat( aAdr, pCell ); + sal_uLong nFormat = GetCellNumberFormat( aAdr, pCell ); nRes = ( pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL); } @@ -1794,7 +1794,7 @@ void ScInterpreter::ScType() break; case CELLTYPE_VALUE : { - ULONG nFormat = GetCellNumberFormat( aAdr, pCell ); + sal_uLong nFormat = GetCellNumberFormat( aAdr, pCell ); if (pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL) nType = 4; @@ -1849,13 +1849,13 @@ void ScInterpreter::ScType() } -inline BOOL lcl_FormatHasNegColor( const SvNumberformat* pFormat ) +inline sal_Bool lcl_FormatHasNegColor( const SvNumberformat* pFormat ) { return pFormat && pFormat->GetColor( 1 ); } -inline BOOL lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) +inline sal_Bool lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) { return pFormat && (pFormat->GetFormatstring().Search( '(' ) != STRING_NOTFOUND); } @@ -1863,11 +1863,11 @@ inline BOOL lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) void ScInterpreter::ScCell() { // ATTRIBUTE ; [REF] - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if( MustHaveParamCount( nParamCount, 1, 2 ) ) { ScAddress aCellPos( aPos ); - BOOL bError = FALSE; + sal_Bool bError = sal_False; if( nParamCount == 2 ) bError = !PopDoubleRefOrSingleRef( aCellPos ); String aInfoType( GetString() ); @@ -1895,7 +1895,7 @@ void ScInterpreter::ScCell() } else if( aInfoType.EqualsAscii( "ADDRESS" ) ) { // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW - USHORT nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D); + sal_uInt16 nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D); aCellPos.Format( aFuncResult, nFlags, pDok, pDok->GetAddressConvention() ); PushString( aFuncResult ); } @@ -2000,10 +2000,10 @@ void ScInterpreter::ScCell() // *** FORMATTING *** else if( aInfoType.EqualsAscii( "FORMAT" ) ) { // specific format code for standard formats - ULONG nFormat = pDok->GetNumberFormat( aCellPos ); - BOOL bAppendPrec = TRUE; - USHORT nPrec, nLeading; - BOOL bThousand, bIsRed; + sal_uLong nFormat = pDok->GetNumberFormat( aCellPos ); + sal_Bool bAppendPrec = sal_True; + sal_uInt16 nPrec, nLeading; + sal_Bool bThousand, bIsRed; pFormatter->GetFormatSpecialInfo( nFormat, bThousand, bIsRed, nPrec, nLeading ); switch( pFormatter->GetType( nFormat ) ) @@ -2014,7 +2014,7 @@ void ScInterpreter::ScCell() case NUMBERFORMAT_PERCENT: aFuncResult = 'P'; break; default: { - bAppendPrec = FALSE; + bAppendPrec = sal_False; switch( pFormatter->GetIndexTableOffset( nFormat ) ) { case NF_DATE_SYSTEM_SHORT: @@ -2240,7 +2240,7 @@ void ScInterpreter::ScIsNV() else { ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); nRes = (nErr == NOTAVAILABLE); } } @@ -2289,7 +2289,7 @@ void ScInterpreter::ScIsErr() else { ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); nRes = (nErr && nErr != NOTAVAILABLE); } } @@ -2301,7 +2301,7 @@ void ScInterpreter::ScIsErr() nRes = ((nGlobalError && nGlobalError != NOTAVAILABLE) || !pMat); else if ( !pJumpMatrix ) { - USHORT nErr = pMat->GetErrorIfNotString( 0 ); + sal_uInt16 nErr = pMat->GetErrorIfNotString( 0 ); nRes = (nErr && nErr != NOTAVAILABLE); } else @@ -2311,7 +2311,7 @@ void ScInterpreter::ScIsErr() pJumpMatrix->GetPos( nC, nR); if ( nC < nCols && nR < nRows ) { - USHORT nErr = pMat->GetErrorIfNotString( nC, nR); + sal_uInt16 nErr = pMat->GetErrorIfNotString( nC, nR); nRes = (nErr && nErr != NOTAVAILABLE); } } @@ -2394,7 +2394,7 @@ short ScInterpreter::IsEven() if ( !PopDoubleRefOrSingleRef( aAdr ) ) break; ScBaseCell* pCell = GetCell( aAdr ); - USHORT nErr = GetCellErrCode( pCell ); + sal_uInt16 nErr = GetCellErrCode( pCell ); if (nErr != 0) SetError(nErr); else @@ -2479,11 +2479,11 @@ void ScInterpreter::ScIsOdd() void ScInterpreter::ScN() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScN" ); - USHORT nErr = nGlobalError; + sal_uInt16 nErr = nGlobalError; nGlobalError = 0; // Temporarily override the ConvertStringToValue() error for // GetCellValue() / GetCellValueOrZero() - USHORT nSErr = mnStringNoValueError; + sal_uInt16 nSErr = mnStringNoValueError; mnStringNoValueError = errCellNoValue; double fVal = GetDouble(); mnStringNoValueError = nSErr; @@ -2586,14 +2586,14 @@ void ScInterpreter::ScT() PushInt(0); return ; } - BOOL bValue = FALSE; + sal_Bool bValue = sal_False; ScBaseCell* pCell = GetCell( aAdr ); if ( GetCellErrCode( pCell ) == 0 ) { switch ( GetCellType( pCell ) ) { case CELLTYPE_VALUE : - bValue = TRUE; + bValue = sal_True; break; case CELLTYPE_FORMULA : bValue = ((ScFormulaCell*)pCell)->IsValue(); @@ -2704,7 +2704,7 @@ void ScInterpreter::ScValue() //2do: this should be a proper unicode string method -inline BOOL lcl_ScInterpreter_IsPrintable( sal_Unicode c ) +inline sal_Bool lcl_ScInterpreter_IsPrintable( sal_Unicode c ) { return 0x20 <= c && c != 0x7f; } @@ -2762,7 +2762,7 @@ static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr ) bFirstASCCall = false; } - return aTrans.transliterate( rStr, 0, USHORT( rStr.getLength() ), NULL ); + return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ), NULL ); } @@ -2777,7 +2777,7 @@ static ::rtl::OUString lcl_convertIntoFullWidth( const ::rtl::OUString & rStr ) bFirstJISCall = false; } - return aTrans.transliterate( rStr, 0, USHORT( rStr.getLength() ), NULL ); + return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ), NULL ); } @@ -2846,7 +2846,7 @@ void ScInterpreter::ScUnichar() } -void ScInterpreter::ScMin( BOOL bTextAsZero ) +void ScInterpreter::ScMin( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMin" ); short nParamCount = GetByte(); @@ -2888,7 +2888,7 @@ void ScInterpreter::ScMin( BOOL bTextAsZero ) case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(nVal, nErr)) @@ -2967,7 +2967,7 @@ void ScInterpreter::ScMin( BOOL bTextAsZero ) PushDouble(nMin); } -void ScInterpreter::ScMax( BOOL bTextAsZero ) +void ScInterpreter::ScMax( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMax" ); short nParamCount = GetByte(); @@ -3009,7 +3009,7 @@ void ScInterpreter::ScMax( BOOL bTextAsZero ) case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(nVal, nErr)) @@ -3088,15 +3088,15 @@ void ScInterpreter::ScMax( BOOL bTextAsZero ) PushDouble(nMax); } -double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) +double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IterateParameters" ); short nParamCount = GetByte(); double fRes = ( eFunc == ifPRODUCT ) ? 1.0 : 0.0; double fVal = 0.0; double fMem = 0.0; - BOOL bNull = TRUE; - ULONG nCount = 0; + sal_Bool bNull = sal_True; + sal_uLong nCount = 0; ScAddress aAdr; ScRange aRange; size_t nRefInList = 0; @@ -3156,7 +3156,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case ifSUM: if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -3200,7 +3200,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case ifSUM: if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -3230,7 +3230,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); if ( nGlobalError && ( eFunc == ifCOUNT2 || eFunc == ifCOUNT ) ) { @@ -3272,7 +3272,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) SetError(nErr); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -3323,7 +3323,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) nFuncFmtType = NUMBERFORMAT_NUMBER; pMat->GetDimensions(nC, nR); if( eFunc == ifCOUNT2 ) - nCount += (ULONG) nC * nR; + nCount += (sal_uLong) nC * nR; else { for (SCSIZE nMatCol = 0; nMatCol < nC; nMatCol++) @@ -3340,7 +3340,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case ifSUM: if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -3392,7 +3392,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, BOOL bTextAsZero ) case ifPRODUCT: if ( !nCount ) fRes = 0.0; break; default: ; // nothing } - // Bei Summen etc. macht ein BOOL-Ergebnis keinen Sinn + // Bei Summen etc. macht ein sal_Bool-Ergebnis keinen Sinn // und Anzahl ist immer Number (#38345#) if( eFunc == ifCOUNT || nFuncFmtType == NUMBERFORMAT_LOGICAL ) nFuncFmtType = NUMBERFORMAT_NUMBER; @@ -3421,7 +3421,7 @@ void ScInterpreter::ScProduct() } -void ScInterpreter::ScAverage( BOOL bTextAsZero ) +void ScInterpreter::ScAverage( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAverage" ); PushDouble( IterateParameters( ifAVERAGE, bTextAsZero ) ); @@ -3443,7 +3443,7 @@ void ScInterpreter::ScCount2() void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, - BOOL bTextAsZero ) + sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetStVarParams" ); short nParamCount = GetByte(); @@ -3490,7 +3490,7 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, case svDoubleRef : case svRefList : { - USHORT nErr = 0; + sal_uInt16 nErr = 0; PopDoubleRef( aRange, nParamCount, nRefInList); ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero ); if (aValIter.GetFirst(fVal, nErr)) @@ -3559,7 +3559,7 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount, } -void ScInterpreter::ScVar( BOOL bTextAsZero ) +void ScInterpreter::ScVar( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVar" ); double nVal; @@ -3573,7 +3573,7 @@ void ScInterpreter::ScVar( BOOL bTextAsZero ) } -void ScInterpreter::ScVarP( BOOL bTextAsZero ) +void ScInterpreter::ScVarP( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVarP" ); double nVal; @@ -3584,7 +3584,7 @@ void ScInterpreter::ScVarP( BOOL bTextAsZero ) } -void ScInterpreter::ScStDev( BOOL bTextAsZero ) +void ScInterpreter::ScStDev( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScStDev" ); double nVal; @@ -3597,7 +3597,7 @@ void ScInterpreter::ScStDev( BOOL bTextAsZero ) } -void ScInterpreter::ScStDevP( BOOL bTextAsZero ) +void ScInterpreter::ScStDevP( sal_Bool bTextAsZero ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScStDevP" ); double nVal; @@ -3630,8 +3630,8 @@ void ScInterpreter::ScStDevP( BOOL bTextAsZero ) void ScInterpreter::ScColumns() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScColumns" ); - BYTE nParamCount = GetByte(); - ULONG nVal = 0; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal = 0; SCCOL nCol1; SCROW nRow1; SCTAB nTab1; @@ -3648,8 +3648,8 @@ void ScInterpreter::ScColumns() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1) * - static_cast<ULONG>(nCol2 - nCol1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1) * + static_cast<sal_uLong>(nCol2 - nCol1 + 1); break; case svMatrix: { @@ -3674,8 +3674,8 @@ void ScInterpreter::ScColumns() void ScInterpreter::ScRows() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRows" ); - BYTE nParamCount = GetByte(); - ULONG nVal = 0; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal = 0; SCCOL nCol1; SCROW nRow1; SCTAB nTab1; @@ -3692,8 +3692,8 @@ void ScInterpreter::ScRows() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1) * - static_cast<ULONG>(nRow2 - nRow1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1) * + static_cast<sal_uLong>(nRow2 - nRow1 + 1); break; case svMatrix: { @@ -3717,8 +3717,8 @@ void ScInterpreter::ScRows() void ScInterpreter::ScTables() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTables" ); - BYTE nParamCount = GetByte(); - ULONG nVal; + sal_uInt8 nParamCount = GetByte(); + sal_uLong nVal; if ( nParamCount == 0 ) nVal = pDok->GetTableCount(); else @@ -3740,7 +3740,7 @@ void ScInterpreter::ScTables() break; case svDoubleRef: PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); - nVal += static_cast<ULONG>(nTab2 - nTab1 + 1); + nVal += static_cast<sal_uLong>(nTab2 - nTab1 + 1); break; case svMatrix: PopError(); @@ -3759,7 +3759,7 @@ void ScInterpreter::ScTables() void ScInterpreter::ScColumn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScColumn" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { double nVal = 0; @@ -3835,7 +3835,7 @@ void ScInterpreter::ScColumn() void ScInterpreter::ScRow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRow" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { double nVal = 0; @@ -3910,7 +3910,7 @@ void ScInterpreter::ScRow() void ScInterpreter::ScTable() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTable" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 0, 1 ) ) { SCTAB nVal = 0; @@ -4061,7 +4061,7 @@ void ScInterpreter::ScMatch() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMatch" ); ScMatrixRef pMatSrc = NULL; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { double fTyp; @@ -4107,10 +4107,10 @@ void ScInterpreter::ScMatch() rParam.nRow1 = nRow1; rParam.nCol2 = nCol2; rParam.nTab = nTab1; - rParam.bMixedComparison = TRUE; + rParam.bMixedComparison = sal_True; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if (fTyp < 0.0) rEntry.eOp = SC_GREATER_EQUAL; else if (fTyp > 0.0) @@ -4120,14 +4120,14 @@ void ScInterpreter::ScMatch() case svDouble: { fVal = GetDouble(); - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = fVal; } break; case svString: { sStr = GetString(); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } break; @@ -4144,13 +4144,13 @@ void ScInterpreter::ScMatch() if (HasCellValueData(pCell)) { fVal = GetCellValue( aAdr, pCell ); - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = fVal; } else { GetCellString(sStr, pCell); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } } @@ -4280,12 +4280,12 @@ void ScInterpreter::ScMatch() else { // search column in row SCCOL nC; - rParam.bByRow = FALSE; + rParam.bByRow = sal_False; rParam.nRow2 = nRow1; rEntry.nField = nCol1; - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False); // Advance Entry.nField in Iterator if column changed - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if (fTyp == 0.0) { // EQUAL if ( aCellIter.GetFirst() ) @@ -4320,7 +4320,7 @@ void ScInterpreter::ScCountEmptyCells() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCountEmptyCells" ); if ( MustHaveParamCount( GetByte(), 1 ) ) { - ULONG nMaxCount = 0, nCount = 0; + sal_uLong nMaxCount = 0, nCount = 0; CellType eCellType; switch (GetStackType()) { @@ -4344,9 +4344,9 @@ void ScInterpreter::ScCountEmptyCells() { PopDoubleRef( aRange, nParam, nRefInList); nMaxCount += - static_cast<ULONG>(aRange.aEnd.Row() - aRange.aStart.Row() + 1) * - static_cast<ULONG>(aRange.aEnd.Col() - aRange.aStart.Col() + 1) * - static_cast<ULONG>(aRange.aEnd.Tab() - aRange.aStart.Tab() + 1); + static_cast<sal_uLong>(aRange.aEnd.Row() - aRange.aStart.Row() + 1) * + static_cast<sal_uLong>(aRange.aEnd.Col() - aRange.aStart.Col() + 1) * + static_cast<sal_uLong>(aRange.aEnd.Tab() - aRange.aStart.Tab() + 1); ScBaseCell* pCell; ScCellIterator aDocIter( pDok, aRange, glSubTotal); if ( (pCell = aDocIter.GetFirst()) != NULL ) @@ -4375,7 +4375,7 @@ void ScInterpreter::ScCountIf() { String rString; double fVal = 0.0; - BOOL bIsString = TRUE; + sal_Bool bIsString = sal_True; switch ( GetStackType() ) { case svDoubleRef : @@ -4392,13 +4392,13 @@ void ScInterpreter::ScCountIf() { case CELLTYPE_VALUE : fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = sal_False; break; case CELLTYPE_FORMULA : if( ((ScFormulaCell*)pCell)->IsValue() ) { fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = sal_False; } else GetCellString(rString, pCell); @@ -4409,7 +4409,7 @@ void ScInterpreter::ScCountIf() break; default: fVal = 0.0; - bIsString = FALSE; + bIsString = sal_False; } } break; @@ -4426,7 +4426,7 @@ void ScInterpreter::ScCountIf() default: { fVal = GetDouble(); - bIsString = FALSE; + bIsString = sal_False; } } double fSum = 0.0; @@ -4496,10 +4496,10 @@ void ScInterpreter::ScCountIf() rParam.nRow2 = nRow2; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if (!bIsString) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = fVal; rEntry.eOp = SC_EQUAL; } @@ -4537,9 +4537,9 @@ void ScInterpreter::ScCountIf() } else { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False); // Entry.nField im Iterator bei Spaltenwechsel weiterschalten - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if ( aCellIter.GetFirst() ) { do @@ -4563,7 +4563,7 @@ void ScInterpreter::ScCountIf() void ScInterpreter::ScSumIf() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumIf" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { SCCOL nCol3 = 0; @@ -4606,7 +4606,7 @@ void ScInterpreter::ScSumIf() } String rString; double fVal = 0.0; - BOOL bIsString = TRUE; + sal_Bool bIsString = sal_True; switch ( GetStackType() ) { case svDoubleRef : @@ -4623,13 +4623,13 @@ void ScInterpreter::ScSumIf() { case CELLTYPE_VALUE : fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = sal_False; break; case CELLTYPE_FORMULA : if( ((ScFormulaCell*)pCell)->IsValue() ) { fVal = GetCellValue( aAdr, pCell ); - bIsString = FALSE; + bIsString = sal_False; } else GetCellString(rString, pCell); @@ -4640,7 +4640,7 @@ void ScInterpreter::ScSumIf() break; default: fVal = 0.0; - bIsString = FALSE; + bIsString = sal_False; } } break; @@ -4657,13 +4657,13 @@ void ScInterpreter::ScSumIf() default: { fVal = GetDouble(); - bIsString = FALSE; + bIsString = sal_False; } } double fSum = 0.0; double fMem = 0.0; - BOOL bNull = TRUE; + sal_Bool bNull = sal_True; short nParam = 1; size_t nRefInList = 0; while (nParam-- > 0) @@ -4779,10 +4779,10 @@ void ScInterpreter::ScSumIf() rParam.nRow2 = nRow2; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if (!bIsString) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = fVal; rEntry.eOp = SC_EQUAL; } @@ -4830,7 +4830,7 @@ void ScInterpreter::ScSumIf() fVal = pSumExtraMatrix->GetDouble( nC, nR); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -4856,7 +4856,7 @@ void ScInterpreter::ScSumIf() fVal = GetCellValue( aAdr, pCell ); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -4869,9 +4869,9 @@ void ScInterpreter::ScSumIf() } else { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False); // Increment Entry.nField in iterator when switching to next column. - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if ( aCellIter.GetFirst() ) { if (pSumExtraMatrix) @@ -4885,7 +4885,7 @@ void ScInterpreter::ScSumIf() fVal = pSumExtraMatrix->GetDouble( nC, nR); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -4905,7 +4905,7 @@ void ScInterpreter::ScSumIf() fVal = GetCellValue( aAdr, pCell ); if ( bNull && fVal != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = fVal; } else @@ -4930,7 +4930,7 @@ void ScInterpreter::ScSumIf() void ScInterpreter::ScLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLookup" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) return ; @@ -5345,13 +5345,13 @@ void ScInterpreter::ScLookup() aParam.bByRow = bVertical; aParam.bMixedComparison = true; - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; rEntry.eOp = SC_LESS_EQUAL; rEntry.nField = nCol1; if ( rEntry.bQueryByString ) aParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); - ScQueryCellIterator aCellIter(pDok, nTab1, aParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, aParam, sal_False); SCCOL nC; SCROW nR; // Advance Entry.nField in iterator upon switching columns if @@ -5476,19 +5476,19 @@ void ScInterpreter::ScLookup() void ScInterpreter::ScHLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScHLookup" ); - CalculateLookup(TRUE); + CalculateLookup(sal_True); } -void ScInterpreter::CalculateLookup(BOOL HLookup) +void ScInterpreter::CalculateLookup(sal_Bool HLookup) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateLookup" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { - BOOL bSorted; + sal_Bool bSorted; if (nParamCount == 4) bSorted = GetBool(); else - bSorted = TRUE; + bSorted = sal_True; double fIndex = ::rtl::math::approxFloor( GetDouble() ) - 1.0; ScMatrixRef pMat = NULL; SCSIZE nC = 0, nR = 0; @@ -5546,7 +5546,7 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) { rParam.nCol2 = nCol2; rParam.nRow2 = nRow1; // nur in der ersten Zeile suchen - rParam.bByRow = FALSE; + rParam.bByRow = sal_False; } // if ( HLookup ) else { @@ -5554,10 +5554,10 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) rParam.nRow2 = nRow2; rParam.nTab = nTab1; } - rParam.bMixedComparison = TRUE; + rParam.bMixedComparison = sal_True; ScQueryEntry& rEntry = rParam.GetEntry(0); - rEntry.bDoQuery = TRUE; + rEntry.bDoQuery = sal_True; if ( bSorted ) rEntry.eOp = SC_LESS_EQUAL; if ( !FillEntry(rEntry) ) @@ -5659,16 +5659,16 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) else { rEntry.nField = nCol1; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; SCCOL nCol = 0; SCROW nRow = 0; if ( bSorted ) rEntry.eOp = SC_LESS_EQUAL; if ( HLookup ) { - ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE); + ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False); // advance Entry.nField in Iterator upon switching columns - aCellIter.SetAdvanceQueryParamEntryField( TRUE ); + aCellIter.SetAdvanceQueryParamEntryField( sal_True ); if ( bSorted ) { SCROW nRow1_temp; @@ -5676,7 +5676,7 @@ void ScInterpreter::CalculateLookup(BOOL HLookup) } else if ( aCellIter.GetFirst() ) { - bFound = TRUE; + bFound = sal_True; nCol = aCellIter.GetCol(); } nRow = nZIndex; @@ -5709,14 +5709,14 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) { case svDouble: { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = GetDouble(); } break; case svString: { const String sStr = GetString(); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } break; @@ -5732,21 +5732,21 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) ScBaseCell* pCell = GetCell( aAdr ); if (HasCellValueData(pCell)) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = GetCellValue( aAdr, pCell ); } else { if ( GetCellType( pCell ) == CELLTYPE_NOTE ) { - rEntry.bQueryByString = FALSE; + rEntry.bQueryByString = sal_False; rEntry.nVal = 0.0; } else { String sStr; GetCellString(sStr, pCell); - rEntry.bQueryByString = TRUE; + rEntry.bQueryByString = sal_True; *rEntry.pStr = sStr; } } @@ -5769,13 +5769,13 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry) void ScInterpreter::ScVLookup() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVLookup" ); - CalculateLookup(FALSE); + CalculateLookup(sal_False); } void ScInterpreter::ScSubTotal() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSubTotal" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCountMin( nParamCount, 2 ) ) { // We must fish the 1st parameter deep from the stack! And push it on top. @@ -5787,7 +5787,7 @@ void ScInterpreter::ScSubTotal() else { cPar = nParamCount - 1; - glSubTotal = TRUE; + glSubTotal = sal_True; switch( nFunc ) { case SUBTOTAL_FUNC_AVE : ScAverage(); break; @@ -5803,7 +5803,7 @@ void ScInterpreter::ScSubTotal() case SUBTOTAL_FUNC_VARP : ScVarP(); break; default : PushIllegalArgument(); break; } - glSubTotal = FALSE; + glSubTotal = sal_False; } // Get rid of the 1st (fished) parameter. double nVal = GetDouble(); @@ -5812,14 +5812,14 @@ void ScInterpreter::ScSubTotal() } } -ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) +ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDBParams" ); - BOOL bAllowMissingField = FALSE; + sal_Bool bAllowMissingField = sal_False; if ( rMissingField ) { - bAllowMissingField = TRUE; - rMissingField = FALSE; + bAllowMissingField = sal_True; + rMissingField = sal_False; } if ( GetByte() == 3 ) { @@ -5828,20 +5828,20 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) if (!pQueryRef.get()) return NULL; - BOOL bByVal = TRUE; + sal_Bool bByVal = sal_True; double nVal = 0.0; String aStr; ScRange aMissingRange; - BOOL bRangeFake = FALSE; + sal_Bool bRangeFake = sal_False; switch (GetStackType()) { case svDouble : nVal = ::rtl::math::approxFloor( GetDouble() ); if ( bAllowMissingField && nVal == 0.0 ) - rMissingField = TRUE; // fake missing parameter + rMissingField = sal_True; // fake missing parameter break; case svString : - bByVal = FALSE; + bByVal = sal_False; aStr = GetString(); break; case svSingleRef : @@ -5853,7 +5853,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) nVal = GetCellValue( aAdr, pCell ); else { - bByVal = FALSE; + bByVal = sal_False; GetCellString(aStr, pCell); } } @@ -5861,7 +5861,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) case svDoubleRef : if ( bAllowMissingField ) { // fake missing parameter for old SO compatibility - bRangeFake = TRUE; + bRangeFake = sal_True; PopDoubleRef( aMissingRange ); } else @@ -5873,7 +5873,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) case svMissing : PopError(); if ( bAllowMissingField ) - rMissingField = TRUE; + rMissingField = sal_True; else SetError( errIllegalParameter ); break; @@ -5891,7 +5891,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) { // range parameter must match entire database range if (pDBRef->isRangeEqual(aMissingRange)) - rMissingField = TRUE; + rMissingField = sal_True; else SetError( errIllegalParameter ); } @@ -5952,9 +5952,9 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::DBIterator" ); double nErg = 0.0; double fMem = 0.0; - BOOL bNull = TRUE; - ULONG nCount = 0; - BOOL bMissingField = FALSE; + sal_Bool bNull = sal_True; + sal_uLong nCount = 0; + sal_Bool bMissingField = sal_False; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { @@ -5978,7 +5978,7 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) case ifSUM: if ( bNull && aValue.mfValue != 0.0 ) { - bNull = FALSE; + bNull = sal_False; fMem = aValue.mfValue; } else @@ -6018,11 +6018,11 @@ void ScInterpreter::ScDBSum() void ScInterpreter::ScDBCount() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBCount" ); - BOOL bMissingField = TRUE; + sal_Bool bMissingField = sal_True; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { - ULONG nCount = 0; + sal_uLong nCount = 0; if ( bMissingField && pQueryParam->GetType() == ScDBQueryParamBase::INTERNAL ) { // count all matching records // TODO: currently the QueryIterators only return cell pointers of @@ -6072,11 +6072,11 @@ void ScInterpreter::ScDBCount() void ScInterpreter::ScDBCount2() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBCount2" ); - BOOL bMissingField = TRUE; + sal_Bool bMissingField = sal_True; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { - ULONG nCount = 0; + sal_uLong nCount = 0; pQueryParam->mbSkipString = false; ScDBQueryDataIterator aValIter( pDok, pQueryParam.release()); ScDBQueryDataIterator::Value aValue; @@ -6133,7 +6133,7 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount ) rValCount = 0.0; double fSum = 0.0; - BOOL bMissingField = FALSE; + sal_Bool bMissingField = sal_False; auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); if (pQueryParam.get()) { @@ -6248,7 +6248,7 @@ ScTokenArray* lcl_CreateExternalRefTokenArray( const ScAddress& rPos, ScDocument void ScInterpreter::ScIndirect() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIndirect" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { bool bTryXlA1 = true; // whether to try XL_A1 style as well. @@ -6311,7 +6311,7 @@ void ScInterpreter::ScIndirect() if (!pNames) break; - USHORT nPos = 0; + sal_uInt16 nPos = 0; if (!pNames->SearchName( sRefStr, nPos)) break; @@ -6359,7 +6359,7 @@ void ScInterpreter::ScAddressFunc() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAddressFunc" ); String sTabStr; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if( !MustHaveParamCount( nParamCount, 2, 5 ) ) return; @@ -6370,10 +6370,10 @@ void ScInterpreter::ScAddressFunc() if( nParamCount >= 4 && 0.0 == ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0))) eConv = FormulaGrammar::CONV_XL_R1C1; - USHORT nFlags = SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE; // default + sal_uInt16 nFlags = SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE; // default if( nParamCount >= 3 ) { - USHORT n = (USHORT) ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0)); + sal_uInt16 n = (sal_uInt16) ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0)); switch ( n ) { default : @@ -6432,7 +6432,7 @@ void ScInterpreter::ScAddressFunc() void ScInterpreter::ScOffset() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScOffset" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 5 ) ) { long nColNew = -1, nRowNew = -1, nColPlus, nRowPlus; @@ -6508,7 +6508,7 @@ void ScInterpreter::ScOffset() void ScInterpreter::ScIndex() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIndex" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 4 ) ) { long nArea; @@ -6547,7 +6547,7 @@ void ScInterpreter::ScIndex() { if (nArea != 1) SetError(errIllegalArgument); - USHORT nOldSp = sp; + sal_uInt16 nOldSp = sp; ScMatrixRef pMat = GetMatrix(); if (pMat) { @@ -6645,7 +6645,7 @@ void ScInterpreter::ScIndex() SCCOL nCol2 = 0; SCROW nRow2 = 0; SCTAB nTab2 = 0; - BOOL bRowArray = FALSE; + sal_Bool bRowArray = sal_False; if (GetStackType() == svRefList) { FormulaTokenRef xRef = PopToken(); @@ -6658,13 +6658,13 @@ void ScInterpreter::ScIndex() DoubleRefToRange( (*(static_cast<ScToken*>(xRef.get())->GetRefList()))[nArea-1], aRange); aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); if ( nParamCount == 2 && nRow1 == nRow2 ) - bRowArray = TRUE; + bRowArray = sal_True; } else { PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); if ( nParamCount == 2 && nRow1 == nRow2 ) - bRowArray = TRUE; + bRowArray = sal_True; } if ( nTab1 != nTab2 || (nCol > 0 && nCol1+nCol-1 > nCol2) || @@ -6715,7 +6715,7 @@ void ScInterpreter::ScMultiArea() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMultiArea" ); // Legacy support, convert to RefList - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (MustHaveParamCountMin( nParamCount, 1)) { while (!nGlobalError && nParamCount-- > 1) @@ -6729,7 +6729,7 @@ void ScInterpreter::ScMultiArea() void ScInterpreter::ScAreas() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAreas" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if (MustHaveParamCount( nParamCount, 1)) { size_t nCount = 0; @@ -6767,7 +6767,7 @@ void ScInterpreter::ScAreas() void ScInterpreter::ScCurrency() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCurrency" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { String aStr; @@ -6796,18 +6796,18 @@ void ScInterpreter::ScCurrency() Color* pColor = NULL; if ( fDec < 0.0 ) fDec = 0.0; - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_CURRENCY, ScGlobal::eLnge); - if ( (USHORT) fDec != pFormatter->GetFormatPrecision( nIndex ) ) + if ( (sal_uInt16) fDec != pFormatter->GetFormatPrecision( nIndex ) ) { String sFormatString; pFormatter->GenerateFormat(sFormatString, nIndex, ScGlobal::eLnge, - TRUE, // mit Tausenderpunkt - FALSE, // nicht rot - (USHORT) fDec,// Nachkommastellen + sal_True, // mit Tausenderpunkt + sal_False, // nicht rot + (sal_uInt16) fDec,// Nachkommastellen 1); // 1 Vorkommanull if (!pFormatter->GetPreviewString(sFormatString, fVal, @@ -6858,16 +6858,16 @@ void ScInterpreter::ScReplace() void ScInterpreter::ScFixed() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFixed" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 3 ) ) { String aStr; double fDec; - BOOL bThousand; + sal_Bool bThousand; if (nParamCount == 3) bThousand = !GetBool(); // Param TRUE: keine Tausenderpunkte else - bThousand = TRUE; + bThousand = sal_True; if (nParamCount >= 2) { fDec = ::rtl::math::approxFloor(GetDoubleWithDefault( 2.0 )); @@ -6893,15 +6893,15 @@ void ScInterpreter::ScFixed() String sFormatString; if (fDec < 0.0) fDec = 0.0; - ULONG nIndex = pFormatter->GetStandardFormat( + sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); pFormatter->GenerateFormat(sFormatString, nIndex, ScGlobal::eLnge, bThousand, // mit Tausenderpunkt - FALSE, // nicht rot - (USHORT) fDec,// Nachkommastellen + sal_False, // nicht rot + (sal_uInt16) fDec,// Nachkommastellen 1); // 1 Vorkommanull if (!pFormatter->GetPreviewString(sFormatString, fVal, @@ -6918,7 +6918,7 @@ void ScInterpreter::ScFixed() void ScInterpreter::ScFind() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScFind" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { double fAnz; @@ -6957,7 +6957,7 @@ void ScInterpreter::ScExact() void ScInterpreter::ScLeft() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLeft" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { xub_StrLen n; @@ -6984,7 +6984,7 @@ void ScInterpreter::ScLeft() void ScInterpreter::ScRight() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRight" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { xub_StrLen n; @@ -7013,7 +7013,7 @@ void ScInterpreter::ScSearch() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSearch" ); double fAnz; - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { if (nParamCount == 3) @@ -7038,7 +7038,7 @@ void ScInterpreter::ScSearch() utl::SearchParam::SearchType eSearchType = (MayBeRegExp( SearchStr, pDok ) ? utl::SearchParam::SRCH_REGEXP : utl::SearchParam::SRCH_NORMAL); - utl::SearchParam sPar(SearchStr, eSearchType, FALSE, FALSE, FALSE); + utl::SearchParam sPar(SearchStr, eSearchType, sal_False, sal_False, sal_False); utl::TextSearch sT( sPar, *ScGlobal::pCharClass ); int nBool = sT.SearchFrwrd(sStr, &nPos, &nEndPos); if (!nBool) @@ -7091,7 +7091,7 @@ void ScInterpreter::ScText() PushTempToken( xTok); // Temporarily override the ConvertStringToValue() // error for GetCellValue() / GetCellValueOrZero() - USHORT nSErr = mnStringNoValueError; + sal_uInt16 nSErr = mnStringNoValueError; mnStringNoValueError = errNotNumericString; fVal = GetDouble(); mnStringNoValueError = nSErr; @@ -7144,7 +7144,7 @@ void ScInterpreter::ScText() void ScInterpreter::ScSubstitute() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSubstitute" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { xub_StrLen nAnz; @@ -7168,7 +7168,7 @@ void ScInterpreter::ScSubstitute() xub_StrLen nCount = 0; xub_StrLen nNewLen = sNewStr.Len(); xub_StrLen nOldLen = sOldStr.Len(); - while( TRUE ) + while( sal_True ) { nPos = sStr.Search( sOldStr, nPos ); if (nPos != STRING_NOTFOUND) @@ -7232,7 +7232,7 @@ void ScInterpreter::ScRept() void ScInterpreter::ScConcat() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScConcat" ); - BYTE nParamCount = GetByte(); + sal_uInt8 nParamCount = GetByte(); String aRes; while( nParamCount-- > 0) { @@ -7246,8 +7246,8 @@ void ScInterpreter::ScConcat() void ScInterpreter::ScErrorType() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScErrorType" ); - USHORT nErr; - USHORT nOldError = nGlobalError; + sal_uInt16 nErr; + sal_uInt16 nOldError = nGlobalError; nGlobalError = 0; switch ( GetStackType() ) { @@ -7325,13 +7325,13 @@ void ScInterpreter::ScErrorType() } -BOOL ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) +sal_Bool ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MayBeRegExp" ); if ( pDoc && !pDoc->GetDocOptions().IsFormulaRegexEnabled() ) - return FALSE; + return sal_False; if ( !rStr.Len() || (rStr.Len() == 1 && rStr.GetChar(0) != '.') ) - return FALSE; // einzelnes Metazeichen kann keine RegExp sein + return sal_False; // einzelnes Metazeichen kann keine RegExp sein static const sal_Unicode cre[] = { '.','*','+','?','[',']','^','$','\\','<','>','(',')','|', 0 }; const sal_Unicode* p1 = rStr.GetBuffer(); sal_Unicode c1; @@ -7341,17 +7341,17 @@ BOOL ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc ) while ( *p2 ) { if ( c1 == *p2++ ) - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } static bool lcl_LookupQuery( ScAddress & o_rResultPos, ScDocument * pDoc, const ScQueryParam & rParam, const ScQueryEntry & rEntry ) { bool bFound = false; - ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, FALSE); + ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, sal_False); if (rEntry.eOp != SC_EQUAL) { // range lookup <= or >= |