summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-06-08 23:44:13 +0200
committerEike Rathke <erack@redhat.com>2018-06-11 22:59:32 +0200
commite2a39848fa11dfc082ca9142266cbfe8adb586f2 (patch)
tree6b0e8e8bdf713c3ece0aa766689b7b8f773471c7 /svl
parentecad621f6889e8af23baa4faee62d10f580ec074 (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> (cherry picked from commit 807d4382cb021d2ac3ea99d6757a7b368a32941d) Reviewed-on: https://gerrit.libreoffice.org/55626 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 02ac08c7dfc5..e24ef037f7ba 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();
}
}