summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2017-02-16 22:15:37 +0100
committerEike Rathke <erack@redhat.com>2017-02-21 12:31:50 +0000
commite7f769bc67d3f132b477b3c253f8065243b9b8ac (patch)
treeb86d8c82e96c0c8cae0319d9ed4f167a8d9a7ba2 /svl
parent291c9122b23ce7aa619e828b895b08dcd21bf025 (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>
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 2ddd6424918f..b4621bca5b9f 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1980,6 +1980,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 );