diff options
author | Noel Power <noel.power@suse.com> | 2012-11-13 16:15:06 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-11-13 16:24:17 +0000 |
commit | 4be8c3205afd55fa7e1f578384d3c91ebd8b5ec3 (patch) | |
tree | d2d868dd02fad59066f19ac77ebf6b2cc883a10e /svl | |
parent | f3d2d9aaaf72291a5733b5ba0edd1c7b75e4f345 (diff) |
save fixed denominator for fractions fdo#56419
Change-Id: I612ff2340b272661067cb6a54106e91443fec91e
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 8687ae9db8ea..ea15bcf9d4a8 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -289,6 +289,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 8846707ea0f8..bdb75eab2039 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2125,7 +2125,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; @@ -2154,6 +2154,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; |