diff options
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index f3321da6629b..9d5de1c8b89f 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4707,10 +4707,12 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, case NF_SYMBOLTYPE_TIME100SECSEP : aStr.append( rLocWrp.getTime100SecSep() ); break; + case NF_SYMBOLTYPE_FRACBLANK : case NF_SYMBOLTYPE_STRING : if ( pStr[j].getLength() == 1 ) { - aStr.append( '\\' ); + if ( pType[j] == NF_SYMBOLTYPE_STRING ) + aStr.append( '\\' ); aStr.append( pStr[j] ); } else diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 1e4ba4775101..bc436431a820 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1651,7 +1651,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nTypeArray[i] = NF_SYMBOLTYPE_EXP; } else if (eScannedType == css::util::NumberFormat::FRACTION && - sStrArray[i][0] == ' ') + (sStrArray[i][0] == ' ' || ( nTypeArray[i] == NF_SYMBOLTYPE_STRING && (sStrArray[i][0] < '0' || sStrArray[i][0] > '9') ) ) ) { if (!bBlank && !bFrac) // Not double or after a / { @@ -1659,12 +1659,17 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { return nPos; // Error } - bBlank = true; - nBlankPos = i; - nCntPre = nCounter; - nCounter = 0; + if (sStrArray[i][0] == ' ' || nCounter > 0 ) // treat string as integer/fraction delimiter only if there is integer + { + bBlank = true; + nBlankPos = i; + nCntPre = nCounter; + nCounter = 0; + nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; + } } - nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; + else if ( sStrArray[i][0] == ' ' ) + nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK; } else if (nTypeArray[i] == NF_KEY_THAI_T) { @@ -2691,6 +2696,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) switch ( nTypeArray[i] ) { case NF_SYMBOLTYPE_STRING : + case NF_SYMBOLTYPE_FRACBLANK : nStringPos = rString.getLength(); do { |