diff options
-rw-r--r-- | svl/source/numbers/zformat.cxx | 3 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 4bd1a9e8349e..2d1f8749a0ca 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2212,7 +2212,8 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC ) { - for( i++; i < nAnz; i++ ) + while ( ( ++i < nAnz ) && rInfo.nTypeArray[i] == NF_SYMBOLTYPE_STRING ); + for( ; i < nAnz; i++ ) { if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV || rInfo.nTypeArray[i] == NF_SYMBOLTYPE_DIGIT ) aDenominatorString.append( rInfo.sStrArray[i] ); diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5644c2b0e911..788cd42e194f 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1670,7 +1670,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else if ( sStrArray[i][0] == ' ' ) nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; - else if ( bFrac ) + else if ( bFrac && ( nCounter > 0 ) ) bDenomin = true; // following elements are no more part of denominator } else if (nTypeArray[i] == NF_KEY_THAI_T) @@ -1714,7 +1714,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } else { - if ( bFrac ) + if ( bFrac && ( nCounter > 0 ) ) bDenomin = true; // next content should be treated as outside denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; } @@ -1834,7 +1834,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; - if ( bFrac ) + if ( bFrac && (nCounter > 0) ) bDenomin = true; // end of denominator } } @@ -2002,7 +2002,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCntPre = nCounter; nCounter = 0; } - if ( bFrac ) + if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].getLength(); @@ -2010,7 +2010,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else { nTypeArray[i] = NF_SYMBOLTYPE_STRING; - if ( bFrac ) + if ( bFrac && (nCounter > 0) ) bDenomin = true; // next content is not part of denominator nPos = nPos + rStr.getLength(); i++; |