diff options
author | Eike Rathke <erack@erack.de> | 2011-08-10 01:32:41 +0200 |
---|---|---|
committer | Eike Rathke <erack@erack.de> | 2011-08-10 01:32:41 +0200 |
commit | ea4470cbaca80a3d3f5816434918dc99cd989d8d (patch) | |
tree | 3b10b0ab9d73d6fc920a523e1ab9116c685191e0 /svl/source | |
parent | 5eb0b845a1fa9f120199bad64b7f705e8c3d105c (diff) |
Number formatter sal_Bool -> bool clean-up and cosmetics
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/numbers/numfmuno.cxx | 16 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 362 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.hxx | 100 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 354 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 440 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 112 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.hxx | 66 |
7 files changed, 730 insertions, 720 deletions
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 35f58e4ebee5..9a78aaed2273 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -341,7 +341,7 @@ rtl::OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToPreviewString LanguageType eLang = lcl_GetLanguage( nLocale ); Color* pColor = NULL; - sal_Bool bOk; + bool bOk; if ( bAllowEnglish ) bOk = pFormatter->GetPreviewStringGuess( aFormString, fValue, aOutString, &pColor, eLang ); @@ -377,7 +377,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( LanguageType eLang = lcl_GetLanguage( nLocale ); Color* pColor = NULL; - sal_Bool bOk; + bool bOk; if ( bAllowEnglish ) bOk = pFormatter->GetPreviewStringGuess( aFormString, fValue, aOutString, &pColor, eLang ); @@ -517,7 +517,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat, sal_uInt32 nKey = 0; xub_StrLen nCheckPos = 0; short nType = 0; - sal_Bool bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang ); + bool bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang ); if (bOk) nRet = nKey; else if (nCheckPos) @@ -549,7 +549,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFo sal_uInt32 nKey = 0; xub_StrLen nCheckPos = 0; short nType = 0; - sal_Bool bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang ); + bool bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang ); if (bOk || nKey > 0) nRet = nKey; else if (nCheckPos) @@ -758,7 +758,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL; if (pFormat) { - sal_Bool bThousand, bRed; + bool bThousand, bRed; sal_uInt16 nDecimals, nLeading; String aString = aPropertyName; @@ -826,7 +826,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro else if (aString.EqualsAscii( PROPERTYNAME_CURRABB )) { String aSymbol, aExt; - sal_Bool bBank = sal_False; + bool bBank = false; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank, aSymbol, aExt, pFormat->GetLanguage() ); @@ -888,7 +888,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue if (pFormat) { String aSymbol, aExt, aAbb; - sal_Bool bBank = sal_False; + bool bBank = false; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank, aSymbol, aExt, pFormat->GetLanguage() ); @@ -900,7 +900,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); //! SvNumberformat Member bStandard rausreichen? sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); - sal_Bool bThousand, bRed; + bool bThousand, bRed; sal_uInt16 nDecimals, nLeading; pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); lang::Locale aLocale( MsLangId::convertLanguageToLocale( diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index d18ea9de19e9..ad63f02d1469 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -141,7 +141,7 @@ void ImpSvNumberInputScan::Reset() //--------------------------------------------------------------------------- // // static -inline sal_Bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) +inline bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) { return c < 128 && isdigit( (unsigned char) c ); } @@ -170,19 +170,19 @@ void ImpSvNumberInputScan::TransformInput( String& rStr ) // Only simple unsigned floating point values without any error detection, // decimal separator has to be '.' -double ImpSvNumberInputScan::StringToDouble( const String& rStr, sal_Bool bForceFraction ) +double ImpSvNumberInputScan::StringToDouble( const String& rStr, bool bForceFraction ) { double fNum = 0.0; double fFrac = 0.0; int nExp = 0; xub_StrLen nPos = 0; xub_StrLen nLen = rStr.Len(); - sal_Bool bPreSep = !bForceFraction; + bool bPreSep = !bForceFraction; while (nPos < nLen) { if (rStr.GetChar(nPos) == '.') - bPreSep = sal_False; + bPreSep = false; else if (bPreSep) fNum = fNum * 10.0 + (double) (rStr.GetChar(nPos) - '0'); else @@ -226,11 +226,11 @@ enum ScanState // States der Turing-Maschine SsGetString = 3 }; -sal_Bool ImpSvNumberInputScan::NextNumberStringSymbol( +bool ImpSvNumberInputScan::NextNumberStringSymbol( const sal_Unicode*& pStr, String& rSymbol ) { - sal_Bool isNumber = sal_False; + bool isNumber = false; sal_Unicode cToken; ScanState eState = SsStart; register const sal_Unicode* pHere = pStr; @@ -245,7 +245,7 @@ sal_Bool ImpSvNumberInputScan::NextNumberStringSymbol( if ( MyIsdigit( cToken ) ) { eState = SsGetValue; - isNumber = sal_True; + isNumber = true; } else eState = SsGetString; @@ -291,11 +291,11 @@ sal_Bool ImpSvNumberInputScan::NextNumberStringSymbol( // FIXME: should be grouping; it is only used though in case nAnzStrings is // near SV_MAX_ANZ_INPUT_STRINGS, in NumberStringDivision(). -sal_Bool ImpSvNumberInputScan::SkipThousands( +bool ImpSvNumberInputScan::SkipThousands( const sal_Unicode*& pStr, String& rSymbol ) { - sal_Bool res = sal_False; + bool res = false; sal_Unicode cToken; const String& rThSep = pFormatter->GetNumThousandSep(); register const sal_Unicode* pHere = pStr; @@ -328,7 +328,7 @@ sal_Bool ImpSvNumberInputScan::SkipThousands( if (nCounter == 3) { eState = SsStart; - res = sal_True; // .000 combination found + res = true; // .000 combination found } } else @@ -365,7 +365,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) { if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) ) { // Zahl - IsNum[nAnzStrings] = sal_True; + IsNum[nAnzStrings] = true; nNums[nAnzNums] = nAnzStrings; nAnzNums++; if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 && @@ -375,7 +375,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) } else { - IsNum[nAnzStrings] = sal_False; + IsNum[nAnzStrings] = false; } nAnzStrings++; } @@ -385,34 +385,34 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) //--------------------------------------------------------------------------- // Whether rString contains rWhat at nPos -sal_Bool ImpSvNumberInputScan::StringContainsImpl( const String& rWhat, +bool ImpSvNumberInputScan::StringContainsImpl( const String& rWhat, const String& rString, xub_StrLen nPos ) { if ( nPos + rWhat.Len() <= rString.Len() ) return StringPtrContainsImpl( rWhat, rString.GetBuffer(), nPos ); - return sal_False; + return false; } //--------------------------------------------------------------------------- // Whether pString contains rWhat at nPos -sal_Bool ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, +bool ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ) { if ( rWhat.Len() == 0 ) - return sal_False; + return false; register const sal_Unicode* pWhat = rWhat.GetBuffer(); register const sal_Unicode* const pEnd = pWhat + rWhat.Len(); register const sal_Unicode* pStr = pString + nPos; while ( pWhat < pEnd ) { if ( *pWhat != *pStr ) - return sal_False; + return false; pWhat++; pStr++; } - return sal_True; + return true; } @@ -421,15 +421,15 @@ sal_Bool ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, // // ueberspringt genau das angegebene Zeichen -inline sal_Bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString, +inline bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString, xub_StrLen& nPos ) { if ((nPos < rString.Len()) && (rString.GetChar(nPos) == c)) { nPos++; - return sal_True; + return true; } - return sal_False; + return false; } @@ -458,15 +458,15 @@ inline void ImpSvNumberInputScan::SkipBlanks( const String& rString, // // jump over rWhat in rString at nPos -inline sal_Bool ImpSvNumberInputScan::SkipString( const String& rWhat, +inline bool ImpSvNumberInputScan::SkipString( const String& rWhat, const String& rString, xub_StrLen& nPos ) { if ( StringContains( rWhat, rString, nPos ) ) { nPos = nPos + rWhat.Len(); - return sal_True; + return true; } - return sal_False; + return false; } @@ -475,7 +475,7 @@ inline sal_Bool ImpSvNumberInputScan::SkipString( const String& rWhat, // // recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping -inline sal_Bool ImpSvNumberInputScan::GetThousandSep( +inline bool ImpSvNumberInputScan::GetThousandSep( const String& rString, xub_StrLen& nPos, sal_uInt16 nStringPos ) @@ -487,7 +487,7 @@ inline sal_Bool ImpSvNumberInputScan::GetThousandSep( if (!( (rString == rSep || bSpaceBreak) // nothing else && nStringPos < nAnzStrings - 1 // safety first! && IsNum[nStringPos+1] )) // number follows - return sal_False; // no? => out + return false; // no? => out utl::DigitGroupingIterator aGrouping( pFormatter->GetLocaleData()->getDigitGrouping()); @@ -504,9 +504,9 @@ inline sal_Bool ImpSvNumberInputScan::GetThousandSep( ) { nPos = nPos + rSep.Len(); - return sal_True; + return true; } - return sal_False; + return false; } @@ -514,8 +514,8 @@ inline sal_Bool ImpSvNumberInputScan::GetThousandSep( // GetLogical // // Conversion of text to logial value -// "sal_True" => 1: -// "sal_False"=> -1: +// "true" => 1: +// "false"=> -1: // else => 0: short ImpSvNumberInputScan::GetLogical( const String& rString ) @@ -622,10 +622,10 @@ int ImpSvNumberInputScan::GetDayOfWeek( const String& rString, xub_StrLen& nPos // GetCurrency // // Lesen eines Waehrungssysmbols -// '$' => sal_True -// sonst => sal_False +// '$' => true +// sonst => false -sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, +bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, const SvNumberformat* pFormat ) { if ( rString.Len() > nPos ) @@ -640,7 +640,7 @@ sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& n if ( StringContains( aUpperCurrSymbol, rString, nPos ) ) { nPos = nPos + aUpperCurrSymbol.Len(); - return sal_True; + return true; } if ( pFormat ) { @@ -653,14 +653,14 @@ sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& n if ( StringContains( aSymbol, rString, nPos ) ) { nPos = nPos + aSymbol.Len(); - return sal_True; + return true; } } } } } - return sal_False; + return false; } @@ -670,15 +670,15 @@ sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& n // Lesen des Zeitsymbols (AM od. PM) f. kurze Zeitangabe // // Rueckgabe: -// "AM" od. "PM" => sal_True -// sonst => sal_False +// "AM" od. "PM" => true +// sonst => false // // nAmPos: // "AM" => 1 // "PM" => -1 // sonst => 0 -sal_Bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos ) +bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) @@ -689,17 +689,17 @@ sal_Bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& n { nAmPm = 1; nPos = nPos + pLoc->getTimeAM().Len(); - return sal_True; + return true; } else if ( StringContains( pChr->upper( pLoc->getTimePM() ), rString, nPos ) ) { nAmPm = -1; nPos = nPos + pLoc->getTimePM().Len(); - return sal_True; + return true; } } - return sal_False; + return false; } @@ -707,10 +707,10 @@ sal_Bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& n // GetDecSep // // Lesen eines Dezimaltrenners (',') -// ',' => sal_True -// sonst => sal_False +// ',' => true +// sonst => false -inline sal_Bool ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos ) +inline bool ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) { @@ -718,17 +718,17 @@ inline sal_Bool ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrL if ( rString.Equals( rSep, nPos, rSep.Len() ) ) { nPos = nPos + rSep.Len(); - return sal_True; + return true; } } - return sal_False; + return false; } //--------------------------------------------------------------------------- // read a hundredth seconds separator -inline sal_Bool ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos ) +inline bool ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) { @@ -736,10 +736,10 @@ inline sal_Bool ImpSvNumberInputScan::GetTime100SecSep( const String& rString, x if ( rString.Equals( rSep, nPos, rSep.Len() ) ) { nPos = nPos + rSep.Len(); - return sal_True; + return true; } } - return sal_False; + return false; } @@ -807,15 +807,15 @@ short ImpSvNumberInputScan::GetESign( const String& rString, xub_StrLen& nPos ) // i counts string portions, j counts numbers thereof. // It should had been called SkipNumber instead. -inline sal_Bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j ) +inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j ) { if ( i < nAnzStrings && IsNum[i] ) { j++; i++; - return sal_True; + return true; } - return sal_False; + return false; } @@ -864,7 +864,7 @@ void ImpSvNumberInputScan::GetTimeRef( if (nIndex - nStartIndex < nAnz) nSecond = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32(); if (nIndex - nStartIndex < nAnz) - fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], sal_True ); + fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], true ); if (nAmPm == -1 && nHour != 12) // PM nHour += 12; else if (nAmPm == 1 && nHour == 12) // 12 AM @@ -950,7 +950,7 @@ bool ImpSvNumberInputScan::MayBeIso8601() //--------------------------------------------------------------------------- // GetDateRef -sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, +bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, const SvNumberformat* pFormat ) { using namespace ::com::sun::star::i18n; @@ -977,7 +977,7 @@ sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, eEDF = NF_EVALDATEFORMAT_INTL; nFormatOrder = 1; } - sal_Bool res = sal_True; + bool res = true; const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData(); CalendarWrapper* pCal = pFormatter->GetCalendar(); @@ -986,45 +986,45 @@ sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, pCal->setGregorianDateTime( Date() ); // today String aOrgCalendar; // empty => not changed yet DateFormat DateFmt; - sal_Bool bFormatTurn; + bool bFormatTurn; switch ( eEDF ) { case NF_EVALDATEFORMAT_INTL : - bFormatTurn = sal_False; + bFormatTurn = false; DateFmt = pLoc->getDateFormat(); break; case NF_EVALDATEFORMAT_FORMAT : - bFormatTurn = sal_True; + bFormatTurn = true; DateFmt = pFormat->GetDateOrder(); break; case NF_EVALDATEFORMAT_INTL_FORMAT : if ( nTryOrder == 1 ) { - bFormatTurn = sal_False; + bFormatTurn = false; DateFmt = pLoc->getDateFormat(); } else { - bFormatTurn = sal_True; + bFormatTurn = true; DateFmt = pFormat->GetDateOrder(); } break; case NF_EVALDATEFORMAT_FORMAT_INTL : if ( nTryOrder == 2 ) { - bFormatTurn = sal_False; + bFormatTurn = false; DateFmt = pLoc->getDateFormat(); } else { - bFormatTurn = sal_True; + bFormatTurn = true; DateFmt = pFormat->GetDateOrder(); } break; default: OSL_FAIL( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" ); DateFmt = YMD; - bFormatTurn = sal_False; + bFormatTurn = false; } if ( bFormatTurn ) { @@ -1063,7 +1063,7 @@ input for the following reasons: #endif } - res = sal_True; + res = true; nCounter = 0; // For incomplete dates, always assume first day of month if not specified. pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, 1 ); @@ -1074,7 +1074,7 @@ input for the following reasons: if (nMonthPos) // only month (Jan) pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); else - res = sal_False; + res = false; break; case 1: // only one number @@ -1103,7 +1103,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = sal_False; + res = false; break; } break; @@ -1118,12 +1118,12 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = sal_False; + res = false; break; } break; default: - res = sal_False; + res = false; break; } // switch (nMonthPos) break; @@ -1210,7 +1210,7 @@ input for the following reasons: } break; default: - res = sal_False; + res = false; break; } } @@ -1249,12 +1249,12 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = sal_False; + res = false; break; } break; default: // else, e.g. month at the end (94 10 Jan) - res = sal_False; + res = false; break; } // switch (nMonthPos) break; @@ -1299,7 +1299,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = sal_False; + res = false; break; } } @@ -1314,7 +1314,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(1) ); break; default: - res = sal_False; + res = false; break; } break; @@ -1332,13 +1332,13 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = sal_False; + res = false; break; } break; default: // else, e.g. month at the end (94 10 Jan 8:23) nCounter = 2; - res = sal_False; + res = false; break; } // switch (nMonthPos) break; @@ -1352,7 +1352,7 @@ input for the following reasons: nTryOrder = nFormatOrder; // break for } else - res = sal_False; + res = false; if ( aOrgCalendar.Len() ) pCal->loadCalendar( aOrgCalendar, pLoc->getLocale() ); // restore calendar @@ -1372,7 +1372,7 @@ input for the following reasons: {0,0,0} }; lang::Locale aLocale; - sal_Bool bValid; + bool bValid; sal_Int16 nDay, nMyMonth, nYear, nHour, nMinute, nSecond; sal_Int16 nDaySet, nMonthSet, nYearSet, nHourSet, nMinuteSet, nSecondSet; sal_Int16 nZO, nDST1, nDST2, nDST, nZOmillis, nDST1millis, nDST2millis, nDSTmillis; @@ -1450,10 +1450,10 @@ input for the following reasons: // ScanStartString // // ersten String analysieren -// Alles weg => sal_True -// sonst => sal_False +// Alles weg => true +// sonst => false -sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, +bool ImpSvNumberInputScan::ScanStartString( const String& rString, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; @@ -1471,7 +1471,7 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, { // Match against format in any case, so later on for a "x1-2-3" input // we may distinguish between a xy-m-d (or similar) date and a x0-0-0 // format. No sign detection here! - if ( ScanStringNumFor( rString, nPos, pFormat, 0, sal_True ) ) + if ( ScanStringNumFor( rString, nPos, pFormat, 0, true ) ) nMatchedAllStrings |= nMatchedStartString; else nMatchedAllStrings = 0; @@ -1551,7 +1551,7 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, return MatchedReturn(); } - return sal_True; + return true; } @@ -1559,10 +1559,10 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, // ScanMidString // // String in der Mitte analysieren -// Alles weg => sal_True -// sonst => sal_False +// Alles weg => true +// sonst => false -sal_Bool ImpSvNumberInputScan::ScanMidString( const String& rString, +bool ImpSvNumberInputScan::ScanMidString( const String& rString, sal_uInt16 nStringPos, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; @@ -1793,10 +1793,10 @@ sal_Bool ImpSvNumberInputScan::ScanMidString( const String& rString, if ( nMatchedAllStrings & ~nMatchedVirgin ) eScannedType = eOldScannedType; else - return sal_False; + return false; } - return sal_True; + return true; } @@ -1804,10 +1804,10 @@ sal_Bool ImpSvNumberInputScan::ScanMidString( const String& rString, // ScanEndString // // Schlussteil analysieren -// Alles weg => sal_True -// sonst => sal_False +// Alles weg => true +// sonst => false -sal_Bool ImpSvNumberInputScan::ScanEndString( const String& rString, +bool ImpSvNumberInputScan::ScanEndString( const String& rString, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; @@ -2038,29 +2038,29 @@ sal_Bool ImpSvNumberInputScan::ScanEndString( const String& rString, { // does input EndString equal EndString in Format? if ( !ScanStringNumFor( rString, nPos, pFormat, 0xFFFF ) ) - return sal_False; + return false; } - return sal_True; + return true; } -sal_Bool ImpSvNumberInputScan::ScanStringNumFor( +bool ImpSvNumberInputScan::ScanStringNumFor( const String& rString, // String to scan xub_StrLen nPos, // Position until which was consumed const SvNumberformat* pFormat, // The format to match sal_uInt16 nString, // Substring of format, 0xFFFF => last - sal_Bool bDontDetectNegation // Suppress sign detection + bool bDontDetectNegation // Suppress sign detection ) { if ( !pFormat ) - return sal_False; + return false; const ::utl::TransliterationWrapper* pTransliteration = pFormatter->GetTransliteration(); const String* pStr; String aString( rString ); - sal_Bool bFound = sal_False; - sal_Bool bFirst = sal_True; - sal_Bool bContinue = sal_True; + bool bFound = false; + bool bFirst = true; + bool bContinue = true; sal_uInt16 nSub; do { @@ -2070,22 +2070,22 @@ sal_Bool ImpSvNumberInputScan::ScanStringNumFor( do { // Step through subformats, first positive, then negative, then // other, but not the last (text) subformat. - pStr = pFormat->GetNumForString( nSub, nString, sal_True ); + pStr = pFormat->GetNumForString( nSub, nString, true ); if ( pStr && pTransliteration->isEqual( aString, *pStr ) ) { - bFound = sal_True; - bContinue = sal_False; + bFound = true; + bContinue = false; } else if ( nSub < 2 ) ++nSub; else - bContinue = sal_False; + bContinue = false; } while ( bContinue ); if ( !bFound && bFirst && nPos ) { // try remaining substring - bFirst = sal_False; + bFirst = false; aString.Erase( 0, nPos ); - bContinue = sal_True; + bContinue = true; } } while ( bContinue ); @@ -2097,13 +2097,13 @@ sal_Bool ImpSvNumberInputScan::ScanStringNumFor( aString.EraseAllChars( ' ' ); if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') ) { - bFound = sal_True; + bFound = true; nStringScanSign = -1; nSub = 0; //! not 1 } } if ( !bFound ) - return sal_False; + return false; } else if ( !bDontDetectNegation && (nSub == 1) && pFormat->IsNegativeRealNegative() ) @@ -2131,7 +2131,7 @@ sal_Bool ImpSvNumberInputScan::ScanStringNumFor( nStringScanSign = -1; } nStringScanNumFor = nSub; - return sal_True; + return true; } @@ -2139,9 +2139,9 @@ sal_Bool ImpSvNumberInputScan::ScanStringNumFor( // IsNumberFormatMain // // Recognizes types of number, exponential, fraction, percent, currency, date, time. -// Else text => return sal_False +// Else text => return false -sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( +bool ImpSvNumberInputScan::IsNumberFormatMain( const String& rString, // string to be analyzed double& , // OUT: result as number, if possible const SvNumberformat* pFormat ) // maybe number format set to match against @@ -2149,7 +2149,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( Reset(); NumberStringDivision( rString ); // breakdown into strings and numbers if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS) // too many elements - return sal_False; // Njet, Nope, ... + return false; // Njet, Nope, ... if (nAnzNums == 0) // no number in input { @@ -2165,13 +2165,13 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_LOGICAL; // !!! it's a BOOLEAN nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } else - return sal_False; // simple text + return false; // simple text } else - return sal_False; // simple text + return false; // simple text } sal_uInt16 i = 0; // mark any symbol @@ -2190,14 +2190,14 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } } } else { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) // i=0 - return sal_False; // already an error + return false; // already an error i++; // next symbol, i=1 } GetNextNumber(i,j); // i=1,2 @@ -2212,11 +2212,11 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } } if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return sal_False; + return false; } break; case 2 : // Exactly 2 numbers in input @@ -2224,16 +2224,16 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) - return sal_False; // already an error + return false; // already an error i++; // i=1 } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; // next symbol, i=2,3 GetNextNumber(i,j); // i=3,4 if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return sal_False; + return false; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200. as fraction { if (!nNegCheck && // no sign '(' @@ -2243,7 +2243,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } } } @@ -2253,24 +2253,24 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) - return sal_False; // already an error + return false; // already an error i++; // i=1 if (nDecPos == 1) // decimal separator at start => error - return sal_False; + return false; } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; // i=2,3 if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end - return sal_False; + return false; GetNextNumber(i,j); // i=3,4 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; // i=4,5 GetNextNumber(i,j); // i=5,6 if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return sal_False; + return false; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' @@ -2280,11 +2280,11 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } } if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) - return sal_False; // #36857# not a real fraction + return false; // #36857# not a real fraction } break; default: // More than 3 numbers in input @@ -2292,14 +2292,14 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze startstring if (!ScanStartString( sStrArray[i], pFormat )) - return sal_False; // already an error + return false; // already an error i++; // i=1 if (nDecPos == 1) // decimal separator at start => error - return sal_False; + return false; } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; // i=2,3 sal_uInt16 nThOld = 10; // just not 0 or 1 while (nThOld != nThousand && j < nAnzNums-1) @@ -2308,10 +2308,10 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { // Loop over group separators nThOld = nThousand; if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end - return sal_False; + return false; GetNextNumber(i,j); if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; } if (eScannedType == NUMBERFORMAT_DATE || // long date or @@ -2321,16 +2321,16 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( for (sal_uInt16 k = j; k < nAnzNums-1; k++) { if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at endd - return sal_False; + return false; GetNextNumber(i,j); if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) - return sal_False; + return false; i++; } } GetNextNumber(i,j); if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return sal_False; + return false; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' @@ -2340,11 +2340,11 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return sal_True; + return true; } } if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) - return sal_False; // #36857# not a real fraction + return false; // #36857# not a real fraction } } @@ -2352,18 +2352,18 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( { nMatchedAllStrings &= ~nMatchedVirgin; // did match including nMatchedUsedAsReturn - sal_Bool bDidMatch = (nMatchedAllStrings != 0); + bool bDidMatch = (nMatchedAllStrings != 0); if ( nMatchedAllStrings ) { - sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False); + bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( + nStringScanNumFor, nAnzStrings, nAnzNums ) : false); if ( !bMatch ) nMatchedAllStrings = 0; } if ( nMatchedAllStrings ) eScannedType = eSetType; else if ( bDidMatch ) - return sal_False; + return false; else eScannedType = NUMBERFORMAT_NUMBER; // everything else should have been recognized by now @@ -2371,36 +2371,36 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( else if ( eScannedType == NUMBERFORMAT_DATE ) { // the very relaxed date input checks may interfere with a preset format nMatchedAllStrings &= ~nMatchedVirgin; - sal_Bool bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0); + bool bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0); if ( nMatchedAllStrings ) { - sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False); + bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( + nStringScanNumFor, nAnzStrings, nAnzNums ) : false); if ( !bMatch ) nMatchedAllStrings = 0; } if ( nMatchedAllStrings ) eScannedType = eSetType; else if ( bWasReturn ) - return sal_False; + return false; } else nMatchedAllStrings = 0; // reset flag to no substrings matched - return sal_True; + return true; } //--------------------------------------------------------------------------- -// return sal_True or sal_False depending on the nMatched... state and remember usage -sal_Bool ImpSvNumberInputScan::MatchedReturn() +// return true or false depending on the nMatched... state and remember usage +bool ImpSvNumberInputScan::MatchedReturn() { if ( nMatchedAllStrings & ~nMatchedVirgin ) { nMatchedAllStrings |= nMatchedUsedAsReturn; - return sal_True; + return true; } - return sal_False; + return false; } @@ -2435,7 +2435,7 @@ void ImpSvNumberInputScan::InitText() pUpperDayText[j] = pChrCls->upper( xElems[j].FullName ); pUpperAbbrevDayText[j] = pChrCls->upper( xElems[j].AbbrevName ); } - bTextInitialized = sal_True; + bTextInitialized = true; } @@ -2454,7 +2454,7 @@ void ImpSvNumberInputScan::ChangeIntl() cDecSep == '/' || cDecSep == '.' || cDecSep == pFormatter->GetDateSep().GetChar(0) ); - bTextInitialized = sal_False; + bTextInitialized = false; aUpperCurrSymbol.Erase(); } @@ -2479,7 +2479,7 @@ void ImpSvNumberInputScan::ChangeNullDate( // // => does rString represent a number (also date, time et al) -sal_Bool ImpSvNumberInputScan::IsNumberFormat( +bool ImpSvNumberInputScan::IsNumberFormat( const String& rString, // string to be analyzed short& F_Type, // IN: old type, OUT: new type double& fOutNumber, // OUT: number if convertable @@ -2487,13 +2487,13 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( { String sResString; String aString; - sal_Bool res; // return value + bool res; // return value eSetType = F_Type; // old type set if ( !rString.Len() ) - res = sal_False; + res = false; else if (rString.Len() > 308) // arbitrary - res = sal_False; + res = false; else { // NoMoreUpperNeeded, all comparisons on UpperCase @@ -2509,7 +2509,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( || (nSign && (eScannedType == NUMBERFORMAT_DATE || eScannedType == NUMBERFORMAT_DATETIME)) ) // signed date/datetime - res = sal_False; + res = false; else { // check count of partial number strings switch (eScannedType) @@ -2523,7 +2523,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != 1 ) - res = sal_False; + res = false; } else if (nDecPos == 2) // 1.05 { @@ -2531,7 +2531,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != nThousand+2 ) - res = sal_False; + res = false; } else // 1,100 or 1,100. { @@ -2539,7 +2539,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != nThousand+1 ) - res = sal_False; + res = false; } break; @@ -2547,17 +2547,17 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (nDecPos == 1) // .05 { if (nAnzNums != 2) - res = sal_False; + res = false; } else if (nDecPos == 2) // 1.05 { if (nAnzNums != nThousand+3) - res = sal_False; + res = false; } else // 1,100 or 1,100. { if (nAnzNums != nThousand+2) - res = sal_False; + res = false; } break; @@ -2565,12 +2565,12 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (nMonth) { // month name and numbers if (nAnzNums > 2) - res = sal_False; + res = false; } else { if (nAnzNums > 3) - res = sal_False; + res = false; } break; @@ -2578,12 +2578,12 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 4) - res = sal_False; + res = false; } else { if (nAnzNums > 3) - res = sal_False; + res = false; } break; @@ -2593,12 +2593,12 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 6) - res = sal_False; + res = false; } else { if (nAnzNums > 5) - res = sal_False; + res = false; } } else @@ -2606,12 +2606,12 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 7) - res = sal_False; + res = false; } else { if (nAnzNums > 6) - res = sal_False; + res = false; } } break; @@ -2632,7 +2632,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( else if (nLogical == -1) fOutNumber = 0.0; // False else - res = sal_False; // Oops + res = false; // Oops break; case NUMBERFORMAT_PERCENT: @@ -2675,7 +2675,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( fOutNumber = 0.0; else fOutNumber = DBL_MAX; -/*!*/ return sal_True; +/*!*/ return true; } } @@ -2712,7 +2712,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (fNenner != 0.0) fOutNumber = fZaehler/fNenner; else - res = sal_False; + res = false; } } else // nAnzNums > 2 @@ -2731,7 +2731,7 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( if (fNenner != 0.0) fOutNumber += fZaehler/fNenner; else - res = sal_False; + res = false; } } @@ -2785,17 +2785,17 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( { F_Type = NUMBERFORMAT_TEXT; fOutNumber = -DBL_MAX; - return sal_True; + return true; } else if (fOutNumber > DBL_MAX) // 1.7E308 { F_Type = NUMBERFORMAT_TEXT; fOutNumber = DBL_MAX; - return sal_True; + return true; } } - if (res == sal_False) + if (res == false) { eScannedType = NUMBERFORMAT_TEXT; fOutNumber = 0.0; diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index 4af1ca91ae8a..3b9fd9b82eb2 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -52,7 +52,7 @@ public: const sal_uInt16 nYear ); /// convert input string to number - sal_Bool IsNumberFormat( + bool IsNumberFormat( const String& rString, /// input string short& F_Type, /// format type (in + out) double& fOutNumber, /// value determined (out) @@ -76,16 +76,16 @@ private: String* pUpperDayText; // Array of day of week names, uppercase String* pUpperAbbrevDayText; // Array of day of week names, abbreviated, uppercase String aUpperCurrSymbol; // Currency symbol, uppercase - sal_Bool bTextInitialized; // Whether days and months are initialized + bool bTextInitialized; // Whether days and months are initialized Date* pNullDate; // 30Dec1899 // Variables for provisional results: String sStrArray[SV_MAX_ANZ_INPUT_STRINGS]; // Array of scanned substrings - sal_Bool IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric - sal_uInt16 nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings - sal_uInt16 nAnzStrings; // Total count of scanned substrings - sal_uInt16 nAnzNums; // Count of numeric substrings - sal_Bool bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep} - sal_uInt8 nMatchedAllStrings; // Scan...String() matched all substrings, + bool IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric + sal_uInt16 nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings + sal_uInt16 nAnzStrings; // Total count of scanned substrings + sal_uInt16 nAnzNums; // Count of numeric substrings + bool bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep} + sal_uInt8 nMatchedAllStrings; // Scan...String() matched all substrings, // bit mask of nMatched... constants static const sal_uInt8 nMatchedEndString; // 0x01 @@ -99,27 +99,27 @@ private: // negative => short format short nMonthPos; // 1 = front, 2 = middle // 3 = end - sal_uInt16 nTimePos; // Index of first time separator (+1) + sal_uInt16 nTimePos; // Index of first time separator (+1) short nDecPos; // Index of substring containing "," (+1) short nNegCheck; // '( )' for negative short nESign; // Sign of exponent short nAmPm; // +1 AM, -1 PM, 0 if none short nLogical; // -1 => False, 1 => True - sal_uInt16 nThousand; // Count of group (AKA thousand) separators - sal_uInt16 nPosThousandString; // Position of concatenaded 000,000,000 string + sal_uInt16 nThousand; // Count of group (AKA thousand) separators + sal_uInt16 nPosThousandString; // Position of concatenaded 000,000,000 string short eScannedType; // Scanned type short eSetType; // Preset Type - sal_uInt16 nStringScanNumFor; // Fixed strings recognized in + sal_uInt16 nStringScanNumFor; // Fixed strings recognized in // pFormat->NumFor[nNumForStringScan] short nStringScanSign; // Sign resulting of FixString - sal_uInt16 nYear2000; // Two-digit threshold + sal_uInt16 nYear2000; // Two-digit threshold // Year as 20xx // default 18 // number <= nYear2000 => 20xx // number > nYear2000 => 19xx - sal_uInt16 nTimezonePos; // Index of timezone separator (+1) - sal_uInt8 nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no + sal_uInt16 nTimezonePos; // Index of timezone separator (+1) + sal_uInt8 nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no #ifdef _ZFORFIND_CXX // methods private to implementation void Reset(); // Reset all variables before start of analysis @@ -129,17 +129,17 @@ private: // Convert string to double. // Only simple unsigned floating point values without any error detection, // decimal separator has to be '.' - // If bForceFraction==sal_True the string is taken to be the fractional part + // If bForceFraction==true the string is taken to be the fractional part // of 0.1234 without the leading 0. (thus being just "1234"). double StringToDouble( const String& rStr, - sal_Bool bForceFraction = sal_False ); + bool bForceFraction = false ); - sal_Bool NextNumberStringSymbol( // Next number/string symbol + bool NextNumberStringSymbol( // Next number/string symbol const sal_Unicode*& pStr, String& rSymbol ); - sal_Bool SkipThousands( // Concatenate ,000,23 blocks + bool SkipThousands( // Concatenate ,000,23 blocks const sal_Unicode*& pStr, // in input to 000123 String& rSymbol ); @@ -151,47 +151,47 @@ private: // optimized substring versions - static inline sal_Bool StringContains( // Whether rString contains rWhat at nPos + static inline bool StringContains( // Whether rString contains rWhat at nPos const String& rWhat, const String& rString, xub_StrLen nPos ) { // mostly used with one character if ( rWhat.GetChar(0) != rString.GetChar(nPos) ) - return sal_False; + return false; return StringContainsImpl( rWhat, rString, nPos ); } - static inline sal_Bool StringPtrContains( // Whether pString contains rWhat at nPos + static inline bool StringPtrContains( // Whether pString contains rWhat at nPos const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ) // nPos MUST be a valid offset from pString { // mostly used with one character if ( rWhat.GetChar(0) != *(pString+nPos) ) - return sal_False; + return false; return StringPtrContainsImpl( rWhat, pString, nPos ); } - static sal_Bool StringContainsImpl( //! DO NOT use directly + static bool StringContainsImpl( //! DO NOT use directly const String& rWhat, const String& rString, xub_StrLen nPos ); - static sal_Bool StringPtrContainsImpl( //! DO NOT use directly + static bool StringPtrContainsImpl( //! DO NOT use directly const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ); - static inline sal_Bool SkipChar( // Skip a special character + static inline bool SkipChar( // Skip a special character sal_Unicode c, const String& rString, xub_StrLen& nPos ); static inline void SkipBlanks( // Skip blank const String& rString, xub_StrLen& nPos ); - static inline sal_Bool SkipString( // Jump over rWhat in rString at nPos + static inline bool SkipString( // Jump over rWhat in rString at nPos const String& rWhat, const String& rString, xub_StrLen& nPos ); - inline sal_Bool GetThousandSep( // Recognizes exactly ,111 as group separator + inline bool GetThousandSep( // Recognizes exactly ,111 as group separator const String& rString, xub_StrLen& nPos, sal_uInt16 nStringPos ); @@ -203,17 +203,17 @@ private: int GetDayOfWeek( // Get day of week and advance string position const String& rString, xub_StrLen& nPos ); - sal_Bool GetCurrency( // Get currency symbol and advance string position + bool GetCurrency( // Get currency symbol and advance string position const String& rString, xub_StrLen& nPos, const SvNumberformat* pFormat = NULL ); // optional number format to match against - sal_Bool GetTimeAmPm( // Get symbol AM or PM and advance string position + bool GetTimeAmPm( // Get symbol AM or PM and advance string position const String& rString, xub_StrLen& nPos ); - inline sal_Bool GetDecSep( // Get decimal separator and advance string position + inline bool GetDecSep( // Get decimal separator and advance string position const String& rString, xub_StrLen& nPos ); - inline sal_Bool GetTime100SecSep( // Get hundredth seconds separator and advance string position + inline bool GetTime100SecSep( // Get hundredth seconds separator and advance string position const String& rString, xub_StrLen& nPos ); int GetSign( // Get sign and advance string position @@ -223,30 +223,30 @@ private: const String& rString, xub_StrLen& nPos ); - inline sal_Bool GetNextNumber( // Get next number as array offset + inline bool GetNextNumber( // Get next number as array offset sal_uInt16& i, sal_uInt16& j ); - void GetTimeRef( // Converts time -> double (only decimals) - double& fOutNumber, // result as double + void GetTimeRef( // Converts time -> double (only decimals) + double& fOutNumber, // result as double sal_uInt16 nIndex, // Index of hour in input sal_uInt16 nAnz ); // Count of time substrings in input - sal_uInt16 ImplGetDay ( sal_uInt16 nIndex ); // Day input, 0 if no match - sal_uInt16 ImplGetMonth( sal_uInt16 nIndex ); // Month input, zero based return, NumberOfMonths if no match - sal_uInt16 ImplGetYear ( sal_uInt16 nIndex ); // Year input, 0 if no match - sal_Bool GetDateRef( // Conversion of date to number - double& fDays, // OUT: days diff to null date + sal_uInt16 ImplGetDay ( sal_uInt16 nIndex ); // Day input, 0 if no match + sal_uInt16 ImplGetMonth( sal_uInt16 nIndex ); // Month input, zero based return, NumberOfMonths if no match + sal_uInt16 ImplGetYear ( sal_uInt16 nIndex ); // Year input, 0 if no match + bool GetDateRef( // Conversion of date to number + double& fDays, // OUT: days diff to null date sal_uInt16& nCounter, // Count of date substrings const SvNumberformat* pFormat = NULL ); // optional number format to match against - sal_Bool ScanStartString( // Analyze start of string + bool ScanStartString( // Analyze start of string const String& rString, const SvNumberformat* pFormat = NULL ); - sal_Bool ScanMidString( // Analyze middle substring + bool ScanMidString( // Analyze middle substring const String& rString, sal_uInt16 nStringPos, const SvNumberformat* pFormat = NULL ); - sal_Bool ScanEndString( // Analyze end of string + bool ScanEndString( // Analyze end of string const String& rString, const SvNumberformat* pFormat = NULL ); @@ -256,27 +256,27 @@ private: // Compare rString to substring of array indexed by nString // nString == 0xFFFF => last substring - sal_Bool ScanStringNumFor( + bool ScanStringNumFor( const String& rString, xub_StrLen nPos, const SvNumberformat* pFormat, sal_uInt16 nString, - sal_Bool bDontDetectNegation = sal_False ); + bool bDontDetectNegation = false ); - // if nMatchedAllStrings set nMatchedUsedAsReturn and return sal_True, - // else do nothing and return sal_False - sal_Bool MatchedReturn(); + // if nMatchedAllStrings set nMatchedUsedAsReturn and return true, + // else do nothing and return false + bool MatchedReturn(); //! Be sure that the string to be analyzed is already converted to upper //! case and if it contained native humber digits that they are already //! converted to ASCII. - sal_Bool IsNumberFormatMain( // Main anlyzing function + bool IsNumberFormatMain( // Main anlyzing function const String& rString, double& fOutNumber, // return value if string is numeric const SvNumberformat* pFormat = NULL // optional number format to match against ); - static inline sal_Bool MyIsdigit( sal_Unicode c ); + static inline bool MyIsdigit( sal_Unicode c ); // native number transliteration if necessary void TransformInput( String& rString ); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 8a9a3d5e756d..9242e76a792d 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -89,7 +89,7 @@ using ::rtl::OUString; * (old currency) is recognized as a date (#53155#). */ #define UNKNOWN_SUBSTITUTE LANGUAGE_ENGLISH_US -static sal_Bool bIndexTableInitialized = sal_False; +static bool bIndexTableInitialized = false; static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES]; @@ -174,7 +174,7 @@ void SvNumberFormatterRegistry_Impl::ConfigurationChanged( // ==================================================================== SvNumberFormatterRegistry_Impl* SvNumberFormatter::pFormatterRegistry = NULL; -sal_Bool SvNumberFormatter::bCurrencyTableInitialized = sal_False; +bool SvNumberFormatter::bCurrencyTableInitialized = false; namespace { struct theCurrencyTable : @@ -269,9 +269,9 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) pFormatScanner = new ImpSvNumberformatScan( this ); pFormatTable = NULL; MaxCLOffset = 0; - ImpGenerateFormats( 0, sal_False ); // 0 .. 999 for initialized language formats + ImpGenerateFormats( 0, false ); // 0 .. 999 for initialized language formats pMergeTable = NULL; - bNoZero = sal_False; + bNoZero = false; ::osl::MutexGuard aGuard( GetMutex() ); GetFormatterRegistry().Insert( this ); @@ -362,7 +362,7 @@ sal_uInt16 SvNumberFormatter::GetStandardPrec() return pFormatScanner->GetStandardPrec(); } -void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, sal_Bool bLoadingSO5 ) +void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, bool bLoadingSO5 ) { if (eLnge == LANGUAGE_DONTKNOW) eLnge = UNKNOWN_SUBSTITUTE; @@ -423,12 +423,12 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) // reset ActLnge otherwise ChangeIntl() wouldn't switch if already LANGUAGE_SYSTEM ActLnge = LANGUAGE_DONTKNOW; ChangeIntl( LANGUAGE_SYSTEM ); - ImpGenerateFormats( nCLOffset, sal_True ); + ImpGenerateFormats( nCLOffset, true ); // convert additional and user defined from old system to new system SvNumberformat* pStdFormat = (SvNumberformat*) aFTable.Get( nCLOffset + ZF_STANDARD ); sal_uInt32 nLastKey = nMaxBuiltin; - pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, sal_True ); + pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, true ); aOldTable.First(); while ( aOldTable.Count() ) { @@ -466,34 +466,34 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) delete pOldEntry; } - pFormatScanner->SetConvertMode(sal_False); + pFormatScanner->SetConvertMode(false); pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) ); // append new system additional formats NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); - ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, sal_True ); + ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, true ); } -sal_Bool SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const +bool SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index); if (!pFormat) - return sal_False; + return false; else return pFormat->IsTextFormat(); } -sal_Bool SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const +bool SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index); if (!pFormat) - return sal_False; + return false; else return pFormat->HasTextFormat(); } -sal_Bool SvNumberFormatter::PutEntry(String& rString, +bool SvNumberFormatter::PutEntry(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, // Formatnummer @@ -503,14 +503,14 @@ sal_Bool SvNumberFormatter::PutEntry(String& rString, if (rString.Len() == 0) // keinen Leerstring { nCheckPos = 1; // -> Fehler - return sal_False; + return false; } if (eLnge == LANGUAGE_DONTKNOW) eLnge = IniLnge; ChangeIntl(eLnge); // ggfs. austauschen LanguageType eLge = eLnge; // Umgehung const fuer ConvertMode - sal_Bool bCheck = sal_False; + bool bCheck = false; SvNumberformat* p_Entry = new SvNumberformat(rString, pFormatScanner, pStringScanner, @@ -548,7 +548,7 @@ sal_Bool SvNumberFormatter::PutEntry(String& rString, delete p_Entry; else { - bCheck = sal_True; + bCheck = true; nKey = nPos+1; pStdFormat->SetLastInsertKey((sal_uInt16) (nKey-CLOffset)); } @@ -595,23 +595,23 @@ bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, LanguageType eLnge, LanguageType eNewLnge) { - sal_Bool bRes; + bool bRes; if (eNewLnge == LANGUAGE_DONTKNOW) eNewLnge = IniLnge; - pFormatScanner->SetConvertMode(eLnge, eNewLnge, sal_True); + pFormatScanner->SetConvertMode(eLnge, eNewLnge, true); bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(sal_False); + pFormatScanner->SetConvertMode(false); return bRes; } sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, - sal_Bool & rNewInserted, xub_StrLen & rCheckPos ) + bool & rNewInserted, xub_StrLen & rCheckPos ) { sal_uInt32 nKey = NUMBERFORMAT_ENTRY_NOT_FOUND; - rNewInserted = sal_False; + rNewInserted = false; rCheckPos = 0; // #62389# empty format string (of Writer) => General standard format @@ -666,7 +666,7 @@ sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, if (rNewInserted) { DeleteEntry( nKey); // don't leave trails of rubbish - rNewInserted = sal_False; + rNewInserted = false; } nKey = GetStandardFormat( NUMBERFORMAT_CURRENCY, eLnge); } @@ -686,7 +686,7 @@ void SvNumberFormatter::PrepareSave() SvNumberformat* pFormat = aFTable.First(); while (pFormat) { - pFormat->SetUsed(sal_False); + pFormat->SetUsed(false); pFormat = aFTable.Next(); } } @@ -695,10 +695,10 @@ void SvNumberFormatter::SetFormatUsed(sal_uInt32 nFIndex) { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex); if (pFormat) - pFormat->SetUsed(sal_True); + pFormat->SetUsed(true); } -sal_Bool SvNumberFormatter::Load( SvStream& rStream ) +bool SvNumberFormatter::Load( SvStream& rStream ) { LanguageType eSysLang = SvtSysLocale().GetLanguage(); SvNumberFormatter* pConverter = NULL; @@ -715,21 +715,21 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) eSaveSysLang = (nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ? LANGUAGE_SYSTEM : (LanguageType) nSysOnStore); LanguageType eLnge = (LanguageType) eLge; - ImpChangeSysCL( eLnge, sal_True ); + ImpChangeSysCL( eLnge, true ); rStream >> nPos; while (nPos != NUMBERFORMAT_ENTRY_NOT_FOUND) { rStream >> eDummy >> eLge; eLnge = (LanguageType) eLge; - ImpGenerateCL( eLnge, sal_True ); // ggfs. neue Standardformate anlegen + ImpGenerateCL( eLnge, true ); // ggfs. neue Standardformate anlegen sal_uInt32 nOffset = nPos % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex - sal_Bool bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE); + bool bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE); //! HACK! ER 29.07.97 15:15 // SaveLang wurde bei SYSTEM nicht gespeichert sondern war auch SYSTEM, // erst ab 364i Unterscheidung moeglich - sal_Bool bConversionHack; + bool bConversionHack; if ( eLnge == LANGUAGE_SYSTEM ) { if ( nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ) @@ -739,13 +739,13 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) } else { - bConversionHack = sal_False; + bConversionHack = false; eLoadSysLang = eSysLang; } } else { - bConversionHack = sal_False; + bConversionHack = false; eLoadSysLang = eSaveSysLang; } @@ -762,7 +762,7 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) { case NF_CONVERT_GERMAN_ENGLISH : pEntry->ConvertLanguage( *pConverter, - LANGUAGE_ENGLISH_US, eSysLang, sal_True ); + LANGUAGE_ENGLISH_US, eSysLang, true ); break; case NF_CONVERT_ENGLISH_GERMAN : switch ( eSysLang ) @@ -776,7 +776,7 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) break; default: pEntry->ConvertLanguage( *pConverter, - LANGUAGE_GERMAN, eSysLang, sal_True ); + LANGUAGE_GERMAN, eSysLang, true ); } break; case NF_CONVERT_NONE : @@ -806,33 +806,33 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) case LANGUAGE_GERMAN_LIECHTENSTEIN: // alles beim alten pEntry->ConvertLanguage( *pConverter, - eSaveSysLang, eLoadSysLang, sal_True ); + eSaveSysLang, eLoadSysLang, true ); break; default: // alte english nach neuem anderen pEntry->ConvertLanguage( *pConverter, - LANGUAGE_ENGLISH_US, eLoadSysLang, sal_True ); + LANGUAGE_ENGLISH_US, eLoadSysLang, true ); } } else pEntry->ConvertLanguage( *pConverter, - eSaveSysLang, eLoadSysLang, sal_True ); + eSaveSysLang, eLoadSysLang, true ); } else { // nicht SYSTEM oder gleiches SYSTEM if ( nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS ) { LanguageType eLoadLang; - sal_Bool bSystem; + bool bSystem; if ( eLnge == LANGUAGE_SYSTEM ) { eLoadLang = eSysLang; - bSystem = sal_True; + bSystem = true; } else { eLoadLang = eLnge; - bSystem = sal_False; + bSystem = false; } switch ( eLoadLang ) { @@ -893,17 +893,17 @@ sal_Bool SvNumberFormatter::Load( SvStream& rStream ) LanguageType eLang = *it; ChangeIntl( eLang ); sal_uInt32 CLOffset = ImpGetCLOffset( eLang ); - ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_True ); + ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, true ); } ChangeIntl( eOldLanguage ); if (rStream.GetError()) - return sal_False; + return false; else - return sal_True; + return true; } -sal_Bool SvNumberFormatter::Save( SvStream& rStream ) const +bool SvNumberFormatter::Save( SvStream& rStream ) const { ImpSvNumMultipleWriteHeader aHdr( rStream ); // ab 364i wird gespeichert was SYSTEM wirklich war, vorher hart LANGUAGE_SYSTEM @@ -935,9 +935,9 @@ sal_Bool SvNumberFormatter::Save( SvStream& rStream ) const aHdr.EndEntry(); if (rStream.GetError()) - return sal_False; + return false; else - return sal_True; + return true; } void SvNumberFormatter::GetUsedLanguages( std::vector<sal_uInt16>& rList ) @@ -1085,7 +1085,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( return GetEntryTable(eTypetmp, FIndex, rLnge); } -sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, sal_Bool bLoadingSO5 ) +sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bLoadingSO5 ) { ChangeIntl(eLnge); sal_uInt32 CLOffset = ImpGetCLOffset(ActLnge); @@ -1207,7 +1207,7 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable( return *pFormatTable; } -sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString, +bool SvNumberFormatter::IsNumberFormat(const String& sString, sal_uInt32& F_Index, double& fOutNumber) { @@ -1226,12 +1226,12 @@ sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString, FType = NUMBERFORMAT_DEFINED; ChangeIntl(pFormat->GetLanguage()); } - sal_Bool res; + bool res; short RType = FType; // Ergebnistyp // ohne def-Kennung if (RType == NUMBERFORMAT_TEXT) // Zahlzelle ->Stringz. - res = sal_False; + res = false; else res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat); @@ -1261,13 +1261,13 @@ sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString, return res; } -sal_Bool SvNumberFormatter::IsCompatible(short eOldType, +bool SvNumberFormatter::IsCompatible(short eOldType, short eNewType) { if (eOldType == eNewType) - return sal_True; + return true; else if (eOldType == NUMBERFORMAT_DEFINED) - return sal_True; + return true; else { switch (eNewType) @@ -1282,9 +1282,9 @@ sal_Bool SvNumberFormatter::IsCompatible(short eOldType, case NUMBERFORMAT_FRACTION: // case NUMBERFORMAT_LOGICAL: case NUMBERFORMAT_DEFINED: - return sal_True; + return true; default: - return sal_False; + return false; } } break; @@ -1293,9 +1293,9 @@ sal_Bool SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return sal_True; + return true; default: - return sal_False; + return false; } } break; @@ -1304,9 +1304,9 @@ sal_Bool SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return sal_True; + return true; default: - return sal_False; + return false; } } break; @@ -1316,16 +1316,16 @@ sal_Bool SvNumberFormatter::IsCompatible(short eOldType, { case NUMBERFORMAT_TIME: case NUMBERFORMAT_DATE: - return sal_True; + return true; default: - return sal_False; + return false; } } break; default: - return sal_False; + return false; } - return sal_False; + return false; } } @@ -1438,7 +1438,7 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge } } -sal_Bool SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex, +bool SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge ) { return @@ -1467,14 +1467,14 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( double fNumber, sal_uInt32 nFIn { case NUMBERFORMAT_TIME : { - sal_Bool bSign; + bool bSign; if ( fNumber < 0.0 ) { - bSign = sal_True; + bSign = true; fNumber = -fNumber; } else - bSign = sal_False; + bSign = false; double fSeconds = fNumber * 86400; if ( floor( fSeconds + 0.5 ) * 100 != floor( fSeconds * 100 + 0.5 ) ) { // mit 100stel Sekunden @@ -1608,14 +1608,14 @@ void SvNumberFormatter::GetOutputString(String& sString, } } -sal_Bool SvNumberFormatter::GetPreviewString(const String& sFormatString, +bool SvNumberFormatter::GetPreviewString(const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge) { if (sFormatString.Len() == 0) // keinen Leerstring - return sal_False; + return false; xub_StrLen nCheckPos = STRING_NOTFOUND; sal_uInt32 nKey; @@ -1639,30 +1639,30 @@ sal_Bool SvNumberFormatter::GetPreviewString(const String& sFormatString, else p_Entry->GetOutputString(fPreviewNumber,sOutString, ppColor); delete p_Entry; - return sal_True; + return true; } else { delete p_Entry; - return sal_False; + return false; } } -sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, +bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge ) { if (sFormatString.Len() == 0) // keinen Leerstring - return sal_False; + return false; if (eLnge == LANGUAGE_DONTKNOW) eLnge = IniLnge; ChangeIntl( eLnge ); eLnge = ActLnge; - sal_Bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US); + bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US); String aFormatStringUpper( pCharClass->upper( sFormatString ) ); sal_uInt32 nCLOffset = ImpGenerateCL( eLnge ); @@ -1670,7 +1670,7 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) { // Zielformat vorhanden GetOutputString( fPreviewNumber, nKey, sOutString, ppColor ); - return sal_True; + return true; } SvNumberformat *pEntry = NULL; @@ -1687,7 +1687,7 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, { nCLOffset = ImpGenerateCL( LANGUAGE_ENGLISH_US ); nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, LANGUAGE_ENGLISH_US ); - sal_Bool bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); + bool bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); // try english --> other bzw. english nach other konvertieren LanguageType eFormatLang = LANGUAGE_ENGLISH_US; @@ -1695,7 +1695,7 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, sTmpString = sFormatString; pEntry = new SvNumberformat( sTmpString, pFormatScanner, pStringScanner, nCheckPos, eFormatLang ); - pFormatScanner->SetConvertMode( sal_False ); + pFormatScanner->SetConvertMode( false ); ChangeIntl( eLnge ); if ( !bEnglishFormat ) @@ -1717,7 +1717,7 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, sTmpString = sFormatString; SvNumberformat* pEntry2 = new SvNumberformat( sTmpString, pFormatScanner, pStringScanner, nCheckPos2, eFormatLang ); - pFormatScanner->SetConvertMode( sal_False ); + pFormatScanner->SetConvertMode( false ); ChangeIntl( eLnge ); if ( nCheckPos2 == 0 && !xTransliteration->isEqual( sFormatString, pEntry2->GetFormatstring() ) ) @@ -1737,20 +1737,20 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, ImpGenerateCL( eLnge ); // ggfs. neu Standardformate anlegen pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor ); delete pEntry; - return sal_True; + return true; } delete pEntry; - return sal_False; + return false; } -sal_Bool SvNumberFormatter::GetPreviewString( const String& sFormatString, +bool SvNumberFormatter::GetPreviewString( const String& sFormatString, const String& sPreviewString, String& sOutString, Color** ppColor, LanguageType eLnge ) { if (sFormatString.Len() == 0) // no empty string - return sal_False; + return false; xub_StrLen nCheckPos = STRING_NOTFOUND; sal_uInt32 nKey; @@ -1786,12 +1786,12 @@ sal_Bool SvNumberFormatter::GetPreviewString( const String& sFormatString, } } delete p_Entry; - return sal_True; + return true; } else { delete p_Entry; - return sal_False; + return false; } } @@ -1828,7 +1828,7 @@ sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, - sal_uInt32 nPos, sal_Bool bAfterLoadingSO5, sal_Int16 nOrgIndex ) + sal_uInt32 nPos, bool bAfterLoadingSO5, sal_Int16 nOrgIndex ) { String aCodeStr( rCode.Code ); if ( rCode.Index < NF_INDEX_TABLE_ENTRIES && @@ -1836,7 +1836,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( rCode.Index != NF_CURRENCY_1000DEC2_CCC ) { // strip surrounding [$...] on automatic currency if ( aCodeStr.SearchAscii( "[$" ) != STRING_NOTFOUND ) - aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, sal_False ); + aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, false ); else { if (LocaleDataWrapper::areChecksEnabled() && @@ -1949,7 +1949,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, - sal_uInt32 nPos, sal_uInt16 nVersion, sal_Bool bAfterLoadingSO5, + sal_uInt32 nPos, sal_uInt16 nVersion, bool bAfterLoadingSO5, sal_Int16 nOrgIndex ) { SvNumberformat* pNewFormat = ImpInsertFormat( rCode, nPos, @@ -1961,8 +1961,8 @@ SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat( } void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat, - sal_Bool& bThousand, - sal_Bool& IsRed, + bool& bThousand, + bool& IsRed, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading) @@ -1973,8 +1973,8 @@ void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat, nPrecision, nAnzLeading); else { - bThousand = sal_False; - IsRed = sal_False; + bThousand = false; + IsRed = false; nPrecision = pFormatScanner->GetStandardPrec(); nAnzLeading = 0; } @@ -2013,7 +2013,7 @@ String SvNumberFormatter::GetFormatDecimalSep( sal_uInt32 nFormat ) const sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString, - sal_Bool& bThousand, sal_Bool& IsRed, sal_uInt16& nPrecision, + bool& bThousand, bool& IsRed, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading, LanguageType eLnge ) { @@ -2029,8 +2029,8 @@ sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString, pFormat->GetFormatSpecialInfo( bThousand, IsRed, nPrecision, nAnzLeading ); else { - bThousand = sal_False; - IsRed = sal_False; + bThousand = false; + IsRed = false; nPrecision = pFormatScanner->GetStandardPrec(); nAnzLeading = 0; } @@ -2114,7 +2114,7 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex( sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( ::com::sun::star::i18n::NumberFormatCode * pFormatArr, - sal_Int32 nCnt, sal_Bool bCheckCorrectness ) + sal_Int32 nCnt, bool bCheckCorrectness ) { using namespace ::com::sun::star; @@ -2207,18 +2207,18 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( default: if ( nDef == -1 ) nDef = nElem; - pFormatArr[nElem].Default = sal_False; + pFormatArr[nElem].Default = false; } } } if ( nDef == -1 ) nDef = 0; - pFormatArr[nDef].Default = sal_True; + pFormatArr[nDef].Default = true; return nDef; } -void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadingSO5 ) +void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bLoadingSO5 ) { using namespace ::com::sun::star; @@ -2229,9 +2229,9 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi theIndexTable[j] = NUMBERFORMAT_ENTRY_NOT_FOUND; } } - sal_Bool bOldConvertMode = pFormatScanner->GetConvertMode(); + bool bOldConvertMode = pFormatScanner->GetConvertMode(); if (bOldConvertMode) - pFormatScanner->SetConvertMode(sal_False); // switch off for this function + pFormatScanner->SetConvertMode(false); // switch off for this function NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); @@ -2239,7 +2239,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi SvNumberformat* pNewFormat = NULL; String aFormatCode; sal_Int32 nIdx; - sal_Bool bDefault; + bool bDefault; // Counter for additional builtin formats not fitting into the first 10 // of a category (TLOT:=The Legacy Of Templin), altogether about 20 formats. @@ -2361,7 +2361,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // #,##0 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000INT ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000INT, ZF_STANDARD_CURRENCY )); aFormatSeq[nIdx].Default = bDefault; @@ -2369,7 +2369,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // #,##0.00 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000DEC2 ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2, ZF_STANDARD_CURRENCY+1 )); aFormatSeq[nIdx].Default = bDefault; @@ -2377,7 +2377,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // #,##0 negative red nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000INT_RED ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000INT_RED, ZF_STANDARD_CURRENCY+2 )); aFormatSeq[nIdx].Default = bDefault; @@ -2385,7 +2385,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // #,##0.00 negative red nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000DEC2_RED ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_RED, ZF_STANDARD_CURRENCY+3 )); aFormatSeq[nIdx].Default = bDefault; @@ -2393,17 +2393,17 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // #,##0.00 USD since number formatter version 3 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000DEC2_CCC ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; pNewFormat = ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_CCC, ZF_STANDARD_CURRENCY+4 )); if ( pNewFormat ) - pNewFormat->SetUsed(sal_True); // must be saved for older versions + pNewFormat->SetUsed(true); // must be saved for older versions aFormatSeq[nIdx].Default = bDefault; // #.##0,-- since number formatter version 6 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_CURRENCY_1000DEC2_DASHED ); bDefault = aFormatSeq[nIdx].Default; - aFormatSeq[nIdx].Default = sal_False; + aFormatSeq[nIdx].Default = false; ImpInsertNewStandardFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_DASHED, ZF_STANDARD_CURRENCY+5 ), SV_NUMBERFORMATTER_VERSION_NEWSTANDARD ); @@ -2450,7 +2450,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi pNewFormat = ImpInsertFormat( aFormatSeq[nIdx], CLOffset + SetIndexTable( NF_DATE_SYS_DDMMYYYY, ZF_STANDARD_DATE+6 )); if ( pNewFormat ) - pNewFormat->SetUsed(sal_True); // must be saved for older versions + pNewFormat->SetUsed(true); // must be saved for older versions // DD.MM.YY def/System, since number formatter version 6 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_DATE_SYS_DDMMYY ); @@ -2640,14 +2640,14 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi - bIndexTableInitialized = sal_True; + bIndexTableInitialized = true; DBG_ASSERT( nNewExtended <= ZF_STANDARD_NEWEXTENDEDMAX, "ImpGenerateFormats: overflow of nNewExtended standard formats" ); // Now all additional format codes provided by I18N, but only if not // loading from old SO5 file format, then they are appended last. if ( !bLoadingSO5 ) - ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_False ); + ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, false ); sal_uInt32 nPos = CLOffset + pStdFormat->GetLastInsertKey(); @@ -2662,12 +2662,12 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi pStdFormat->SetLastInsertKey( (sal_uInt16)(nPos - CLOffset) ); if (bOldConvertMode) - pFormatScanner->SetConvertMode(sal_True); + pFormatScanner->SetConvertMode(true); } void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, - NumberFormatCodeWrapper& rNumberFormatCode, sal_Bool bAfterLoadingSO5 ) + NumberFormatCodeWrapper& rNumberFormatCode, bool bAfterLoadingSO5 ) { using namespace ::com::sun::star; @@ -2704,8 +2704,8 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, pFormatArr[j].Index = sal::static_int_cast< sal_Int16 >( pFormatArr[j].Index + nCodes + NF_INDEX_TABLE_ENTRIES); //! no default on currency - sal_Bool bDefault = aFormatSeq[j].Default; - aFormatSeq[j].Default = sal_False; + bool bDefault = aFormatSeq[j].Default; + aFormatSeq[j].Default = false; if ( ImpInsertNewStandardFormat( pFormatArr[j], nPos+1, SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS, bAfterLoadingSO5, nOrgIndex ) ) @@ -2722,9 +2722,9 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, { pFormatArr = aFormatSeq.getArray(); // don't check ALL - sal_Int32 nDef = ImpAdjustFormatCodeDefault( pFormatArr, nCodes, sal_False); + sal_Int32 nDef = ImpAdjustFormatCodeDefault( pFormatArr, nCodes, false); // don't have any defaults here - pFormatArr[nDef].Default = sal_False; + pFormatArr[nDef].Default = false; for ( j = 0; j < nCodes; j++ ) { if ( nPos - CLOffset >= SV_COUNTRY_LANGUAGE_OFFSET ) @@ -2759,8 +2759,8 @@ void SvNumberFormatter::ImpGetNegCurrFormat( String& sNegStr, const String& rCur void SvNumberFormatter::GenerateFormat(String& sString, sal_uInt32 nIndex, LanguageType eLnge, - sal_Bool bThousand, - sal_Bool IsRed, + bool bThousand, + bool IsRed, sal_uInt16 nPrecision, sal_uInt16 nAnzLeading) { @@ -2822,7 +2822,7 @@ void SvNumberFormatter::GenerateFormat(String& sString, String sNegStr = sString; String aCurr; const NfCurrencyEntry* pEntry; - sal_Bool bBank; + bool bBank; if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) ) { if ( pEntry ) @@ -2842,10 +2842,10 @@ void SvNumberFormatter::GenerateFormat(String& sString, { // assume currency abbreviation (AKA banking symbol), not symbol sal_uInt16 nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat( xLocaleData->getCurrPositiveFormat(), - xLocaleData->getCurrPositiveFormat(), sal_True ); + xLocaleData->getCurrPositiveFormat(), true ); sal_uInt16 nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat( xLocaleData->getCurrNegativeFormat(), - xLocaleData->getCurrNegativeFormat(), sal_True ); + xLocaleData->getCurrNegativeFormat(), true ); NfCurrencyEntry::CompletePositiveFormatString( sString, aCurr, nPosiForm ); NfCurrencyEntry::CompleteNegativeFormatString( sNegStr, aCurr, @@ -2909,7 +2909,7 @@ void SvNumberFormatter::GenerateFormat(String& sString, } } -sal_Bool SvNumberFormatter::IsUserDefined(const String& sStr, +bool SvNumberFormatter::IsUserDefined(const String& sStr, LanguageType eLnge) { if (eLnge == LANGUAGE_DONTKNOW) @@ -2919,11 +2919,11 @@ sal_Bool SvNumberFormatter::IsUserDefined(const String& sStr, eLnge = ActLnge; sal_uInt32 nKey = ImpIsEntry(sStr, CLOffset, eLnge); if (nKey == NUMBERFORMAT_ENTRY_NOT_FOUND) - return sal_True; + return true; SvNumberformat* pEntry = aFTable.Get(nKey); if ( pEntry && ((pEntry->GetType() & NUMBERFORMAT_DEFINED) != 0) ) - return sal_True; - return sal_False; + return true; + return false; } sal_uInt32 SvNumberFormatter::GetEntryKey(const String& sStr, @@ -3273,7 +3273,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultSystemCurrencyFormat() short nType; NfWSStringsDtor aCurrList; sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList, - GetCurrencyEntry( LANGUAGE_SYSTEM ), sal_False ); + GetCurrencyEntry( LANGUAGE_SYSTEM ), false ); DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency System standard format?!?" ); // if already loaded or user defined nDefaultSystemCurrencyFormat // will be set to the right value @@ -3318,7 +3318,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() short nType; NfWSStringsDtor aCurrList; sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList, - GetCurrencyEntry( ActLnge ), sal_False ); + GetCurrencyEntry( ActLnge ), false ); DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency standard format?" ); if ( aCurrList.Count() ) { @@ -3350,39 +3350,39 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() // static // try to make it inline if possible since this a loop body -// sal_True: continue; sal_False: break loop, if pFoundEntry==NULL dupe found +// true: continue; false: break loop, if pFoundEntry==NULL dupe found #ifndef DBG_UTIL inline #endif - sal_Bool SvNumberFormatter::ImpLookupCurrencyEntryLoopBody( - const NfCurrencyEntry*& pFoundEntry, sal_Bool& bFoundBank, + bool SvNumberFormatter::ImpLookupCurrencyEntryLoopBody( + const NfCurrencyEntry*& pFoundEntry, bool& bFoundBank, const NfCurrencyEntry* pData, sal_uInt16 nPos, const String& rSymbol ) { - sal_Bool bFound; + bool bFound; if ( pData->GetSymbol() == rSymbol ) { - bFound = sal_True; - bFoundBank = sal_False; + bFound = true; + bFoundBank = false; } else if ( pData->GetBankSymbol() == rSymbol ) { - bFound = sal_True; - bFoundBank = sal_True; + bFound = true; + bFoundBank = true; } else - bFound = sal_False; + bFound = false; if ( bFound ) { if ( pFoundEntry && pFoundEntry != pData ) { pFoundEntry = NULL; - return sal_False; // break loop, not unique + return false; // break loop, not unique } if ( nPos == 0 ) { // first entry is SYSTEM pFoundEntry = MatchSystemCurrency(); if ( pFoundEntry ) - return sal_False; // break loop + return false; // break loop // even if there are more matching entries // this one is propably the one we are looking for else @@ -3391,19 +3391,19 @@ inline else pFoundEntry = pData; } - return sal_True; + return true; } -sal_Bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, +bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rStr, const NfCurrencyEntry** ppEntry /* = NULL */, - sal_Bool* pBank /* = NULL */ ) const + bool* pBank /* = NULL */ ) const { rStr.Erase(); if ( ppEntry ) *ppEntry = NULL; if ( pBank ) - *pBank = sal_False; + *pBank = false; SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get( nFormat ); if ( pFormat ) { @@ -3412,11 +3412,11 @@ sal_Bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, { if ( ppEntry ) { - sal_Bool bFoundBank = sal_False; + bool bFoundBank = false; // we definiteley need an entry matching the format code string const NfCurrencyEntry* pFoundEntry = GetCurrencyEntry( bFoundBank, aSymbol, aExtension, pFormat->GetLanguage(), - sal_True ); + true ); if ( pFoundEntry ) { *ppEntry = pFoundEntry; @@ -3442,17 +3442,17 @@ sal_Bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, rStr += aExtension; rStr += ']'; } - return sal_True; + return true; } } - return sal_False; + return false; } // static -const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( sal_Bool & bFoundBank, +const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( bool & bFoundBank, const String& rSymbol, const String& rExtension, - LanguageType eFormatLanguage, sal_Bool bOnlyStringLanguage ) + LanguageType eFormatLanguage, bool bOnlyStringLanguage ) { xub_StrLen nExtLen = rExtension.Len(); LanguageType eExtLang; @@ -3470,7 +3470,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( sal_Bool & bFoundBan const NfCurrencyEntry* pFoundEntry = NULL; const NfCurrencyTable& rTable = GetTheCurrencyTable(); sal_uInt16 nCount = rTable.Count(); - sal_Bool bCont = sal_True; + bool bCont = true; // first try with given extension language/country if ( nExtLen ) @@ -3612,10 +3612,10 @@ void SvNumberFormatter::ImpInitCurrencyTable() // ::osl::MutexGuard aGuard( GetMutex() ); // while ( !bCurrencyTableInitialized ) // ImpInitCurrencyTable(); - static sal_Bool bInitializing = sal_False; + static bool bInitializing = false; if ( bCurrencyTableInitialized || bInitializing ) return ; - bInitializing = sal_True; + bInitializing = true; RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svl", "er93726", "SvNumberFormatter::ImpInitCurrencyTable" ); @@ -3673,7 +3673,7 @@ void SvNumberFormatter::ImpInitCurrencyTable() rCurrencyTable.Insert( pEntry, nCurrencyPos++ ); if ( !nSystemCurrencyPosition && (aConfiguredCurrencyAbbrev.Len() ? pEntry->GetBankSymbol() == aConfiguredCurrencyAbbrev && - pEntry->GetLanguage() == eConfiguredCurrencyLanguage : sal_False) ) + pEntry->GetLanguage() == eConfiguredCurrencyLanguage : false) ) nSystemCurrencyPosition = nCurrencyPos-1; if ( !nMatchingSystemCurrencyPosition && pEntry->GetLanguage() == eSysLang ) @@ -3694,7 +3694,7 @@ void SvNumberFormatter::ImpInitCurrencyTable() { pEntry = new NfCurrencyEntry( pCurrencies[nCurrency], *pLocaleData, eLang ); // no dupes - sal_Bool bInsert = sal_True; + bool bInsert = true; NfCurrencyEntry const * const * pData = rCurrencyTable.GetData(); sal_uInt16 n = rCurrencyTable.Count(); pData++; // skip first SYSTEM entry @@ -3702,7 +3702,7 @@ void SvNumberFormatter::ImpInitCurrencyTable() { if ( *(*pData++) == *pEntry ) { - bInsert = sal_False; + bInsert = false; break; // for } } @@ -3740,20 +3740,20 @@ void SvNumberFormatter::ImpInitCurrencyTable() delete pLocaleData; SvtSysLocaleOptions::SetCurrencyChangeLink( STATIC_LINK( NULL, SvNumberFormatter, CurrencyChangeLink ) ); - bInitializing = sal_False; - bCurrencyTableInitialized = sal_True; + bInitializing = false; + bCurrencyTableInitialized = true; } sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr, - const NfCurrencyEntry& rCurr, sal_Bool bBank ) const + const NfCurrencyEntry& rCurr, bool bBank ) const { sal_uInt16 nDefault = 0; if ( bBank ) { // nur Bankensymbole String aPositiveBank, aNegativeBank; - rCurr.BuildPositiveFormatString( aPositiveBank, sal_True, *xLocaleData, 1 ); - rCurr.BuildNegativeFormatString( aNegativeBank, sal_True, *xLocaleData, 1 ); + rCurr.BuildPositiveFormatString( aPositiveBank, true, *xLocaleData, 1 ); + rCurr.BuildNegativeFormatString( aNegativeBank, true, *xLocaleData, 1 ); WSStringPtr pFormat1 = new String( aPositiveBank ); *pFormat1 += ';'; @@ -3783,14 +3783,14 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr aRed += pFormatScanner->GetRedString(); aRed += ']'; - rCurr.BuildPositiveFormatString( aPositive, sal_False, *xLocaleData, 1 ); - rCurr.BuildNegativeFormatString( aNegative, sal_False, *xLocaleData, 1 ); + rCurr.BuildPositiveFormatString( aPositive, false, *xLocaleData, 1 ); + rCurr.BuildNegativeFormatString( aNegative, false, *xLocaleData, 1 ); if ( rCurr.GetDigits() ) { - rCurr.BuildPositiveFormatString( aPositiveNoDec, sal_False, *xLocaleData, 0 ); - rCurr.BuildNegativeFormatString( aNegativeNoDec, sal_False, *xLocaleData, 0 ); - rCurr.BuildPositiveFormatString( aPositiveDashed, sal_False, *xLocaleData, 2 ); - rCurr.BuildNegativeFormatString( aNegativeDashed, sal_False, *xLocaleData, 2 ); + rCurr.BuildPositiveFormatString( aPositiveNoDec, false, *xLocaleData, 0 ); + rCurr.BuildNegativeFormatString( aNegativeNoDec, false, *xLocaleData, 0 ); + rCurr.BuildPositiveFormatString( aPositiveDashed, false, *xLocaleData, 2 ); + rCurr.BuildNegativeFormatString( aNegativeDashed, false, *xLocaleData, 2 ); pFormat1 = new String( aPositiveNoDec ); *pFormat1 += ';'; @@ -3873,7 +3873,7 @@ NfCurrencyEntry::NfCurrencyEntry( const ::com::sun::star::i18n::Currency & rCurr } -sal_Bool NfCurrencyEntry::operator==( const NfCurrencyEntry& r ) const +bool NfCurrencyEntry::operator==( const NfCurrencyEntry& r ) const { return aSymbol == r.aSymbol && aBankSymbol == r.aBankSymbol @@ -3894,10 +3894,10 @@ void NfCurrencyEntry::SetEuro() } -sal_Bool NfCurrencyEntry::IsEuro() const +bool NfCurrencyEntry::IsEuro() const { if ( aBankSymbol.EqualsAscii( "EUR" ) ) - return sal_True; + return true; String aEuro( NfCurrencyEntry::GetEuroSymbol() ); return aSymbol == aEuro; } @@ -3911,8 +3911,8 @@ void NfCurrencyEntry::ApplyVariableInformation( const NfCurrencyEntry& r ) } -void NfCurrencyEntry::BuildSymbolString( String& rStr, sal_Bool bBank, - sal_Bool bWithoutExtension ) const +void NfCurrencyEntry::BuildSymbolString( String& rStr, bool bBank, + bool bWithoutExtension ) const { rStr = '['; rStr += '$'; @@ -3951,7 +3951,7 @@ void NfCurrencyEntry::Impl_BuildFormatStringNumChars( String& rStr, } -void NfCurrencyEntry::BuildPositiveFormatString( String& rStr, sal_Bool bBank, +void NfCurrencyEntry::BuildPositiveFormatString( String& rStr, bool bBank, const LocaleDataWrapper& rLoc, sal_uInt16 nDecimalFormat ) const { Impl_BuildFormatStringNumChars( rStr, rLoc, nDecimalFormat ); @@ -3961,7 +3961,7 @@ void NfCurrencyEntry::BuildPositiveFormatString( String& rStr, sal_Bool bBank, } -void NfCurrencyEntry::BuildNegativeFormatString( String& rStr, sal_Bool bBank, +void NfCurrencyEntry::BuildNegativeFormatString( String& rStr, bool bBank, const LocaleDataWrapper& rLoc, sal_uInt16 nDecimalFormat ) const { Impl_BuildFormatStringNumChars( rStr, rLoc, nDecimalFormat ); @@ -3971,7 +3971,7 @@ void NfCurrencyEntry::BuildNegativeFormatString( String& rStr, sal_Bool bBank, } -void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, sal_Bool bBank, +void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, bool bBank, sal_uInt16 nPosiForm ) const { String aSymStr; @@ -3980,7 +3980,7 @@ void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, sal_Bool bBank } -void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, sal_Bool bBank, +void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, bool bBank, sal_uInt16 nNegaForm ) const { String aSymStr; @@ -4147,7 +4147,7 @@ sal_uInt16 NfCurrencyEntry::GetEffectivePositiveFormat( sal_uInt16 #if ! NF_BANKSYMBOL_FIX_POSITION nIntlFormat #endif - , sal_uInt16 nCurrFormat, sal_Bool bBank ) + , sal_uInt16 nCurrFormat, bool bBank ) { if ( bBank ) { @@ -4265,7 +4265,7 @@ sal_uInt16 lcl_MergeNegativeParenthesisFormat( sal_uInt16 nIntlFormat, sal_uInt1 // static sal_uInt16 NfCurrencyEntry::GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat, - sal_uInt16 nCurrFormat, sal_Bool bBank ) + sal_uInt16 nCurrFormat, bool bBank ) { if ( bBank ) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 84ab55b7d49f..132051ab37b3 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -174,7 +174,7 @@ void ImpSvNumberformatInfo::Save(SvStream& rStream, sal_uInt16 nAnz) const } } - rStream << eScannedType << bThousand << nThousand + rStream << eScannedType << sal_Bool(bThousand) << nThousand << nCntPre << nCntPost << nCntExp; } @@ -185,14 +185,16 @@ void ImpSvNumberformatInfo::Load(SvStream& rStream, sal_uInt16 nAnz) SvNumberformat::LoadString( rStream, sStrArray[i] ); rStream >> nTypeArray[i]; } - rStream >> eScannedType >> bThousand >> nThousand + sal_Bool bStreamThousand; + rStream >> eScannedType >> bStreamThousand >> nThousand >> nCntPre >> nCntPost >> nCntExp; + bThousand = bStreamThousand; } //============================================================================ // static -sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate ) +sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, bool bDate ) { sal_uInt8 nNatNum = 0; eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc. @@ -245,7 +247,7 @@ sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang } // static -sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate ) +sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, bool bDate ) { sal_uInt8 nDBNum = 0; eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc. @@ -331,7 +333,7 @@ ImpSvNumFor::ImpSvNumFor() aI.nTypeArray = NULL; aI.sStrArray = NULL; aI.eScannedType = NUMBERFORMAT_UNDEFINED; - aI.bThousand = sal_False; + aI.bThousand = false; aI.nThousand = 0; aI.nCntPre = 0; aI.nCntPost = 0; @@ -400,17 +402,17 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc, pColor = rSc.GetColor(sColorName); } -sal_Bool ImpSvNumFor::HasNewCurrency() const +bool ImpSvNumFor::HasNewCurrency() const { for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) { if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY ) - return sal_True; + return true; } - return sal_False; + return false; } -sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, +bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) @@ -422,11 +424,11 @@ sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, rExtension = aI.sStrArray[j+1]; else rExtension.Erase(); - return sal_True; + return true; } } //! kein Erase an rSymbol, rExtension - return sal_False; + return false; } void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const @@ -515,7 +517,7 @@ SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ) : rScan(rSc), nNewStandardDefined(0), - bStarFlag( sal_False ) + bStarFlag( false ) { maLocale.meLanguage = eLge; } @@ -553,10 +555,10 @@ SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& ImpCopyNumberformat( rFormat ); } -sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) +bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) { if ( nSymbolType > 0 ) - return sal_True; // conditions + return true; // conditions switch ( nSymbolType ) { case BRACKET_SYMBOLTYPE_COLOR : @@ -590,9 +592,9 @@ sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) case BRACKET_SYMBOLTYPE_NATNUM17 : case BRACKET_SYMBOLTYPE_NATNUM18 : case BRACKET_SYMBOLTYPE_NATNUM19 : - return sal_True; + return true; } - return sal_False; + return false; } @@ -640,11 +642,11 @@ SvNumberformat::SvNumberformat(String& rString, ImpSvNumberInputScan* pISc, xub_StrLen& nCheckPos, LanguageType& eLan, - sal_Bool bStan) + bool bStan) : rScan(*pSc), nNewStandardDefined(0), - bStarFlag( sal_False ) + bStarFlag( false ) { // If the group (AKA thousand) separator is a Non-Breaking Space (French) // replace all occurrences by a simple space. @@ -667,15 +669,15 @@ SvNumberformat::SvNumberformat(String& rString, else maLocale.meLanguage = eLan; bStandard = bStan; - bIsUsed = sal_False; + bIsUsed = false; fLimit1 = 0.0; fLimit2 = 0.0; eOp1 = NUMBERFORMAT_OP_NO; eOp2 = NUMBERFORMAT_OP_NO; eType = NUMBERFORMAT_DEFINED; - sal_Bool bCancel = sal_False; - sal_Bool bCondition = sal_False; + bool bCancel = false; + bool bCondition = false; short eSymbolType; xub_StrLen nPos = 0; xub_StrLen nPosOld; @@ -701,14 +703,14 @@ SvNumberformat::SvNumberformat(String& rString, { if ( nIndex == 0 && !bCondition ) { - bCondition = sal_True; + bCondition = true; eOp1 = (SvNumberformatLimitOps) eSymbolType; } else if ( nIndex == 1 && bCondition ) eOp2 = (SvNumberformatLimitOps) eSymbolType; else // error { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } if (!bCancel) @@ -742,7 +744,7 @@ SvNumberformat::SvNumberformat(String& rString, nPos++; else { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPos; } } @@ -757,7 +759,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetColor() != NULL ) { // error, more than one color - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } else @@ -766,7 +768,7 @@ SvNumberformat::SvNumberformat(String& rString, NumFor[nIndex].SetColor( pColor, sStr); if (pColor == NULL) { // error - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } } @@ -795,7 +797,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().IsSet() ) { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } else @@ -804,7 +806,7 @@ SvNumberformat::SvNumberformat(String& rString, //! eSymbolType is negative sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0)); sStr += String::CreateFromInt32( nNum ); - NumFor[nIndex].SetNatNumNum( nNum, sal_False ); + NumFor[nIndex].SetNatNumNum( nNum, false ); } } break; @@ -820,7 +822,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().IsSet() ) { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } else @@ -829,7 +831,7 @@ SvNumberformat::SvNumberformat(String& rString, //! eSymbolType is negative sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1)); sStr += static_cast< sal_Unicode >('0' + nNum); - NumFor[nIndex].SetNatNumNum( nNum, sal_True ); + NumFor[nIndex].SetNatNumNum( nNum, true ); } } break; @@ -841,7 +843,7 @@ SvNumberformat::SvNumberformat(String& rString, // locale data for the preview string for not // yet completed LCIDs in the dialog. { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } else @@ -850,7 +852,7 @@ SvNumberformat::SvNumberformat(String& rString, LocaleType aTmpLocale( ImpGetLocaleType( sStr, nTmp)); if (aTmpLocale.meLanguage == LANGUAGE_DONTKNOW) { - bCancel = sal_True; // break for + bCancel = true; // break for nCheckPos = nPosOld; } else @@ -951,7 +953,7 @@ SvNumberformat::SvNumberformat(String& rString, aNat += String::CreateFromInt32( pSc->GetNatNumModifier()); aNat += ']'; sStr.Insert( aNat, 0); - NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), sal_False ); + NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), false ); } // #i53826# #i42727# For the Thai T speciality we need // to freeze the locale and immunize it against @@ -1004,19 +1006,19 @@ SvNumberformat::SvNumberformat(String& rString, else { nCheckPos = nPosOld + nStrPos; // error in string - bCancel = sal_True; // break for + bCancel = true; // break for } } } else if (eSymbolType == BRACKET_SYMBOLTYPE_ERROR) // error { nCheckPos = nPosOld; - bCancel = sal_True; + bCancel = true; } else if ( lcl_SvNumberformat_IsBracketedPrefix( eSymbolType ) ) { nCheckPos = nPosOld+1; // error, prefix in string - bCancel = sal_True; // break for + bCancel = true; // break for } } if ( bCancel && !nCheckPos ) @@ -1035,7 +1037,7 @@ SvNumberformat::SvNumberformat(String& rString, // hides any text. Need the type here for HasTextFormat() NumFor[3].Info().eScannedType = NUMBERFORMAT_TEXT; } - bCancel = sal_True; + bCancel = true; } if ( NumFor[nIndex].GetNatNum().IsSet() ) NumFor[nIndex].SetNatNumDate( @@ -1580,10 +1582,13 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, rHdr.StartEntry(); sal_uInt16 nOp1, nOp2; SvNumberformat::LoadString( rStream, sFormatstring ); + sal_Bool bStreamStandard, bStreamUsed; rStream >> eType >> fLimit1 >> fLimit2 - >> nOp1 >> nOp2 >> bStandard >> bIsUsed; + >> nOp1 >> nOp2 >> bStreamStandard >> bStreamUsed; + bStandard = bStreamStandard; + bIsUsed = bStreamUsed; NfHackConversion eHackConversion = NF_CONVERT_NONE; - sal_Bool bOldConvert = sal_False; + bool bOldConvert = false; LanguageType eOldTmpLang = 0; LanguageType eOldNewLang = 0; if ( pHackConverter ) @@ -1639,12 +1644,12 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, } xub_StrLen nNewCurrencyEnd = STRING_NOTFOUND; - sal_Bool bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic && + bool bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic && (nNewCurrencyEnd = aComment.Search( cNewCurrencyMagic, 1 )) != STRING_NOTFOUND ); - sal_Bool bNewCurrencyLoaded = sal_False; - sal_Bool bNewCurrency = sal_False; + bool bNewCurrencyLoaded = false; + bool bNewCurrency = false; - sal_Bool bGoOn = sal_True; + bool bGoOn = true; while ( rHdr.BytesLeft() && bGoOn ) { // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR sal_uInt16 nId; @@ -1653,8 +1658,10 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, { case nNewCurrencyVersionId : { - bNewCurrencyLoaded = sal_True; - rStream >> bNewCurrency; + bNewCurrencyLoaded = true; + sal_Bool bStreamCurr; + rStream >> bStreamCurr; + bNewCurrency = bStreamCurr; if ( bNewCurrency ) { for ( sal_uInt16 j=0; j<4; j++ ) @@ -1665,11 +1672,14 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, } break; case nNewStandardFlagVersionId : - rStream >> bStandard; // the real standard flag + { + rStream >> bStreamStandard; // the real standard flag + bStandard = bStreamStandard; + } break; default: DBG_ERRORFILE( "SvNumberformat::Load: unknown header bytes left nId" ); - bGoOn = sal_False; // stop reading unknown stream left over of newer versions + bGoOn = false; // stop reading unknown stream left over of newer versions // Would be nice to have multiple read/write headers instead // but old versions wouldn't know it, TLOT. } @@ -1713,11 +1723,11 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, { case NF_CONVERT_ENGLISH_GERMAN : ConvertLanguage( *pHackConverter, - LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, sal_True ); + LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, true ); break; case NF_CONVERT_GERMAN_ENGLISH : ConvertLanguage( *pHackConverter, - LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, sal_True ); + LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, true ); break; default: DBG_ERRORFILE( "SvNumberformat::Load: eHackConversion unknown" ); @@ -1727,7 +1737,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, } void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, - LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem ) + LanguageType eConvertFrom, LanguageType eConvertTo, bool bSystem ) { xub_StrLen nCheckPos; sal_uInt32 nKey; @@ -1798,7 +1808,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr SetComment( "", aFormatstring, aComment ); #endif - sal_Bool bNewCurrency = HasNewCurrency(); + bool bNewCurrency = HasNewCurrency(); if ( bNewCurrency ) { // SV_NUMBERFORMATTER_VERSION_NEW_CURR im Kommentar speichern aComment.Insert( cNewCurrencyMagic, 0 ); @@ -1809,7 +1819,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr // old SO5 versions do behave strange (no output) if standard flag is set // on formats not prepared for it (not having the following exact types) - sal_Bool bOldStandard = bStandard; + bool bOldStandard = bStandard; if ( bOldStandard ) { switch ( eType ) @@ -1823,14 +1833,14 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr // ok to save break; default: - bOldStandard = sal_False; + bOldStandard = false; } } rHdr.StartEntry(); rStream.WriteByteString( aFormatstring, rStream.GetStreamCharSet() ); rStream << eType << fLimit1 << fLimit2 << (sal_uInt16) eOp1 << (sal_uInt16) eOp2 - << bOldStandard << bIsUsed; + << sal_Bool(bOldStandard) << sal_Bool(bIsUsed); for (sal_uInt16 i = 0; i < 4; i++) NumFor[i].Save(rStream); // ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD @@ -1838,7 +1848,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr rStream << nNewStandardDefined; // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR rStream << nNewCurrencyVersionId; - rStream << bNewCurrency; + rStream << sal_Bool(bNewCurrency); if ( bNewCurrency ) { for ( sal_uInt16 j=0; j<4; j++ ) @@ -1851,38 +1861,38 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr if ( bStandard != bOldStandard ) { rStream << nNewStandardFlagVersionId; - rStream << bStandard; + rStream << (sal_Bool)bStandard; } rHdr.EndEntry(); } -sal_Bool SvNumberformat::HasNewCurrency() const +bool SvNumberformat::HasNewCurrency() const { for ( sal_uInt16 j=0; j<4; j++ ) { if ( NumFor[j].HasNewCurrency() ) - return sal_True; + return true; } - return sal_False; + return false; } -sal_Bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol, +bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { for ( sal_uInt16 j=0; j<4; j++ ) { if ( NumFor[j].GetNewCurrencySymbol( rSymbol, rExtension ) ) - return sal_True; + return true; } rSymbol.Erase(); rExtension.Erase(); - return sal_False; + return false; } // static String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, - sal_Bool bQuoteSymbol ) + bool bQuoteSymbol ) { String aTmp; xub_StrLen nStartPos, nPos, nLen; @@ -1931,7 +1941,7 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, void SvNumberformat::Build50Formatstring( String& rStr ) const { - rStr = StripNewCurrencyDelimiters( sFormatstring, sal_True ); + rStr = StripNewCurrencyDelimiters( sFormatstring, true ); } void SvNumberformat::ImpGetOutputStandard(double& fNumber, String& OutString) @@ -1960,22 +1970,22 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr ::rtl::OUString aTest; // expect 0.00123 OK aTest = ::rtl::math::doubleToUString( 0.001234567, - rtl_math_StringFormat_G, 3, '.', sal_True ); + rtl_math_StringFormat_G, 3, '.', true ); // expect 123 OK aTest = ::rtl::math::doubleToUString( 123.4567, - rtl_math_StringFormat_G, 3, '.', sal_True ); + rtl_math_StringFormat_G, 3, '.', true ); // expect 123.5 OK aTest = ::rtl::math::doubleToUString( 123.4567, - rtl_math_StringFormat_G, 4, '.', sal_True ); + rtl_math_StringFormat_G, 4, '.', true ); // expect 1e+03 (as 999.6 rounded to 3 significant digits results in // 1000 with an exponent equal to significant digits) // Currently (24-Jan-2003) we do fail in this case and output 1000 // instead, negligible. aTest = ::rtl::math::doubleToUString( 999.6, - rtl_math_StringFormat_G, 3, '.', sal_True ); + rtl_math_StringFormat_G, 3, '.', true ); // expect what? result is 1.2e+004 aTest = ::rtl::math::doubleToUString( 12345.6789, - rtl_math_StringFormat_G, -3, '.', sal_True ); + rtl_math_StringFormat_G, -3, '.', true ); } #endif @@ -1996,7 +2006,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) { - sal_Bool bModified = sal_False; + bool bModified = false; if ( (eType & NUMBERFORMAT_PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100)) { if (fNumber == 0.0) @@ -2005,7 +2015,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) return; } fNumber *= 100; - bModified = sal_True; + bModified = true; } if (fNumber == 0.0) @@ -2016,7 +2026,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) OutString = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - GetFormatter().GetNumDecimalSep().GetChar(0), sal_True ); + GetFormatter().GetNumDecimalSep().GetChar(0), true ); if ( eType & NUMBERFORMAT_PERCENT && bModified) OutString += '%'; @@ -2040,7 +2050,7 @@ short SvNumberformat::ImpCheckCondition(double& fNumber, } } -sal_Bool SvNumberformat::GetOutputString(String& sString, +bool SvNumberformat::GetOutputString(String& sString, String& OutString, Color** ppColor) { @@ -2053,13 +2063,13 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, else { *ppColor = NULL; // no change of color - return sal_False; + return false; } *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); if (rInfo.eScannedType == NUMBERFORMAT_TEXT) { - sal_Bool bRes = sal_False; + bool bRes = false; const sal_uInt16 nAnz = NumFor[nIx].GetCount(); for (sal_uInt16 i = 0; i < nAnz; i++) { @@ -2070,7 +2080,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -2087,7 +2097,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, } return bRes; } - return sal_False; + return false; } sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y) @@ -2216,11 +2226,11 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, Stri return true; } -sal_Bool SvNumberformat::GetOutputString(double fNumber, +bool SvNumberformat::GetOutputString(double fNumber, String& OutString, Color** ppColor) { - sal_Bool bRes = sal_False; + bool bRes = false; OutString.Erase(); // alles loeschen *ppColor = NULL; // keine Farbaenderung if (eType & NUMBERFORMAT_LOGICAL) @@ -2229,14 +2239,14 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetTrueString(); else OutString = rScan.GetFalseString(); - return sal_False; + return false; } if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); - return sal_False; + return false; } - sal_Bool bHadStandard = sal_False; + bool bHadStandard = false; if (bStandard) // einzelne Standardformate { if (rScan.GetStandardPrec() == SvNumberFormatter::INPUTSTRING_PRECISION) // alle Zahlformate InputLine @@ -2276,20 +2286,20 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, return false; } ImpGetOutputStandard(fNumber, OutString); - bHadStandard = sal_True; + bHadStandard = true; } break; case NUMBERFORMAT_DATE: bRes |= ImpGetDateOutput(fNumber, 0, OutString); - bHadStandard = sal_True; + bHadStandard = true; break; case NUMBERFORMAT_TIME: bRes |= ImpGetTimeOutput(fNumber, 0, OutString); - bHadStandard = sal_True; + bHadStandard = true; break; case NUMBERFORMAT_DATETIME: bRes |= ImpGetDateTimeOutput(fNumber, 0, OutString); - bHadStandard = sal_True; + bHadStandard = true; break; } } @@ -2314,11 +2324,11 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); const sal_uInt16 nAnz = NumFor[nIx].GetCount(); if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED) - return sal_False; // leer => nichts + return false; // leer => nichts else if (nAnz == 0) // sonst Standard-Format { ImpGetOutputStandard(fNumber, OutString); - return sal_False; + return false; } switch (rInfo.eScannedType) { @@ -2334,7 +2344,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -2374,11 +2384,11 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, String sStr, sFrac, sDiv; // Strings, Wert fuer sal_uLong nFrac, nDiv; // Vorkommaanteil // Zaehler und Nenner - sal_Bool bSign = sal_False; + bool bSign = false; if (fNumber < 0) { if (nIx == 0) // nicht in hinteren - bSign = sal_True; // Formaten + bSign = true; // Formaten fNumber = -fNumber; } double fNum = floor(fNumber); // Vorkommateil @@ -2387,12 +2397,12 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, // zu gross { OutString = rScan.GetErrorString(); - return sal_False; + return false; } if (rInfo.nCntExp == 0) { OSL_FAIL("SvNumberformat:: Bruch, nCntExp == 0"); - return sal_False; + return false; } sal_uLong nBasis = ((sal_uLong)floor( // 9, 99, 999 ,... pow(10.0,rInfo.nCntExp))) - 1; @@ -2400,14 +2410,14 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if (rInfo.nCntExp <= _MAX_FRACTION_PREC) { - sal_Bool bUpperHalf; + bool bUpperHalf; if (fNumber > 0.5) { - bUpperHalf = sal_True; + bUpperHalf = true; fNumber -= (fNumber - 0.5) * 2.0; } else - bUpperHalf = sal_False; + bUpperHalf = false; // Einstieg in Farey-Serie // finden: x0 = (sal_uLong) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9 @@ -2441,7 +2451,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, y0 /= nGgt; // Einschachteln: sal_uLong x2 = 0; sal_uLong y2 = 0; - sal_Bool bStop = sal_False; + bool bStop = false; while (!bStop) { #ifdef GCC @@ -2465,20 +2475,20 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if (fTest <= fOg) { fOg = fTest; - bStop = sal_True; + bStop = true; } else if (y1 == 1) - bStop = sal_True; + bStop = true; } // of while nGgt = ImpGGT(y1, x1); // x1/y1 kuerzen x2 = x1 / nGgt; y2 = y1 / nGgt; if (x2*y0 - x0*y2 == 1 || y1 <= 1) // Test, ob x2/y2 - bStop = sal_True; // naechste Farey-Zahl + bStop = true; // naechste Farey-Zahl else { y1--; - bStop = sal_False; + bStop = false; } } // of while x1 = x2; @@ -2566,7 +2576,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if (fNum1 > _D_MAX_U_LONG_) { OutString = rScan.GetErrorString(); - return sal_False; + return false; } nFrac = (sal_uLong) floor(fNum1); sStr.Erase(); @@ -2594,7 +2604,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 j = nAnz-1; // letztes Symbol->rueckw. xub_StrLen k; // Nenner: bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); - sal_Bool bCont = sal_True; + bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) { if (rInfo.nCntPre > 0 && nFrac == 0) @@ -2604,7 +2614,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = sal_False; + bCont = false; } // weiter Zaehler: if ( !bCont ) @@ -2618,7 +2628,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = sal_False; + bCont = false; } } // weiter Hauptzahl @@ -2639,11 +2649,11 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, break; case NUMBERFORMAT_SCIENTIFIC: { - sal_Bool bSign = sal_False; + bool bSign = false; if (fNumber < 0) { if (nIx == 0) // nicht in hinteren - bSign = sal_True; // Formaten + bSign = true; // Formaten fNumber = -fNumber; } String sStr( ::rtl::math::doubleToUString( fNumber, @@ -2693,7 +2703,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if (nZeros) ExpStr.Erase( 0, nZeros); - sal_Bool bCont = sal_True; + bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_EXP) { const String& rStr = rInfo.sStrArray[j]; @@ -2705,7 +2715,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = sal_False; + bCont = false; } // weiter Hauptzahl: if ( !bCont ) @@ -2728,20 +2738,20 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, return bRes; } -sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, +bool SvNumberformat::ImpGetTimeOutput(double fNumber, sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - sal_Bool bCalendarSet = sal_False; + bool bCalendarSet = false; double fNumberOrig = fNumber; - sal_Bool bRes = sal_False; - sal_Bool bSign = sal_False; + bool bRes = false; + bool bSign = false; if (fNumber < 0.0) { fNumber = -fNumber; if (nIx == 0) - bSign = sal_True; + bSign = true; } const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); if (rInfo.bThousand) // []-Format @@ -2749,22 +2759,22 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, if (fNumber > 1.0E10) // zu gross { OutString = rScan.GetErrorString(); - return sal_False; + return false; } } else fNumber -= floor(fNumber); // sonst Datum abtrennen - sal_Bool bInputLine; + bool bInputLine; xub_StrLen nCntPost; if ( rScan.GetStandardPrec() == 300 && 0 < rInfo.nCntPost && rInfo.nCntPost < 7 ) { // round at 7 decimals (+5 of 86400 == 12 significant digits) - bInputLine = sal_True; + bInputLine = true; nCntPost = 7; } else { - bInputLine = sal_False; + bInputLine = false; nCntPost = xub_StrLen(rInfo.nCntPost); } if (bSign && !rInfo.bThousand) // kein []-Format @@ -2772,12 +2782,12 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, double fTime = fNumber * 86400.0; fTime = ::rtl::math::round( fTime, int(nCntPost) ); if (bSign && fTime == 0.0) - bSign = sal_False; // nicht -00:00:00 + bSign = false; // nicht -00:00:00 if( floor( fTime ) > _D_MAX_U_LONG_ ) { OutString = rScan.GetErrorString(); - return sal_False; + return false; } sal_uLong nSeconds = (sal_uLong)floor( fTime ); @@ -2857,7 +2867,7 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -2891,7 +2901,7 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, double fDiff = DateTime(*(rScan.GetNullDate())) - GetCal().getEpochStart(); fDiff += fNumberOrig; GetCal().setLocalDateTime( fDiff ); - bCalendarSet = sal_True; + bCalendarSet = true; } if (cAmPm == 'a') OutString += GetCal().getDisplayName( @@ -2936,10 +2946,10 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, return bRes; } -sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const +bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const { if ( GetCal().getUniqueID() != Gregorian::get() ) - return sal_False; + return false; const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); const sal_uInt16 nAnz = rNumFor.GetCount(); sal_uInt16 i; @@ -2948,17 +2958,17 @@ sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const switch ( rInfo.nTypeArray[i] ) { case NF_SYMBOLTYPE_CALENDAR : - return sal_False; + return false; case NF_KEY_EC : case NF_KEY_EEC : case NF_KEY_R : case NF_KEY_RR : case NF_KEY_AAA : case NF_KEY_AAAA : - return sal_True; + return true; } } - return sal_False; + return false; } void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar, @@ -3004,7 +3014,7 @@ void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar, } } -sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ) +bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ) { using namespace ::com::sun::star::i18n; CalendarWrapper& rCal = GetCal(); @@ -3024,13 +3034,13 @@ sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, d rOrgCalendar.Erase(); rCal.loadCalendar( rGregorian, rLoc().getLocale() ); rCal.setDateTime( fOrgDateTime ); - return sal_True; + return true; } } - return sal_False; + return false; } -sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, +bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const { const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); @@ -3047,10 +3057,10 @@ sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, } rCal.loadCalendar( rInfo.sStrArray[i], rLoc().getLocale() ); rCal.setDateTime( fOrgDateTime ); - return sal_True; + return true; } } - return sal_False; + return false; } // static @@ -3077,23 +3087,23 @@ void SvNumberformat::ImpAppendEraG( String& OutString, OutString += rCal.getDisplayString( CalendarDisplayCode::SHORT_ERA, nNatNum ); } -sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, +bool SvNumberformat::ImpGetDateOutput(double fNumber, sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - sal_Bool bRes = sal_False; + bool bRes = false; CalendarWrapper& rCal = GetCal(); double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart(); fNumber += fDiff; rCal.setLocalDateTime( fNumber ); String aOrgCalendar; // empty => not changed yet double fOrgDateTime; - sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); + bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); if ( bOtherCalendar ) SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime ); if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) ) - bOtherCalendar = sal_False; + bOtherCalendar = false; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); const sal_uInt16 nAnz = NumFor[nIx].GetCount(); sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum(); @@ -3116,7 +3126,7 @@ sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -3260,29 +3270,29 @@ sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, return bRes; } -sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, +bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - sal_Bool bRes = sal_False; + bool bRes = false; CalendarWrapper& rCal = GetCal(); double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart(); fNumber += fDiff; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - sal_Bool bInputLine; + bool bInputLine; xub_StrLen nCntPost; if ( rScan.GetStandardPrec() == 300 && 0 < rInfo.nCntPost && rInfo.nCntPost < 7 ) { // round at 7 decimals (+5 of 86400 == 12 significant digits) - bInputLine = sal_True; + bInputLine = true; nCntPost = 7; } else { - bInputLine = sal_False; + bInputLine = false; nCntPost = xub_StrLen(rInfo.nCntPost); } double fTime = (fNumber - floor( fNumber )) * 86400.0; @@ -3297,11 +3307,11 @@ sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, String aOrgCalendar; // empty => not changed yet double fOrgDateTime; - sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); + bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); if ( bOtherCalendar ) SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime ); if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) ) - bOtherCalendar = sal_False; + bOtherCalendar = false; sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum(); sal_uLong nSeconds = (sal_uLong)floor( fTime ); @@ -3389,7 +3399,7 @@ sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -3582,23 +3592,23 @@ sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, return bRes; } -sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, +bool SvNumberformat::ImpGetNumberOutput(double fNumber, sal_uInt16 nIx, String& OutString) { - sal_Bool bRes = sal_False; - sal_Bool bSign; + bool bRes = false; + bool bSign; if (fNumber < 0.0) { if (nIx == 0) // nicht in hinteren - bSign = sal_True; // Formaten + bSign = true; // Formaten else - bSign = sal_False; + bSign = false; fNumber = -fNumber; } else { - bSign = sal_False; + bSign = false; if ( ::rtl::math::isSignBitSet( fNumber ) ) fNumber = -fNumber; // yes, -0.0 is possible, eliminate '-' } @@ -3610,13 +3620,13 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, else { OutString = rScan.GetErrorString(); - return sal_False; + return false; } } sal_uInt16 i, j; xub_StrLen k; String sStr; - sal_Bool bInteger = sal_False; + bool bInteger = false; if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT ) { // special formatting only if no GENERAL keyword in format code const sal_uInt16 nThousand = rInfo.nThousand; @@ -3664,12 +3674,12 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, while ( *++p == '0' ) ; if ( !*p ) - bInteger = sal_True; + bInteger = true; sStr.Erase( nPoint, 1 ); // . herausnehmen } if (bSign && (sStr.Len() == 0 || sStr.GetTokenCount('0') == sStr.Len()+1)) // nur 00000 - bSign = sal_False; // nicht -0.00 + bSign = false; // nicht -0.00 } // End of != FLAG_STANDARD_IN_FORMAT // von hinten nach vorn @@ -3679,8 +3689,8 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, // Nachkommastellen: if (rInfo.nCntPost > 0) { - sal_Bool bTrailing = sal_True; // ob Endnullen? - sal_Bool bFilled = sal_False; // ob aufgefuellt wurde ? + bool bTrailing = true; // ob Endnullen? + bool bFilled = false; // ob aufgefuellt wurde ? short nType; while (j > 0 && // rueckwaerts (nType = rInfo.nTypeArray[j]) != NF_SYMBOLTYPE_DECSEP) @@ -3692,7 +3702,7 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, { sStr.Insert( (sal_Unicode) 0x1B, k /*++*/ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -3717,21 +3727,21 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, const sal_Unicode c = *p; k--; if ( sStr.GetChar(k) != '0' ) - bTrailing = sal_False; + bTrailing = false; if (bTrailing) { if ( c == '0' ) - bFilled = sal_True; + bFilled = true; else if ( c == '-' ) { if ( bInteger ) sStr.SetChar( k, '-' ); - bFilled = sal_True; + bFilled = true; } else if ( c == '?' ) { sStr.SetChar( k, ' ' ); - bFilled = sal_True; + bFilled = true; } else if ( !bFilled ) // # sStr.Erase(k,1); @@ -3773,7 +3783,7 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, return bRes; } -sal_Bool SvNumberformat::ImpNumberFillWithThousands( +bool SvNumberformat::ImpNumberFillWithThousands( String& sStr, // number string double& rNumber, // number xub_StrLen k, // position within string @@ -3781,19 +3791,19 @@ sal_Bool SvNumberformat::ImpNumberFillWithThousands( sal_uInt16 nIx, // subformat index sal_uInt16 nDigCnt) // count of integer digits in format { - sal_Bool bRes = sal_False; + bool bRes = false; xub_StrLen nLeadingStringChars = 0; // inserted StringChars before number xub_StrLen nDigitCount = 0; // count of integer digits from the right - sal_Bool bStop = sal_False; + bool bStop = false; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); // no normal thousands separators if number divided by thousands - sal_Bool bDoThousands = (rInfo.nThousand == 0); + bool bDoThousands = (rInfo.nThousand == 0); utl::DigitGroupingIterator aGrouping( GetFormatter().GetLocaleData()->getDigitGrouping()); while (!bStop) // backwards { if (j == 0) - bStop = sal_True; + bStop = true; switch (rInfo.nTypeArray[j]) { case NF_SYMBOLTYPE_DECSEP: @@ -3812,7 +3822,7 @@ sal_Bool SvNumberformat::ImpNumberFillWithThousands( { sStr.Insert( (sal_Unicode) 0x1B, k/*++*/ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -3954,18 +3964,18 @@ void SvNumberformat::ImpDigitFill( k = nStart; } -sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string +bool SvNumberformat::ImpNumberFill( String& sStr, // number string double& rNumber, // number for "General" format xub_StrLen& k, // position within string sal_uInt16& j, // symbol index within format code sal_uInt16 nIx, // subformat index short eSymbolType ) // type of stop condition { - sal_Bool bRes = sal_False; + bool bRes = false; k = sStr.Len(); // behind last digit const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); // no normal thousands separators if number divided by thousands - sal_Bool bDoThousands = (rInfo.nThousand == 0); + bool bDoThousands = (rInfo.nThousand == 0); short nType; while (j > 0 && (nType = rInfo.nTypeArray[j]) != eSymbolType ) { // rueckwaerts: @@ -3976,7 +3986,7 @@ sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string { sStr.Insert( sal_Unicode(0x1B), k++ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = sal_True; + bRes = true; } break; case NF_SYMBOLTYPE_BLANK: @@ -4046,8 +4056,8 @@ sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string return bRes; } -void SvNumberformat::GetFormatSpecialInfo(sal_Bool& bThousand, - sal_Bool& IsRed, +void SvNumberformat::GetFormatSpecialInfo(bool& bThousand, + bool& IsRed, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading) const { @@ -4061,13 +4071,13 @@ void SvNumberformat::GetFormatSpecialInfo(sal_Bool& bThousand, const Color* pColor = NumFor[1].GetColor(); if (fLimit1 == 0.0 && fLimit2 == 0.0 && pColor && (*pColor == rScan.GetRedColor())) - IsRed = sal_True; + IsRed = true; else - IsRed = sal_False; + IsRed = false; } void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, - sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const + bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const { // take info from a specified sub-format (for XML export) @@ -4084,7 +4094,7 @@ void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, else { nAnzLeading = 0; - sal_Bool bStop = sal_False; + bool bStop = false; sal_uInt16 i = 0; const sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); while (!bStop && i < nAnz) @@ -4099,14 +4109,14 @@ void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, nAnzLeading++; } else if (nType == NF_SYMBOLTYPE_DECSEP || nType == NF_SYMBOLTYPE_EXP) - bStop = sal_True; + bStop = true; i++; } } } const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos, - sal_Bool bString /* = sal_False */ ) const + bool bString /* = false */ ) const { if ( nNumFor > 3 ) return NULL; @@ -4148,7 +4158,7 @@ const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nP } short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, - sal_Bool bString /* = sal_False */ ) const + bool bString /* = false */ ) const { if ( nNumFor > 3 ) return 0; @@ -4188,28 +4198,28 @@ short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, return NumFor[nNumFor].Info().nTypeArray[nPos]; } -sal_Bool SvNumberformat::IsNegativeWithoutSign() const +bool SvNumberformat::IsNegativeWithoutSign() const { if ( IsNegativeRealNegative() ) { - const String* pStr = GetNumForString( 1, 0, sal_True ); + const String* pStr = GetNumForString( 1, 0, true ); if ( pStr ) return !HasStringNegativeSign( *pStr ); } - return sal_False; + return false; } -sal_Bool SvNumberformat::IsNegativeInBracket() const +bool SvNumberformat::IsNegativeInBracket() const { sal_uInt16 nAnz = NumFor[1].GetCount(); if (!nAnz) - return sal_False; + return false; String *tmpStr = NumFor[1].Info().sStrArray; return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' ); } -sal_Bool SvNumberformat::HasPositiveBracketPlaceholder() const +bool SvNumberformat::HasPositiveBracketPlaceholder() const { sal_uInt16 nAnz = NumFor[0].GetCount(); String *tmpStr = NumFor[0].Info().sStrArray; @@ -4342,17 +4352,17 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, } rStr += String( ::rtl::math::doubleToUString( fLimit, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - rDecSep.GetChar(0), sal_True)); + rDecSep.GetChar(0), true)); rStr += ']'; } } String SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLocWrp, - sal_Bool bDontQuote ) const + bool bDontQuote ) const { String aStr; - sal_Bool bDefault[4]; + bool bDefault[4]; // 1 subformat matches all if no condition specified, bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); // with 2 subformats [>=0];[<0] is implied if no condition specified @@ -4364,26 +4374,26 @@ String SvNumberformat::GetMappedFormatstring( bDefault[2] = ( !bDefault[0] && !bDefault[1] && eOp1 == NUMBERFORMAT_OP_GT && fLimit1 == 0.0 && eOp2 == NUMBERFORMAT_OP_LT && fLimit2 == 0.0 ); - sal_Bool bDefaults = bDefault[0] || bDefault[1] || bDefault[2]; + bool bDefaults = bDefault[0] || bDefault[1] || bDefault[2]; // from now on bDefault[] values are used to append empty subformats at the end - bDefault[3] = sal_False; + bDefault[3] = false; if ( !bDefaults ) { // conditions specified if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO ) - bDefault[0] = bDefault[1] = sal_True; // [];x + bDefault[0] = bDefault[1] = true; // [];x else if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 != NUMBERFORMAT_OP_NO && NumFor[2].GetCount() == 0 ) - bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = sal_True; // [];[];; + bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = true; // [];[];; // nothing to do if conditions specified for every subformat } else if ( bDefault[0] ) - bDefault[0] = sal_False; // a single unconditional subformat is never delimited + bDefault[0] = false; // a single unconditional subformat is never delimited else { if ( bDefault[2] && NumFor[2].GetCount() == 0 && NumFor[1].GetCount() > 0 ) - bDefault[3] = sal_True; // special cases x;x;; and ;x;; + bDefault[3] = true; // special cases x;x;; and ;x;; for ( int i=0; i<3 && !bDefault[i]; ++i ) - bDefault[i] = sal_True; + bDefault[i] = true; } int nSem = 0; // needed ';' delimiters int nSub = 0; // subformats delimited so far @@ -4434,7 +4444,7 @@ String SvNumberformat::GetMappedFormatstring( for ( ; nSem; --nSem ) aStr += ';'; for ( ; nSub <= n; ++nSub ) - bDefault[nSub] = sal_False; + bDefault[nSub] = false; } if ( aPrefix.Len() ) @@ -4594,27 +4604,27 @@ void SvNumberformat::GetNatNumXml( } // static -sal_Bool SvNumberformat::HasStringNegativeSign( const String& rStr ) +bool SvNumberformat::HasStringNegativeSign( const String& rStr ) { // fuer Sign muss '-' am Anfang oder am Ende des TeilStrings sein (Blanks ignored) xub_StrLen nLen = rStr.Len(); if ( !nLen ) - return sal_False; + return false; const sal_Unicode* const pBeg = rStr.GetBuffer(); const sal_Unicode* const pEnd = pBeg + nLen; register const sal_Unicode* p = pBeg; do { // Anfang if ( *p == '-' ) - return sal_True; + return true; } while ( *p == ' ' && ++p < pEnd ); p = pEnd - 1; do { // Ende if ( *p == '-' ) - return sal_True; + return true; } while ( *p == ' ' && pBeg < --p ); - return sal_False; + return false; } // static @@ -4672,9 +4682,9 @@ void SvNumberformat::EraseCommentBraces( String& rStr ) void SvNumberformat::EraseComment( String& rStr ) { register const sal_Unicode* p = rStr.GetBuffer(); - sal_Bool bInString = sal_False; - sal_Bool bEscaped = sal_False; - sal_Bool bFound = sal_False; + bool bInString = false; + bool bEscaped = false; + bool bFound = false; xub_StrLen nPos = 0; while ( !bFound && *p ) { @@ -4690,14 +4700,14 @@ void SvNumberformat::EraseComment( String& rStr ) case '{' : if ( !bEscaped && !bInString ) { - bFound = sal_True; + bFound = true; nPos = sal::static_int_cast< xub_StrLen >( p - rStr.GetBuffer()); } break; } if ( bEscaped && *p != '\\' ) - bEscaped = sal_False; + bEscaped = false; ++p; } if ( bFound ) @@ -4705,31 +4715,31 @@ void SvNumberformat::EraseComment( String& rStr ) } // static -sal_Bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, +bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, sal_Unicode cQuote, sal_Unicode cEscIn, sal_Unicode cEscOut ) { xub_StrLen nLen = rStr.Len(); if ( nPos >= nLen ) - return sal_False; + return false; register const sal_Unicode* p0 = rStr.GetBuffer(); register const sal_Unicode* p = p0; register const sal_Unicode* p1 = p0 + nPos; - sal_Bool bQuoted = sal_False; + bool bQuoted = false; while ( p <= p1 ) { if ( *p == cQuote ) { if ( p == p0 ) - bQuoted = sal_True; + bQuoted = true; else if ( bQuoted ) { if ( *(p-1) != cEscIn ) - bQuoted = sal_False; + bQuoted = false; } else { if ( *(p-1) != cEscOut ) - bQuoted = sal_True; + bQuoted = true; } } p++; diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 9eee6a55c823..29a0f9bd451d 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -80,7 +80,7 @@ namespace ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) { pFormatter = pFormatterP; - bConvertMode = sal_False; + bConvertMode = false; //! All keywords MUST be UPPERCASE! sKeyword[NF_KEY_E].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "E" ) ); // Exponent sKeyword[NF_KEY_AMPM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AM/PM" ) ); // AM/PM @@ -96,8 +96,8 @@ ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) sKeyword[NF_KEY_NNNN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NNNN" ) ); // Day of week long incl. separator sKeyword[NF_KEY_WW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WW" ) ); // Week of year sKeyword[NF_KEY_CCC].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CCC" ) ); // Currency abbreviation - bKeywordsNeedInit = sal_True; // locale dependent keywords - bCompatCurNeedInit = sal_True; // locale dependent compatibility currency strings + bKeywordsNeedInit = true; // locale dependent keywords + bCompatCurNeedInit = true; // locale dependent compatibility currency strings StandardColor[0] = Color(COL_BLACK); StandardColor[1] = Color(COL_LIGHTBLUE); @@ -125,8 +125,8 @@ ImpSvNumberformatScan::~ImpSvNumberformatScan() void ImpSvNumberformatScan::ChangeIntl() { - bKeywordsNeedInit = sal_True; - bCompatCurNeedInit = sal_True; + bKeywordsNeedInit = true; + bCompatCurNeedInit = true; // may be initialized by InitSpecialKeyword() sKeyword[NF_KEY_TRUE].Erase(); sKeyword[NF_KEY_FALSE].Erase(); @@ -168,7 +168,7 @@ void ImpSvNumberformatScan::InitCompatCur() const pFormatter->GetCompatibilityCurrency( pThis->sCurSymbol, pThis->sCurAbbrev ); // currency symbol upper case pThis->sCurString = pFormatter->GetCharClass()->upper( sCurSymbol ); - bCompatCurNeedInit = sal_False; + bCompatCurNeedInit = false; } void ImpSvNumberformatScan::InitKeywords() const @@ -176,7 +176,7 @@ void ImpSvNumberformatScan::InitKeywords() const if ( !bKeywordsNeedInit ) return ; ((ImpSvNumberformatScan*)this)->SetDependentKeywords(); - bKeywordsNeedInit = sal_False; + bKeywordsNeedInit = false; } /** Extract the name of General, Standard, Whatever, ignoring leading modifiers @@ -537,7 +537,7 @@ short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos return NF_KEY_GENERAL; //! MUST be a reverse search to find longer strings first short i = NF_KEYWORD_ENTRIES_COUNT-1; - sal_Bool bFound = sal_False; + bool bFound = false; for ( ; i > NF_KEY_LASTKEYWORD_SO5; --i ) { bFound = sString.Search(rKeyword[i]) == 0; @@ -741,7 +741,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, short nTmpType = GetKeyWord( rStr, nPos-1 ); if ( nTmpType ) { - sal_Bool bCurrency = sal_False; + bool bCurrency = false; // "Automatic" currency may start with keyword, // like "R" (Rand) and 'R' (era) if ( nCurrPos != STRING_NOTFOUND && @@ -751,7 +751,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, String aTest( rStr.Copy( nPos-1, sCurString.Len() ) ); pChrCls->toUpper( aTest ); if ( aTest == sCurString ) - bCurrency = sal_True; + bCurrency = true; } if ( bCurrency ) { @@ -831,7 +831,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, } else { - sal_Bool bDontStop = sal_False; + bool bDontStop = false; switch (cToken) { case '/': // AM/PM, A/P @@ -847,7 +847,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, && (rStr.GetChar(nPos+1) == 'M' || rStr.GetChar(nPos+1) == 'm'))) ) { sSymbol += cToken; - bDontStop = sal_True; + bDontStop = true; } } } @@ -916,7 +916,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) } } nAnzStrings = 0; - sal_Bool bStar = sal_False; // wird bei '*'Detektion gesetzt + bool bStar = false; // wird bei '*'Detektion gesetzt Reset(); xub_StrLen nPos = 0; @@ -929,7 +929,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) if (bStar) return nPos; // Fehler: doppelter '*' else - bStar = sal_True; + bStar = true; } nAnzStrings++; } @@ -1024,28 +1024,28 @@ sal_Unicode ImpSvNumberformatScan::NextChar(sal_uInt16 i) return res; } -sal_Bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i) +bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i) { - sal_Bool res = sal_True; + bool res = true; if (i < nAnzStrings-1) { - sal_Bool bStop = sal_False; + bool bStop = false; i++; while (i < nAnzStrings-1 && !bStop) { i++; if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == '/') - bStop = sal_True; + bStop = true; else if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == ' ') - res = sal_False; + res = false; } if (!bStop) // kein '/' - res = sal_False; + res = false; } else - res = sal_False; // kein '/' mehr + res = false; // kein '/' mehr return res; } @@ -1064,22 +1064,22 @@ void ImpSvNumberformatScan::Reset() #endif eScannedType = NUMBERFORMAT_UNDEFINED; nRepPos = 0; - bExp = sal_False; - bThousand = sal_False; + bExp = false; + bThousand = false; nThousand = 0; - bDecSep = sal_False; + bDecSep = false; nDecPos = -1; nExpPos = (sal_uInt16) -1; nBlankPos = (sal_uInt16) -1; nCntPre = 0; nCntPost = 0; nCntExp = 0; - bFrac = sal_False; - bBlank = sal_False; + bFrac = false; + bBlank = false; nNatNumModifier = 0; } -sal_Bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep ) +bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, bool bHadDecSep ) { sal_uInt16 nIndexPre = PreviousKeyword( i ); return (nIndexPre == NF_KEY_S || nIndexPre == NF_KEY_SS) @@ -1095,7 +1095,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) xub_StrLen nPos = 0; sal_uInt16 i = 0; short eNewType; - sal_Bool bMatchBracket = sal_False; + bool bMatchBracket = false; bool bHaveGeneral = false; // if General/Standard encountered SkipStrings(i, nPos); @@ -1187,7 +1187,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) { if ( Is100SecZero( i, bDecSep ) ) { - bDecSep = sal_True; // subsequent 0's + bDecSep = true; // subsequent 0's eNewType = NUMBERFORMAT_TIME; } else @@ -1210,14 +1210,14 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) sStrArray[i+1].GetChar(0) == '$' ) { // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR eNewType = NUMBERFORMAT_CURRENCY; - bMatchBracket = sal_True; + bMatchBracket = true; } else if ( i < nAnzStrings-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1].GetChar(0) == '~' ) { // as of SV_NUMBERFORMATTER_VERSION_CALENDAR eNewType = NUMBERFORMAT_DATE; - bMatchBracket = sal_True; + bMatchBracket = true; } else { @@ -1239,7 +1239,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) break; default: if ( sStrArray[i] == pLoc->getTime100SecSep() ) - bDecSep = sal_True; // for SS,0 + bDecSep = true; // for SS,0 eNewType = NUMBERFORMAT_UNDEFINED; break; } @@ -1376,7 +1376,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) { if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == ']' ) - bMatchBracket = sal_False; + bMatchBracket = false; else nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].Len(); @@ -1501,7 +1501,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) sal_uInt16 i = 0; // symbol loop counter sal_uInt16 nCounter = 0; // counts digits nAnzResStrings = nAnzStrings; // counts remaining symbols - bDecSep = sal_False; // reset in case already used in TypeCheck + bDecSep = false; // reset in case already used in TypeCheck bool bThaiT = false; // Thai T NatNum modifier present switch (eScannedType) @@ -1583,7 +1583,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bExp) // doppelt return nPos; - bExp = sal_True; + bExp = true; nExpPos = i; if (bDecSep) nCntPost = nCounter; @@ -1599,7 +1599,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bDecSep && nCounter > 0) // Nachkommastellen return nPos; // Fehler - bBlank = sal_True; + bBlank = true; nBlankPos = i; nCntPre = nCounter; nCounter = 0; @@ -1744,7 +1744,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { nPos = nPos + sStrArray[i].Len(); if (!bThousand) // only once - bThousand = sal_True; + bThousand = true; // Eat it, will be reinserted at proper // grouping positions further down. nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; @@ -1757,7 +1757,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { // #,,,, if ( StringEqualsChar( sOldThousandSep, ' ' ) ) { // strange, those French.. - sal_Bool bFirst = sal_True; + bool bFirst = true; String& rStr = sStrArray[i]; // set a hard Non-Breaking Space or ConvertMode const String& rSepF = pFormatter->GetNumThousandSep(); @@ -1769,7 +1769,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nPos = nPos + sStrArray[i].Len(); if ( bFirst ) { - bFirst = sal_False; + bFirst = false; rStr = rSepF; nTypeArray[i] = NF_SYMBOLTYPE_THSEP; } @@ -1801,7 +1801,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( bFirst ) { - bFirst = sal_False; + bFirst = false; rStr = rSepF; nTypeArray[i] = NF_SYMBOLTYPE_THSEP; } @@ -1878,7 +1878,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nPos = nPos + sStrArray[i].Len(); nTypeArray[i] = NF_SYMBOLTYPE_DECSEP; sStrArray[i] = pFormatter->GetNumDecimalSep(); - bDecSep = sal_True; + bDecSep = true; nDecPos = i; nCntPre = nCounter; nCounter = 0; @@ -1896,7 +1896,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { // or behind / if (bDecSep && nCounter > 0)// dec. return nPos; // error - bBlank = sal_True; + bBlank = true; nBlankPos = i; nCntPre = nCounter; nCounter = 0; @@ -1933,7 +1933,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) return nPos ? nPos : 1; // /? not allowed else if (!bFrac || (bDecSep && nCounter > 0)) { - bFrac = sal_True; + bFrac = true; nCntPost = nCounter; nCounter = 0; nTypeArray[i] = NF_SYMBOLTYPE_FRAC; @@ -1971,7 +1971,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) String& rStr = sStrArray[i]; String* pStr = &sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_CURRENCY; // wandeln - sal_Bool bHadDash = sal_False; + bool bHadDash = false; i++; while ( i < nAnzStrings && sStrArray[i].GetChar(0) != ']' ) @@ -1987,7 +1987,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( sStrArray[i].GetChar(0) == '-' ) { - bHadDash = sal_True; + bHadDash = true; pStr = &sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_CURREXT; } @@ -2245,7 +2245,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( Is100SecZero( i, bDecSep ) ) { - bDecSep = sal_True; + bDecSep = true; nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; String& rStr = sStrArray[i]; i++; @@ -2273,7 +2273,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bThousand) // doppelt return nPos; - bThousand = sal_True; // bei Time frei + bThousand = true; // bei Time frei sal_Unicode cChar = pChrCls->upper( NextChar(i) ).GetChar(0); if ( cChar == cOldKeyH ) nThousand = 1; // H @@ -2306,7 +2306,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } else if ( sStrArray[i] == sOldTime100SecSep ) { - bDecSep = sal_True; + bDecSep = true; nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP; if ( bConvertMode ) sStrArray[i] = pLoc->getTime100SecSep(); @@ -2339,7 +2339,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_AMPM: // AM/PM case NF_KEY_AP: // A/P { - bExp = sal_True; // missbraucht fuer A/P + bExp = true; // missbraucht fuer A/P sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2376,7 +2376,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) break; // of NUMBERFORMAT_TIME case NUMBERFORMAT_DATETIME: { - sal_Bool bTimePart = sal_False; + bool bTimePart = false; while (i < nAnzStrings) { switch (nTypeArray[i]) @@ -2414,7 +2414,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( bTimePart && Is100SecZero( i, bDecSep ) ) { - bDecSep = sal_True; + bDecSep = true; nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; String& rStr = sStrArray[i]; i++; @@ -2451,7 +2451,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } else if ( sStrArray[i] == sOldTime100SecSep ) { - bDecSep = sal_True; + bDecSep = true; nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP; if ( bConvertMode ) sStrArray[i] = pLoc->getTime100SecSep(); @@ -2479,8 +2479,8 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_AMPM: // AM/PM case NF_KEY_AP: // A/P { - bTimePart = sal_True; - bExp = sal_True; // missbraucht fuer A/P + bTimePart = true; + bExp = true; // missbraucht fuer A/P sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2492,7 +2492,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_HH: // HH case NF_KEY_S: // S case NF_KEY_SS: // SS - bTimePart = sal_True; + bTimePart = true; sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2523,7 +2523,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_GGG : // GGG case NF_KEY_R : // R case NF_KEY_RR : // RR - bTimePart = sal_False; + bTimePart = false; sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 3aa279c3ee46..45892913ae47 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -73,7 +73,7 @@ public: InitKeywords(); return sKeyword; } - // Keywords used in output like sal_True and sal_False + // Keywords used in output like true and false const String& GetSpecialKeyword( NfKeywordIndex eIdx ) const { if ( !sKeyword[eIdx].Len() ) @@ -124,18 +124,18 @@ public: } void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge, - sal_Bool bSystemToSystem = sal_False ) + bool bSystemToSystem = false ) { - bConvertMode = sal_True; + bConvertMode = true; eNewLnge = eNewLge; eTmpLnge = eTmpLge; bConvertSystemToSystem = bSystemToSystem; } - void SetConvertMode(sal_Bool bMode) { bConvertMode = bMode; } + void SetConvertMode(bool bMode) { bConvertMode = bMode; } // Veraendert nur die Bool-Variable // (zum temporaeren Unterbrechen des // Convert-Modus) - sal_Bool GetConvertMode() const { return bConvertMode; } + bool GetConvertMode() const { return bConvertMode; } LanguageType GetNewLnge() const { return eNewLnge; } // Lesezugriff auf ConvertMode // und Konvertierungsland/Spr. @@ -158,49 +158,49 @@ private: // ---- privater Teil Color StandardColor[NF_MAX_DEFAULT_COLORS]; // Array der Standardfarben Date* pNullDate; // 30Dec1899 - String sNameStandardFormat; // "Standard" + String sNameStandardFormat; // "Standard" sal_uInt16 nStandardPrec; // default Precision for Standardformat SvNumberFormatter* pFormatter; // Pointer auf die Formatliste String sStrArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Symbole short nTypeArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Infos // externe Infos: - sal_uInt16 nAnzResStrings; // Anzahl der Ergebnissymbole + sal_uInt16 nAnzResStrings; // Anzahl der Ergebnissymbole #if !(defined SOLARIS && defined X86) short eScannedType; // Typ gemaess Scan #else int eScannedType; // wg. Optimierung #endif - sal_Bool bThousand; // Mit Tausenderpunkt - sal_uInt16 nThousand; // Zaehlt ....-Folgen - sal_uInt16 nCntPre; // Zaehlt Vorkommastellen - sal_uInt16 nCntPost; // Zaehlt Nachkommastellen - sal_uInt16 nCntExp; // Zaehlt Exp.Stellen, AM/PM + bool bThousand; // Mit Tausenderpunkt + sal_uInt16 nThousand; // Zaehlt ....-Folgen + sal_uInt16 nCntPre; // Zaehlt Vorkommastellen + sal_uInt16 nCntPost; // Zaehlt Nachkommastellen + sal_uInt16 nCntExp; // Zaehlt Exp.Stellen, AM/PM // interne Infos: - sal_uInt16 nAnzStrings; // Anzahl der Symbole - sal_uInt16 nRepPos; // Position eines '*' - sal_uInt16 nExpPos; // interne Position des E - sal_uInt16 nBlankPos; // interne Position des Blank + sal_uInt16 nAnzStrings; // Anzahl der Symbole + sal_uInt16 nRepPos; // Position eines '*' + sal_uInt16 nExpPos; // interne Position des E + sal_uInt16 nBlankPos; // interne Position des Blank short nDecPos; // interne Pos. des , - sal_Bool bExp; // wird bei Lesen des E gesetzt - sal_Bool bFrac; // wird bei Lesen des / gesetzt - sal_Bool bBlank; // wird bei ' '(Fraction) ges. - sal_Bool bDecSep; // Wird beim ersten , gesetzt - mutable sal_Bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized - mutable sal_Bool bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized + bool bExp; // wird bei Lesen des E gesetzt + bool bFrac; // wird bei Lesen des / gesetzt + bool bBlank; // wird bei ' '(Fraction) ges. + bool bDecSep; // Wird beim ersten , gesetzt + mutable bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized + mutable bool bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized String sCurSymbol; // Currency symbol for compatibility format codes String sCurString; // Currency symbol in upper case String sCurAbbrev; // Currency abbreviation String sErrStr; // String fuer Fehlerausgaben - sal_Bool bConvertMode; // Wird im Convert-Mode gesetzt + bool bConvertMode; // Wird im Convert-Mode gesetzt // Land/Sprache, in die der LanguageType eNewLnge; // gescannte String konvertiert // wird (fuer Excel Filter) // Land/Sprache, aus der der LanguageType eTmpLnge; // gescannte String konvertiert // wird (fuer Excel Filter) - sal_Bool bConvertSystemToSystem; // Whether the conversion is + bool bConvertSystemToSystem; // Whether the conversion is // from one system locale to // another system locale (in // this case the automatic @@ -219,31 +219,31 @@ private: // ---- privater Teil void SetDependentKeywords(); // Setzt die Sprachabh. Keyw. void SkipStrings(sal_uInt16& i,xub_StrLen& nPos);// Ueberspringt StringSymbole - sal_uInt16 PreviousKeyword(sal_uInt16 i); // Gibt Index des vorangeh. + sal_uInt16 PreviousKeyword(sal_uInt16 i); // Gibt Index des vorangeh. // Schluesselworts oder 0 - sal_uInt16 NextKeyword(sal_uInt16 i); // Gibt Index des naechsten + sal_uInt16 NextKeyword(sal_uInt16 i); // Gibt Index des naechsten // Schluesselworts oder 0 - sal_Unicode PreviousChar(sal_uInt16 i); // Gibt letzten Buchstaben + sal_Unicode PreviousChar(sal_uInt16 i); // Gibt letzten Buchstaben // vor der Position, // skipt EMPTY, STRING, STAR, BLANK - sal_Unicode NextChar(sal_uInt16 i); // Gibt ersten Buchst. danach - short PreviousType( sal_uInt16 i ); // Gibt Typ vor Position, + sal_Unicode NextChar(sal_uInt16 i); // Gibt ersten Buchst. danach + short PreviousType( sal_uInt16 i ); // Gibt Typ vor Position, // skipt EMPTY - sal_Bool IsLastBlankBeforeFrac(sal_uInt16 i); // True <=> es kommt kein ' ' + bool IsLastBlankBeforeFrac(sal_uInt16 i); // True <=> es kommt kein ' ' // mehr bis zum '/' void Reset(); // Reset aller Variablen // vor Analysestart short GetKeyWord( const String& sSymbol, // determine keyword at nPos xub_StrLen nPos ); // return 0 <=> not found - inline sal_Bool IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC + inline bool IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC { return (nKey == NF_KEY_EC || nKey == NF_KEY_E) && (GetKeywords()[NF_KEY_EC] == GetKeywords()[NF_KEY_E]); } // if 0 at strArray[i] is of S,00 or SS,00 or SS"any"00 in ScanType() or FinalScan() - sal_Bool Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep ); + bool Is100SecZero( sal_uInt16 i, bool bHadDecSep ); short Next_Symbol(const String& rStr, xub_StrLen& nPos, @@ -260,7 +260,7 @@ private: // ---- privater Teil reused instead of shifting all one up and nPos is decremented! */ bool InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr ); - static inline sal_Bool StringEqualsChar( const String& rStr, sal_Unicode ch ) + static inline bool StringEqualsChar( const String& rStr, sal_Unicode ch ) { return rStr.GetChar(0) == ch && rStr.Len() == 1; } // Yes, for efficiency get the character first and then compare length // because in most places where this is used the string is one char. |