diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2016-07-10 19:37:52 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-15 19:59:25 +0000 |
commit | b719a57d5ff2a88dba6234a7064aca6ad5a44089 (patch) | |
tree | 072c8f6bc1a0396c6e9ce0b08e4928101e52c132 /svl/source/numbers/zforscan.cxx | |
parent | d32dab699f6584a13eb10fc1eb2801423ef52fb2 (diff) |
tdf#100834 Treat string between integer and fraction as delimiter
In fraction number format, strings located between integer and fraction
should be treated as blank delimiter
Change-Id: I83e78fb0fe08178ee194fc2a213ee260ce15c639
Reviewed-on: https://gerrit.libreoffice.org/27128
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl/source/numbers/zforscan.cxx')
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
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 { |