summaryrefslogtreecommitdiff
path: root/include/svl/zformat.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-05-29 23:40:44 +0200
committerEike Rathke <erack@redhat.com>2018-05-30 16:24:45 +0200
commit2e0c3c88865b64b04b6160f9f5955a3a9548d48c (patch)
treee3a5723390f6fc429bfcb75e36d15381d6c4a8e8 /include/svl/zformat.hxx
parent37a462747af2abe6bde371607a965011534cab81 (diff)
Resolves: tdf#117819 append trailing '0' as needed before separator insertion
To insert separators, literal strings between digits and other, the formatter operates backwards on the string obtained from doubleToUString() cleaned of the decimal separator. The number of decimals returned by doubleToUString() may be less than the decimals of the number format as entered by the user, which lead to separators inserted at wrong positions. This wrong behavior was triggered respectively made more obvious by commit 0f6203edf74832f84d8263d7a544d679203a4efc CommitDate: Wed Jan 13 14:47:57 2016 +0100 tdf#96918 display accurate integer double values up to (2^53)-1 which for integer values returns at most 15 decimals ('0' in this case). Before operating on the decimals' part ensure that the number of decimals matches the digits requested, and if shorter append trailing '0' characters for the required amount so the separators (and other strings) are inserted at the correct positions. Change-Id: Ic02652699ea7d6fae3b2b3348f6f7d183319e043 Reviewed-on: https://gerrit.libreoffice.org/55039 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 8b43f58891d4b422a8934050d839b0c2c1e3a18a) Reviewed-on: https://gerrit.libreoffice.org/55060 Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/svl/zformat.hxx')
-rw-r--r--include/svl/zformat.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 9077e45d92ff..2ef1b4ac034f 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -628,6 +628,7 @@ private:
SVL_DLLPRIVATE bool ImpDecimalFill( OUStringBuffer& sStr,
double& rNumber,
+ sal_Int32 nDecPos,
sal_uInt16 j,
sal_uInt16 nIx,
bool bInteger );