diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-02 14:30:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-03 08:41:07 +0200 |
commit | 0b725f98d64f2413d064e487ca7869ac258e6c4e (patch) | |
tree | 1e1c0a4941b678f3e3b7f82d73bf03bef411e5c7 | |
parent | 14b809550657f9df3a70d533ef54df857d48bc1b (diff) |
rename nAnzStrings -> nStringsCnt
Change-Id: I387b702a0bc785a8e9da4e0390067626c5475319
Reviewed-on: https://gerrit.libreoffice.org/40674
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svl/zformat.hxx | 4 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 88 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.hxx | 12 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 16 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 122 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 18 |
8 files changed, 133 insertions, 133 deletions
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index e2767fc83a5f..d56728b2242d 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -111,7 +111,7 @@ public: const ImpSvNumberformatInfo& Info() const { return aI; } // Get count of substrings (symbols) - sal_uInt16 GetCount() const { return nAnzStrings;} + sal_uInt16 GetCount() const { return nStringsCnt;} Color* GetColor() const { return pColor; } void SetColor( Color* pCol, OUString const & rName ) @@ -132,7 +132,7 @@ private: ImpSvNumberformatInfo aI; // helper struct for remaining information OUString sColorName; // color name Color* pColor; // pointer to color of subformat - sal_uInt16 nAnzStrings; // count of symbols + sal_uInt16 nStringsCnt; // count of symbols SvNumberNatNum aNatNum; // DoubleByteNumber }; diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 7e19b6e26868..3c241585a547 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -108,7 +108,7 @@ void ImpSvNumberInputScan::Reset() nESign = 0; nDecPos = 0; nNegCheck = 0; - nAnzStrings = 0; + nStringsCnt = 0; nAnzNums = 0; nThousand = 0; eScannedType = css::util::NumberFormat::UNDEFINED; @@ -285,7 +285,7 @@ bool ImpSvNumberInputScan::NextNumberStringSymbol( const sal_Unicode*& pStr, } -// FIXME: should be grouping; it is only used though in case nAnzStrings is +// FIXME: should be grouping; it is only used though in case nStringsCnt is // near SV_MAX_ANZ_INPUT_STRINGS, in NumberStringDivision(). bool ImpSvNumberInputScan::SkipThousands( const sal_Unicode*& pStr, @@ -358,27 +358,27 @@ void ImpSvNumberInputScan::NumberStringDivision( const OUString& rString ) { const sal_Unicode* pStr = rString.getStr(); const sal_Unicode* const pEnd = pStr + rString.getLength(); - while ( pStr < pEnd && nAnzStrings < SV_MAX_ANZ_INPUT_STRINGS ) + while ( pStr < pEnd && nStringsCnt < SV_MAX_ANZ_INPUT_STRINGS ) { - if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) ) + if ( NextNumberStringSymbol( pStr, sStrArray[nStringsCnt] ) ) { // Number - IsNum[nAnzStrings] = true; - nNums[nAnzNums] = nAnzStrings; + IsNum[nStringsCnt] = true; + nNums[nAnzNums] = nStringsCnt; nAnzNums++; - if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 && + if (nStringsCnt >= SV_MAX_ANZ_INPUT_STRINGS - 7 && nPosThousandString == 0) // Only once { - if ( SkipThousands( pStr, sStrArray[nAnzStrings] ) ) + if ( SkipThousands( pStr, sStrArray[nStringsCnt] ) ) { - nPosThousandString = nAnzStrings; + nPosThousandString = nStringsCnt; } } } else { - IsNum[nAnzStrings] = false; + IsNum[nStringsCnt] = false; } - nAnzStrings++; + nStringsCnt++; } } @@ -543,7 +543,7 @@ inline bool ImpSvNumberInputScan::GetThousandSep( const OUString& rString, rString[0] == u' ' && rSep.getLength() == 1 && rString.getLength() == 1; if (!((rString == rSep || bSpaceBreak) && // nothing else - nStringPos < nAnzStrings - 1 && // safety first! + nStringPos < nStringsCnt - 1 && // safety first! IsNum[ nStringPos + 1 ] )) // number follows { return false; // no? => out @@ -878,7 +878,7 @@ short ImpSvNumberInputScan::GetESign( const OUString& rString, sal_Int32& nPos ) */ inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j ) { - if ( i < nAnzStrings && IsNum[i] ) + if ( i < nStringsCnt && IsNum[i] ) { j++; i++; @@ -1015,11 +1015,11 @@ bool ImpSvNumberInputScan::MayBeIso8601() if (nMayBeIso8601 == 0) { nMayBeIso8601 = 1; - sal_Int32 nLen = ((nAnzNums >= 1 && nNums[0] < nAnzStrings) ? sStrArray[nNums[0]].getLength() : 0); + sal_Int32 nLen = ((nAnzNums >= 1 && nNums[0] < nStringsCnt) ? sStrArray[nNums[0]].getLength() : 0); if (nLen) { sal_Int32 n; - if (nAnzNums >= 3 && nNums[2] < nAnzStrings && + if (nAnzNums >= 3 && nNums[2] < nStringsCnt && sStrArray[nNums[0]+1] == "-" && // separator year-month (n = sStrArray[nNums[1]].toInt32()) >= 1 && n <= 12 && // month sStrArray[nNums[1]+1] == "-" && // separator month-day @@ -1083,7 +1083,7 @@ bool ImpSvNumberInputScan::MayBeMonthDate() if (nMayBeMonthDate == 0) { nMayBeMonthDate = 1; - if (nAnzNums >= 2 && nNums[1] < nAnzStrings) + if (nAnzNums >= 2 && nNums[1] < nStringsCnt) { // "-Jan-" const OUString& rM = sStrArray[ nNums[ 0 ] + 1 ]; @@ -1171,7 +1171,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) bool bOk = true; const OUString& rPat = sDateAcceptancePatterns[nPattern]; sal_Int32 nPat = 0; - for ( ; nPat < rPat.getLength() && bOk && nNext < nAnzStrings; ++nPat, ++nNext) + for ( ; nPat < rPat.getLength() && bOk && nNext < nStringsCnt; ++nPat, ++nNext) { const sal_Unicode c = rPat[nPat]; switch (c) @@ -1253,7 +1253,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) if (bOk) { // Check for trailing characters mismatch. - if (nNext < nAnzStrings) + if (nNext < nStringsCnt) { // Pattern end but not input end. // A trailing blank may be part of the current pattern input, @@ -1322,13 +1322,13 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I { return false; } - if (nParticle < nDatePatternStart || nParticle >= nAnzStrings || IsNum[nParticle]) + if (nParticle < nDatePatternStart || nParticle >= nStringsCnt || IsNum[nParticle]) { return false; } sal_uInt16 nNext = nDatePatternStart; const OUString& rPat = sDateAcceptancePatterns[nAcceptedDatePattern]; - for (sal_Int32 nPat = 0; nPat < rPat.getLength() && nNext < nAnzStrings; ++nPat, ++nNext) + for (sal_Int32 nPat = 0; nPat < rPat.getLength() && nNext < nStringsCnt; ++nPat, ++nNext) { switch (rPat[nPat]) { @@ -2160,7 +2160,7 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString, { // Jan1 without separator is not a date, unless it is followed by a // separator and a (year) number. - if (nPos < rString.getLength() || (nAnzStrings >= 4 && nAnzNums >= 2)) + if (nPos < rString.getLength() || (nStringsCnt >= 4 && nAnzNums >= 2)) { eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date !!! nMonth = nTempMonth; @@ -2205,7 +2205,7 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString, { // Jan1 without separator is not a date, unless it is followed by a // separator and a (year) number. - if (nPos < rString.getLength() || (nAnzStrings >= 4 && nAnzNums >= 2)) + if (nPos < rString.getLength() || (nStringsCnt >= 4 && nAnzNums >= 2)) { nMonth = nTempMonth; nMonthPos = 1; // month a the beginning @@ -2556,8 +2556,8 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, { case '+': case '-': - if (nStringPos == nAnzStrings - 2 || - nStringPos == nAnzStrings - 4) + if (nStringPos == nStringsCnt - 2 || + nStringPos == nStringsCnt - 4) { ++nPos; // yyyy-mm-ddThh:mm[:ss]+xx[[:]yy] // nTimezonePos needed for GetTimeRef() @@ -2569,7 +2569,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, break; case ':': if (nTimezonePos && nStringPos >= 11 && - nStringPos == nAnzStrings - 2) + nStringPos == nStringsCnt - 2) { ++nPos; // yyyy-mm-ddThh:mm[:ss]+xx:yy } @@ -2632,7 +2632,7 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, { bool bSignedYear = false; if (bDecSepInDateSeps || // . also date separator - SkipDatePatternSeparator( nAnzStrings-1, nPos, bSignedYear)) + SkipDatePatternSeparator( nStringsCnt-1, nPos, bSignedYear)) { if ( eScannedType != css::util::NumberFormat::UNDEFINED && eScannedType != css::util::NumberFormat::DATE && @@ -2744,12 +2744,12 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, } if ( !nTimePos ) { - nTimePos = nAnzStrings; + nTimePos = nStringsCnt; } } bool bSignedYear = false; - bool bDate = SkipDatePatternSeparator( nAnzStrings-1, nPos, bSignedYear); // 12/31 31.12. 12/31/1999 31.12.1999 + bool bDate = SkipDatePatternSeparator( nStringsCnt-1, nPos, bSignedYear); // 12/31 31.12. 12/31/1999 31.12.1999 if (!bDate) { const OUString& rDate = pFormatter->GetDateSep(); @@ -3035,13 +3035,13 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / { Reset(); NumberStringDivision( rString ); // breakdown into strings and numbers - if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS) // too many elements + if (nStringsCnt >= SV_MAX_ANZ_INPUT_STRINGS) // too many elements { return false; // Njet, Nope, ... } if (nAnzNums == 0) // no number in input { - if ( nAnzStrings > 0 ) + if ( nStringsCnt > 0 ) { // Here we may change the original, we don't need it anymore. // This saves copies and ToUpper() in GetLogical() and is faster. @@ -3071,12 +3071,12 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / switch ( nAnzNums ) { case 1 : // Exactly 1 number in input - // nAnzStrings >= 1 + // nStringsCnt >= 1 if (GetNextNumber(i,j)) // i=1,0 { // Number at start if (eSetType == css::util::NumberFormat::FRACTION) // Fraction 1 = 1/1 { - if (i >= nAnzStrings || // no end string nor decimal separator + if (i >= nStringsCnt || // no end string nor decimal separator sStrArray[i] == pFormatter->GetNumDecimalSep()) { eScannedType = css::util::NumberFormat::FRACTION; @@ -3099,7 +3099,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / if (nSign && !nNegCheck && // Sign +, - eScannedType == css::util::NumberFormat::UNDEFINED && // not date or currency nDecPos == 0 && // no previous decimal separator - (i >= nAnzStrings || // no end string nor decimal separator + (i >= nStringsCnt || // no end string nor decimal separator sStrArray[i] == pFormatter->GetNumDecimalSep()) ) { @@ -3108,13 +3108,13 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / return true; } } - if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) + if (i < nStringsCnt && !ScanEndString( sStrArray[i], pFormat )) { return false; } break; case 2 : // Exactly 2 numbers in input - // nAnzStrings >= 3 + // nStringsCnt >= 3 if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) @@ -3128,7 +3128,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } i++; // next symbol, i=2,3 GetNextNumber(i,j); // i=3,4 - if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) + if (i < nStringsCnt && !ScanEndString( sStrArray[i], pFormat )) { return false; } @@ -3146,7 +3146,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } break; case 3 : // Exactly 3 numbers in input - // nAnzStrings >= 5 + // nStringsCnt >= 5 if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) @@ -3176,7 +3176,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } i++; // i=4,5 GetNextNumber(i,j); // i=5,6 - if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) + if (i < nStringsCnt && !ScanEndString( sStrArray[i], pFormat )) { return false; } @@ -3198,7 +3198,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } break; default: // More than 3 numbers in input - // nAnzStrings >= 7 + // nStringsCnt >= 7 if (!GetNextNumber(i,j)) // i=1,0 { // Analyze startstring if (!ScanStartString( sStrArray[i], pFormat )) @@ -3224,7 +3224,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / return false; } GetNextNumber(i,j); - if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) + if ( i < nStringsCnt && !ScanMidString( sStrArray[i], i, pFormat ) ) { return false; } @@ -3242,7 +3242,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / return false; } GetNextNumber(i,j); - if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) + if ( i < nStringsCnt && !ScanMidString( sStrArray[i], i, pFormat ) ) { return false; } @@ -3250,7 +3250,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } } GetNextNumber(i,j); - if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) + if (i < nStringsCnt && !ScanEndString( sStrArray[i], pFormat )) { return false; } @@ -3281,7 +3281,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / if ( nMatchedAllStrings ) { bool bMatch = pFormat && pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ); + nStringScanNumFor, nStringsCnt, nAnzNums ); if ( !bMatch ) { nMatchedAllStrings = 0; @@ -3318,7 +3318,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / if ( nMatchedAllStrings ) { bool bMatch = pFormat && pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ); + nStringScanNumFor, nStringsCnt, nAnzNums ); if ( !bMatch ) { nMatchedAllStrings = 0; diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index 9c4c50044816..4df9cd6ebe4b 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -90,12 +90,12 @@ private: Date* pNullDate; //* 30Dec1899 // Variables for provisional results: OUString sStrArray[SV_MAX_ANZ_INPUT_STRINGS]; //* Array of scanned 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, + 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 nStringsCnt; //* 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 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index d12c3624e610..1cdf9ddfa7aa 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -268,7 +268,7 @@ sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLan ImpSvNumFor::ImpSvNumFor() { - nAnzStrings = 0; + nStringsCnt = 0; aI.eScannedType = css::util::NumberFormat::UNDEFINED; aI.bThousand = false; aI.nThousand = 0; @@ -284,9 +284,9 @@ ImpSvNumFor::~ImpSvNumFor() void ImpSvNumFor::Enlarge(sal_uInt16 nAnz) { - if ( nAnzStrings != nAnz ) + if ( nStringsCnt != nAnz ) { - nAnzStrings = nAnz; + nStringsCnt = nAnz; aI.nTypeArray.resize(nAnz); aI.sStrArray.resize(nAnz); } @@ -294,8 +294,8 @@ void ImpSvNumFor::Enlarge(sal_uInt16 nAnz) void ImpSvNumFor::Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc ) { - Enlarge( rNumFor.nAnzStrings ); - aI.Copy( rNumFor.aI, nAnzStrings ); + Enlarge( rNumFor.nStringsCnt ); + aI.Copy( rNumFor.aI, nStringsCnt ); sColorName = rNumFor.sColorName; if ( pSc ) { @@ -310,7 +310,7 @@ void ImpSvNumFor::Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc ) bool ImpSvNumFor::HasNewCurrency() const { - for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) + for ( sal_uInt16 j=0; j<nStringsCnt; j++ ) { if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY ) { @@ -323,12 +323,12 @@ bool ImpSvNumFor::HasNewCurrency() const bool ImpSvNumFor::GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const { - for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) + for ( sal_uInt16 j=0; j<nStringsCnt; j++ ) { if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY ) { rSymbol = aI.sStrArray[j]; - if ( j < nAnzStrings-1 && aI.nTypeArray[j+1] == NF_SYMBOLTYPE_CURREXT ) + if ( j < nStringsCnt-1 && aI.nTypeArray[j+1] == NF_SYMBOLTYPE_CURREXT ) { rExtension = aI.sStrArray[j+1]; } diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5fe02e7f54c3..02e2b210bf4c 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -909,16 +909,16 @@ sal_Int32 ImpSvNumberformatScan::Symbol_Division(const OUString& rString) } } } - nAnzStrings = 0; + nStringsCnt = 0; bool bStar = false; // Is set on detecting '*' Reset(); sal_Int32 nPos = 0; const sal_Int32 nLen = rString.getLength(); - while (nPos < nLen && nAnzStrings < NF_MAX_FORMAT_SYMBOLS) + while (nPos < nLen && nStringsCnt < NF_MAX_FORMAT_SYMBOLS) { - nTypeArray[nAnzStrings] = Next_Symbol(rString, nPos, sStrArray[nAnzStrings]); - if (nTypeArray[nAnzStrings] == NF_SYMBOLTYPE_STAR) + nTypeArray[nStringsCnt] = Next_Symbol(rString, nPos, sStrArray[nStringsCnt]); + if (nTypeArray[nStringsCnt] == NF_SYMBOLTYPE_STAR) { // Monitoring the '*' if (bStar) { @@ -929,12 +929,12 @@ sal_Int32 ImpSvNumberformatScan::Symbol_Division(const OUString& rString) // Valid only if there is a character following, else we are // at the end of a code that does not have a fill character // (yet?). - if (sStrArray[nAnzStrings].getLength() < 2) + if (sStrArray[nStringsCnt].getLength() < 2) return nPos; bStar = true; } } - nAnzStrings++; + nStringsCnt++; } return 0; // 0 => ok @@ -942,7 +942,7 @@ sal_Int32 ImpSvNumberformatScan::Symbol_Division(const OUString& rString) void ImpSvNumberformatScan::SkipStrings(sal_uInt16& i, sal_Int32& nPos) { - while (i < nAnzStrings && ( nTypeArray[i] == NF_SYMBOLTYPE_STRING + while (i < nStringsCnt && ( nTypeArray[i] == NF_SYMBOLTYPE_STRING || nTypeArray[i] == NF_SYMBOLTYPE_BLANK || nTypeArray[i] == NF_SYMBOLTYPE_STAR) ) { @@ -954,7 +954,7 @@ void ImpSvNumberformatScan::SkipStrings(sal_uInt16& i, sal_Int32& nPos) sal_uInt16 ImpSvNumberformatScan::PreviousKeyword(sal_uInt16 i) { short res = 0; - if (i > 0 && i < nAnzStrings) + if (i > 0 && i < nStringsCnt) { i--; while (i > 0 && nTypeArray[i] <= 0) @@ -972,10 +972,10 @@ sal_uInt16 ImpSvNumberformatScan::PreviousKeyword(sal_uInt16 i) sal_uInt16 ImpSvNumberformatScan::NextKeyword(sal_uInt16 i) { short res = 0; - if (i < nAnzStrings-1) + if (i < nStringsCnt-1) { i++; - while (i < nAnzStrings-1 && nTypeArray[i] <= 0) + while (i < nStringsCnt-1 && nTypeArray[i] <= 0) { i++; } @@ -989,7 +989,7 @@ sal_uInt16 ImpSvNumberformatScan::NextKeyword(sal_uInt16 i) short ImpSvNumberformatScan::PreviousType( sal_uInt16 i ) { - if ( i > 0 && i < nAnzStrings ) + if ( i > 0 && i < nStringsCnt ) { do { @@ -1004,7 +1004,7 @@ short ImpSvNumberformatScan::PreviousType( sal_uInt16 i ) sal_Unicode ImpSvNumberformatScan::PreviousChar(sal_uInt16 i) { sal_Unicode res = ' '; - if (i > 0 && i < nAnzStrings) + if (i > 0 && i < nStringsCnt) { i--; while (i > 0 && @@ -1026,10 +1026,10 @@ sal_Unicode ImpSvNumberformatScan::PreviousChar(sal_uInt16 i) sal_Unicode ImpSvNumberformatScan::NextChar(sal_uInt16 i) { sal_Unicode res = ' '; - if (i < nAnzStrings-1) + if (i < nStringsCnt-1) { i++; - while (i < nAnzStrings-1 && + while (i < nStringsCnt-1 && ( nTypeArray[i] == NF_SYMBOLTYPE_EMPTY || nTypeArray[i] == NF_SYMBOLTYPE_STRING || nTypeArray[i] == NF_SYMBOLTYPE_STAR || @@ -1048,11 +1048,11 @@ sal_Unicode ImpSvNumberformatScan::NextChar(sal_uInt16 i) bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i) { bool res = true; - if (i < nAnzStrings-1) + if (i < nStringsCnt-1) { bool bStop = false; i++; - while (i < nAnzStrings-1 && !bStop) + while (i < nStringsCnt-1 && !bStop) { i++; if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && @@ -1081,7 +1081,7 @@ bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i) void ImpSvNumberformatScan::Reset() { - nAnzStrings = 0; + nStringsCnt = 0; nAnzResStrings = 0; eScannedType = css::util::NumberFormat::UNDEFINED; bExp = false; @@ -1121,7 +1121,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() bool bHaveMinute = false; SkipStrings(i, nPos); - while (i < nAnzStrings) + while (i < nStringsCnt) { if (nTypeArray[i] > 0) { // keyword @@ -1252,14 +1252,14 @@ sal_Int32 ImpSvNumberformatScan::ScanType() eNewType = css::util::NumberFormat::FRACTION; break; case '[': - if ( i < nAnzStrings-1 && + if ( i < nStringsCnt-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '$' ) { eNewType = css::util::NumberFormat::CURRENCY; bMatchBracket = true; } - else if ( i < nAnzStrings-1 && + else if ( i < nStringsCnt-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '~' ) { @@ -1423,7 +1423,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() i++; if ( bMatchBracket ) { // no type detection inside of matching brackets if [$...], [~...] - while ( bMatchBracket && i < nAnzStrings ) + while ( bMatchBracket && i < nStringsCnt ) { if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i][0] == ']' ) @@ -1460,7 +1460,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const OUString& rStr ) { - if (nAnzStrings >= NF_MAX_FORMAT_SYMBOLS || nPos > nAnzStrings) + if (nStringsCnt >= NF_MAX_FORMAT_SYMBOLS || nPos > nStringsCnt) { return false; } @@ -1470,12 +1470,12 @@ bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType e } else { - if ((size_t) (nAnzStrings + 1) >= NF_MAX_FORMAT_SYMBOLS) + if ((size_t) (nStringsCnt + 1) >= NF_MAX_FORMAT_SYMBOLS) { return false; } - ++nAnzStrings; - for (size_t i = nAnzStrings; i > nPos; --i) + ++nStringsCnt; + for (size_t i = nStringsCnt; i > nPos; --i) { nTypeArray[i] = nTypeArray[i-1]; sStrArray[i] = sStrArray[i-1]; @@ -1490,7 +1490,7 @@ bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType e int ImpSvNumberformatScan::FinalScanGetCalendar( sal_Int32& nPos, sal_uInt16& i, sal_uInt16& rAnzResStrings ) { - if ( i < nAnzStrings-1 && + if ( i < nStringsCnt-1 && sStrArray[i][0] == '[' && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '~' ) @@ -1502,7 +1502,7 @@ int ImpSvNumberformatScan::FinalScanGetCalendar( sal_Int32& nPos, sal_uInt16& i, sStrArray[i-1] += sStrArray[i]; // [~ nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; rAnzResStrings--; - if ( ++i >= nAnzStrings ) + if ( ++i >= nStringsCnt ) { return -1; // error } @@ -1510,7 +1510,7 @@ int ImpSvNumberformatScan::FinalScanGetCalendar( sal_Int32& nPos, sal_uInt16& i, OUString& rStr = sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_CALENDAR; // convert i++; - while ( i < nAnzStrings && sStrArray[i][0] != ']' ) + while ( i < nStringsCnt && sStrArray[i][0] != ']' ) { nPos = nPos + sStrArray[i].getLength(); rStr += sStrArray[i]; @@ -1518,7 +1518,7 @@ int ImpSvNumberformatScan::FinalScanGetCalendar( sal_Int32& nPos, sal_uInt16& i, rAnzResStrings--; i++; } - if ( rStr.getLength() && i < nAnzStrings && + if ( rStr.getLength() && i < nStringsCnt && sStrArray[i][0] == ']' ) { nTypeArray[i] = NF_SYMBOLTYPE_CALDEL; @@ -1590,7 +1590,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sal_Int32 nPos = 0; // error correction position sal_uInt16 i = 0; // symbol loop counter sal_uInt16 nCounter = 0; // counts digits - nAnzResStrings = nAnzStrings; // counts remaining symbols + nAnzResStrings = nStringsCnt; // counts remaining symbols bDecSep = false; // reset in case already used in TypeCheck bool bThaiT = false; // Thai T NatNum modifier present bool bTimePart = false; @@ -1600,7 +1600,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { case css::util::NumberFormat::TEXT: case css::util::NumberFormat::DEFINED: - while (i < nAnzStrings) + while (i < nStringsCnt) { switch (nTypeArray[i]) { @@ -1627,7 +1627,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) case css::util::NumberFormat::CURRENCY: case css::util::NumberFormat::SCIENTIFIC: case css::util::NumberFormat::FRACTION: - while (i < nAnzStrings) + while (i < nStringsCnt) { // TODO: rechecking eScannedType is unnecessary. // This switch-case is for eScannedType == css::util::NumberFormat::FRACTION anyway @@ -1713,7 +1713,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { OUString sDiv; sal_uInt16 j = i; - while(j < nAnzStrings && sStrArray[j][0] >= '0' && sStrArray[j][0] <= '9') + while(j < nStringsCnt && sStrArray[j][0] >= '0' && sStrArray[j][0] <= '9') { sDiv += sStrArray[j++]; } @@ -1788,7 +1788,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nPos = nPos + rStr.getLength(); i++; nCounter++; - while (i < nAnzStrings && + while (i < nStringsCnt && (sStrArray[i][0] == '#' || sStrArray[i][0] == '0' || sStrArray[i][0] == '?')) @@ -1814,7 +1814,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nPos = nPos + rStr.getLength(); i++; nCounter++; - while (i < nAnzStrings && + while (i < nStringsCnt && (sStrArray[i][0] == '-') ) { // If more than two dashes are present in @@ -1823,7 +1823,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) // Has to be this ugly. Period. if ( eScannedType == css::util::NumberFormat::CURRENCY && rStr.getLength() >= 2 && - (i == nAnzStrings-1 || + (i == nStringsCnt-1 || sStrArray[i+1][0] != '-') ) { break; @@ -1869,7 +1869,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) bDenomin = true; // end of denominator } } - else if (i > 0 && i < nAnzStrings-1 && + else if (i > 0 && i < nStringsCnt-1 && (cPre == '#' || cPre == '0') && ((cNext = NextChar(i)) == '#' || cNext == '0')) // #,# { @@ -1893,7 +1893,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) bool bFirst = true; // set a hard No-Break Space or ConvertMode const OUString& rSepF = pFormatter->GetNumThousandSep(); - while ( i < nAnzStrings && + while ( i < nStringsCnt && sStrArray[i] == sOldThousandSep && StringEqualsChar( sOldThousandSep, NextChar(i) ) ) { // last was a space or another space @@ -1914,7 +1914,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nThousand++; i++; } - if ( i < nAnzStrings-1 && + if ( i < nStringsCnt-1 && sStrArray[i] == sOldThousandSep ) { // something following last space @@ -1924,7 +1924,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) if ( (nPos <= nCurrPos && nCurrPos < nPos + sStrArray[i+1].getLength()) || nTypeArray[i+1] == NF_KEY_CCC || - (i < nAnzStrings-2 && + (i < nStringsCnt-2 && sStrArray[i+1][0] == '[' && sStrArray[i+2][0] == '$') ) { @@ -1958,7 +1958,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sStrArray[i] = pFormatter->GetNumThousandSep(); i++; } - while (i < nAnzStrings && sStrArray[i] == sOldThousandSep); + while (i < nStringsCnt && sStrArray[i] == sOldThousandSep); } } else // any grsep @@ -1966,7 +1966,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + rStr.getLength(); i++; - while ( i < nAnzStrings && sStrArray[i] == sOldThousandSep ) + while ( i < nStringsCnt && sStrArray[i] == sOldThousandSep ) { rStr += sStrArray[i]; nPos = nPos + sStrArray[i].getLength(); @@ -1994,7 +1994,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + rStr.getLength(); i++; - while ( i < nAnzStrings && sStrArray[i] == sOldDecSep ) + while ( i < nStringsCnt && sStrArray[i] == sOldDecSep ) { rStr += sStrArray[i]; nPos = nPos + sStrArray[i].getLength(); @@ -2045,7 +2045,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) bDenomin = true; // next content is not part of denominator nPos = nPos + rStr.getLength(); i++; - while (i < nAnzStrings && StringEqualsChar( sStrArray[i], cSaved ) ) + while (i < nStringsCnt && StringEqualsChar( sStrArray[i], cSaved ) ) { rStr += sStrArray[i]; nPos = nPos + sStrArray[i].getLength(); @@ -2088,7 +2088,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) break; case '[' : if ( eScannedType == css::util::NumberFormat::CURRENCY && - i < nAnzStrings-1 && + i < nStringsCnt-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '$' ) { @@ -2099,7 +2099,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sStrArray[i-1] += sStrArray[i]; // [$ nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; nAnzResStrings--; - if ( ++i >= nAnzStrings ) + if ( ++i >= nStringsCnt ) { return nPos; // Error } @@ -2108,7 +2108,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nTypeArray[i] = NF_SYMBOLTYPE_CURRENCY; // convert bool bHadDash = false; i++; - while ( i < nAnzStrings && sStrArray[i][0] != ']' ) + while ( i < nStringsCnt && sStrArray[i][0] != ']' ) { nPos = nPos + sStrArray[i].getLength(); if ( bHadDash ) @@ -2134,7 +2134,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } i++; } - if ( rStr.getLength() && i < nAnzStrings && sStrArray[i][0] == ']' ) + if ( rStr.getLength() && i < nStringsCnt && sStrArray[i][0] == ']' ) { nTypeArray[i] = NF_SYMBOLTYPE_CURRDEL; nPos = nPos + sStrArray[i].getLength(); @@ -2267,12 +2267,12 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } // Combine digits into groups to save memory (Info will be copied // later, taking only non-empty symbols). - for (i = 0; i < nAnzStrings; ++i) + for (i = 0; i < nStringsCnt; ++i) { if (nTypeArray[i] == NF_SYMBOLTYPE_DIGIT) { OUString& rStr = sStrArray[i]; - while (++i < nAnzStrings && nTypeArray[i] == NF_SYMBOLTYPE_DIGIT) + while (++i < nStringsCnt && nTypeArray[i] == NF_SYMBOLTYPE_DIGIT) { rStr += sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; @@ -2282,7 +2282,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } break; // of css::util::NumberFormat::NUMBER case css::util::NumberFormat::DATE: - while (i < nAnzStrings) + while (i < nStringsCnt) { switch (nTypeArray[i]) { @@ -2391,7 +2391,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } // of while break; // of css::util::NumberFormat::DATE case css::util::NumberFormat::TIME: - while (i < nAnzStrings) + while (i < nStringsCnt) { sal_Unicode cChar; @@ -2412,11 +2412,11 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; OUString& rStr = sStrArray[i]; i++; - if (i < nAnzStrings) + if (i < nStringsCnt) { nPos = nPos + sStrArray[i].getLength(); nCounter++; - while (i < nAnzStrings && + while (i < nStringsCnt && sStrArray[i][0] == '0') { rStr += sStrArray[i]; @@ -2535,7 +2535,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } break; // of css::util::NumberFormat::TIME case css::util::NumberFormat::DATETIME: - while (i < nAnzStrings) + while (i < nStringsCnt) { int nCalRet; switch (nTypeArray[i]) @@ -2567,7 +2567,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) i++; nPos = nPos + sStrArray[i].getLength(); nCounter++; - while (i < nAnzStrings && + while (i < nStringsCnt && sStrArray[i][0] == '0') { rStr += sStrArray[i]; @@ -2854,7 +2854,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } // strings containing keywords of the target locale must be quoted, so // the user sees the difference and is able to edit the format string - for ( i=0; i < nAnzStrings; i++ ) + for ( i=0; i < nStringsCnt; i++ ) { if ( nTypeArray[i] == NF_SYMBOLTYPE_STRING && sStrArray[i][0] != '\"' ) @@ -2874,7 +2874,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) OUString aTmp( sStrArray[i] ); sal_uInt16 j = i + 1; while ( aTmp.getLength() < sOldCurSymbol.getLength() && - j < nAnzStrings && + j < nStringsCnt && nTypeArray[j] == NF_SYMBOLTYPE_STRING ) { aTmp += sStrArray[j++]; @@ -2908,7 +2908,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) // Concatenate strings, remove quotes for output, and rebuild the format string rString.clear(); i = 0; - while (i < nAnzStrings) + while (i < nStringsCnt) { sal_Int32 nStringPos; sal_Int32 nArrPos = 0; @@ -3017,9 +3017,9 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } i++; } - while ( i < nAnzStrings && nTypeArray[i] == NF_SYMBOLTYPE_STRING ); + while ( i < nStringsCnt && nTypeArray[i] == NF_SYMBOLTYPE_STRING ); - if ( i < nAnzStrings ) + if ( i < nStringsCnt ) { i--; // enter switch on next symbol again } diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 5aaee72f870f..51998e7d65dd 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -167,7 +167,7 @@ private: // Private section sal_uInt16 nCntPost; // Counts digits of fractional part sal_uInt16 nCntExp; // Counts exponent digits AM/PM // Internal info: - sal_uInt16 nAnzStrings; // Symbol count + sal_uInt16 nStringsCnt; // Symbol count sal_uInt16 nExpPos; // Internal position of E sal_uInt16 nBlankPos; // Internal position of the Blank short nDecPos; // Internal position of the , diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 62bd24fef2c2..ce1e3df8572c 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -398,8 +398,8 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> const & xPropSet) OUString sSelected; uno::Sequence<OUString> aListItems; xPropSet->getPropertyValue("StringItemList") >>= aListItems; - sal_Int32 nNoStrings = aListItems.getLength(); - if (nNoStrings) + sal_Int32 nStringsCnt = aListItems.getLength(); + if (nStringsCnt) { uno::Any aTmp = xPropSet->getPropertyValue("DefaultText"); auto pStr = o3tl::tryAccess<OUString>(aTmp); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 1c8c3ab7cd60..1fa133247822 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2201,13 +2201,13 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich, // SSTB (see Spec. 2.2.4) sal_uInt16 fExtend = 0; pDataStream->ReadUInt16( fExtend ); - sal_uInt16 nNoStrings = 0; + sal_uInt16 nStringsCnt = 0; // Isn't it that if fExtend isn't 0xFFFF then fExtend actually - // doesn't exist and we really have just read nNoStrings ( or cData )? + // doesn't exist and we really have just read nStringsCnt ( or cData )? if (fExtend != 0xFFFF) bAllOk = false; - pDataStream->ReadUInt16( nNoStrings ); + pDataStream->ReadUInt16( nStringsCnt ); // I guess this should be zero ( and we should ensure that ) sal_uInt16 cbExtra = 0; @@ -2215,17 +2215,17 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich, OSL_ENSURE(bAllOk, "Unknown formfield dropdown list structure"); if (!bAllOk) //Not as expected, don't risk it at all. - nNoStrings = 0; + nStringsCnt = 0; const size_t nMinRecordSize = sizeof(sal_uInt16); const size_t nMaxRecords = pDataStream->remainingSize() / nMinRecordSize; - if (nNoStrings > nMaxRecords) + if (nStringsCnt > nMaxRecords) { SAL_WARN("sw.ww8", "Parsing error: " << nMaxRecords << - " max possible entries, but " << nNoStrings << " claimed, truncating"); - nNoStrings = nMaxRecords; + " max possible entries, but " << nStringsCnt << " claimed, truncating"); + nStringsCnt = nMaxRecords; } - maListEntries.reserve(nNoStrings); - for (sal_uInt32 nI = 0; nI < nNoStrings; ++nI) + maListEntries.reserve(nStringsCnt); + for (sal_uInt32 nI = 0; nI < nStringsCnt; ++nI) { OUString sEntry = read_uInt16_PascalString(*pDataStream); maListEntries.push_back(sEntry); |