diff options
author | Noel Power <noel.power@suse.com> | 2012-11-13 16:15:06 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-11-14 11:53:13 +0000 |
commit | b25a6c815beb5c9bb7f3205b4841186fbd0b425c (patch) | |
tree | 3de61f835ad7413ae7116b0e966baf230b9abda3 /svl | |
parent | c2aa763bd762d161eca9c07f1f31885d6bc751f6 (diff) |
save fixed denominator for fractions fdo#56419
Change-Id: I612ff2340b272661067cb6a54106e91443fec91e
Reviewed-on: https://gerrit.libreoffice.org/1056
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/zformat.hxx | 1 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 03c2661b523a..e28a2ba7e21e 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -298,6 +298,7 @@ public: // bString==true: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, bool bString = false ) const; + sal_Int32 GetForcedDenominatorForType( sal_uInt16 nNumFor ) const; /** If the count of string elements (substrings, ignoring [modifiers] and so on) in a subformat code nNumFor (0..3) is equal to the given number. Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 5efeb3efd8fa..fa39283999e4 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2139,7 +2139,7 @@ void lcl_GetOutputStringScientific( fNumber, rtl_math_StringFormat_E, nPrec, rFormatter.GetNumDecimalSep().GetChar(0)); } -sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz) +sal_Int32 lcl_GetForcedDenominator(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz) { sal_uInt16 i; rtl::OUString aDiv; @@ -2168,6 +2168,13 @@ void lcl_ForcedDenominator(sal_uLong &nFrac, sal_uLong &nDiv, sal_uLong nForcedD } +sal_Int32 SvNumberformat::GetForcedDenominatorForType( sal_uInt16 nNumFor ) const +{ + const ImpSvNumberformatInfo& rInfo = NumFor[nNumFor].Info(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); + return lcl_GetForcedDenominator( rInfo, nAnz ); +} + bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, String& rOutString) const { using namespace std; |