summaryrefslogtreecommitdiff
path: root/include/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 /include/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 'include/svl')
-rw-r--r--include/svl/zforlist.hxx3
-rw-r--r--include/svl/zformat.hxx3
2 files changed, 5 insertions, 1 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index fdc00627d051..81c57d732cb4 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -516,6 +516,9 @@ public:
/// Count of decimals
sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const;
+ /// Count of decimals with correct subformat according to fValue
+ sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat, double fValue ) const;
+
/// Count of integer digits
sal_uInt16 GetFormatIntegerDigits( sal_uInt32 nFormat ) const;
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index a50281b536ac..cfb3e3a97368 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -219,7 +219,8 @@ public:
sal_uInt16 GetSubformatIndex( double fNumber ) const;
/// Count of decimal precision
- sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; }
+ sal_uInt16 GetFormatPrecision( sal_uInt16 nIx = 0 ) const
+ { return NumFor[nIx].Info().nCntPost; }
/// Count of integer digits
sal_uInt16 GetFormatIntegerDigits() const { return NumFor[0].Info().nCntPre; }