summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2017-02-16 22:15:37 +0100
committerAndras Timar <andras.timar@collabora.com>2017-04-12 17:16:55 +0200
commit9eff3bd00c9463ebe4e1520242c88691d57b5aee (patch)
tree55b5b345b0f8bec0f4f97bb563128214baa43780 /svl
parentc2c92cb5dc0b3bb625f3e8867c4b90633e9a9211 (diff)
tdf#106052 Treat SubFormat for "Precision as shown"
Get precision from the correct subformat Change-Id: I458e5b3d1fb515864f19499ac9ac529e1d68a267 Reviewed-on: https://gerrit.libreoffice.org/34505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit e7f769bc67d3f132b477b3c253f8065243b9b8ac) Reviewed-on: https://gerrit.libreoffice.org/36367 (cherry picked from commit 09478b2211bbc9ec34d8de8452e30cf1254a250c)
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 659e1b5b340d..108babe2da50 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1981,6 +1981,18 @@ sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const
return pFormatScanner->GetStandardPrec();
}
+sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat, double fValue ) const
+{
+ const SvNumberformat* pFormat = GetFormatEntry( nFormat );
+ if ( pFormat )
+ {
+ sal_uInt16 nIx = pFormat->GetSubformatIndex( fValue );
+ return pFormat->GetFormatPrecision( nIx );
+ }
+ else
+ return pFormatScanner->GetStandardPrec();
+}
+
sal_uInt16 SvNumberFormatter::GetFormatIntegerDigits( sal_uInt32 nFormat ) const
{
const SvNumberformat* pFormat = GetFormatEntry( nFormat );