diff options
author | Eike Rathke <erack@redhat.com> | 2018-06-08 23:44:13 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-06-11 13:05:22 +0200 |
commit | 807d4382cb021d2ac3ea99d6757a7b368a32941d (patch) | |
tree | 0b1924a4168bc5861b72ab6116e9f705e6a7c61b /svl | |
parent | bada992cb0ff3fbd9a3e2c5ff2c5d2cc59fa888b (diff) |
Derive NativeNumberXmlAttributes2 from NativeNumberXmlAttributes, tdf#115007 follow-up
Also ensure that transliteration-spellout and
(transliteration-format,transliteration-style) are mutually
exclusive and transliteration-spellout is only written if ODF
version is >1.2, namespace 'loext' for 1.2 with extensions and
namespace 'number' in anticipation of ODF 1.3 (may need to be
adapted).
Change-Id: I371dee8883ecb0d4638510c92b4bf59acd09f636
Reviewed-on: https://gerrit.libreoffice.org/55491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index df789e59ab37..1bc63e4ecfec 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -5392,8 +5392,7 @@ void SvNumberformat::impTransliterateImpl(OUStringBuffer& rStr, rStr.append(sTemp); } -void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes& rAttr, - css::i18n::NativeNumberXmlAttributes2& rAttr2, +void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes2& rAttr, sal_uInt16 nNumFor ) const { if ( nNumFor <= 3 ) @@ -5404,23 +5403,37 @@ void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes& rAttr, css::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() ); + /* TODO: a new XNativeNumberSupplier2::convertToXmlAttributes() + * should rather return NativeNumberXmlAttributes2 and places + * adapted, and whether to fill Spellout or something different + * should be internal there. */ + css::i18n::NativeNumberXmlAttributes aTmp( + GetFormatter().GetNatNum()->convertToXmlAttributes( + aLocale, rNum.GetNatNum())); + rAttr.Locale = aTmp.Locale; + rAttr.Format = aTmp.Format; + rAttr.Style = aTmp.Style; if ( NatNumTakesParameters(rNum.GetNatNum()) ) { // NatNum12 spell out numbers, dates and money amounts - rAttr2 = css::i18n::NativeNumberXmlAttributes2(aLocale, rNum.GetParams()); - } else { - rAttr = GetFormatter().GetNatNum()->convertToXmlAttributes( - aLocale, rNum.GetNatNum() ); + rAttr.Spellout = rNum.GetParams(); + // Mutually exclusive. + rAttr.Format.clear(); + rAttr.Style.clear(); + } + else + { + rAttr.Spellout.clear(); } } else { - rAttr = css::i18n::NativeNumberXmlAttributes(); + rAttr = css::i18n::NativeNumberXmlAttributes2(); } } else { - rAttr = css::i18n::NativeNumberXmlAttributes(); + rAttr = css::i18n::NativeNumberXmlAttributes2(); } } |