From 4f2604655a0f354024f7cc9936b229a387aaf3ab Mon Sep 17 00:00:00 2001 From: Shane Carr Date: Fri, 14 Sep 2018 19:03:01 -0700 Subject: [PATCH] ICU-11276 Replying to Mark review feedback. --- icu4c/source/i18n/number_modifiers.h | 8 ++------ icu4c/source/i18n/numrange_impl.cpp | 2 +- .../src/com/ibm/icu/number/NumberRangeFormatterImpl.java | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/icu4c/source/i18n/number_modifiers.h b/icu4c/source/i18n/number_modifiers.h index 9cc74b37974..65ada937d03 100644 --- a/icu4c/source/i18n/number_modifiers.h +++ b/icu4c/source/i18n/number_modifiers.h @@ -18,12 +18,6 @@ U_NAMESPACE_BEGIN namespace number { namespace impl { -class ReferencingPluralsModifierStore : public ModifierStore { - public: - virtual const Modifier* getModifier(int8_t signum, StandardPlural::Form plural) const; - const Modifier* mods[StandardPlural::COUNT] = {}; -}; - /** * The canonical implementation of {@link Modifier}, containing a prefix and suffix string. * TODO: This is not currently being used by real code and could be removed. @@ -296,6 +290,7 @@ class U_I18N_API AdoptingModifierStore : public ModifierStore, public UMemory { * Sets the Modifier with the specified signum and plural form. */ void adoptModifier(int8_t signum, StandardPlural::Form plural, const Modifier *mod) { + U_ASSERT(mods[getModIndex(signum, plural)] == nullptr); mods[getModIndex(signum, plural)] = mod; } @@ -304,6 +299,7 @@ class U_I18N_API AdoptingModifierStore : public ModifierStore, public UMemory { * The modifier will apply to all plural forms. */ void adoptModifierWithoutPlural(int8_t signum, const Modifier *mod) { + U_ASSERT(mods[getModIndex(signum, DEFAULT_STANDARD_PLURAL)] == nullptr); mods[getModIndex(signum, DEFAULT_STANDARD_PLURAL)] = mod; } diff --git a/icu4c/source/i18n/numrange_impl.cpp b/icu4c/source/i18n/numrange_impl.cpp index b240c3140d6..096609bfd41 100644 --- a/icu4c/source/i18n/numrange_impl.cpp +++ b/icu4c/source/i18n/numrange_impl.cpp @@ -74,7 +74,7 @@ void getNumberRangeData(const char* localeName, const char* nsName, NumberRangeD if (data.rangePattern.getArgumentLimit() == 0) { // No data! - data.rangePattern = {u"{0} --- {1}", status}; + data.rangePattern = {u"{0}–{1}", status}; } if (data.approximatelyPattern.getArgumentLimit() == 0) { // No data! diff --git a/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterImpl.java b/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterImpl.java index cdccb5e6df6..c05a9155711 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterImpl.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterImpl.java @@ -93,7 +93,7 @@ class NumberRangeFormatterImpl { // TODO: Is it necessary to manually fall back to latn, or does the data sink take care of that? if (sink.rangePattern == null) { - sink.rangePattern = SimpleFormatterImpl.compileToStringMinMaxArguments("{0} --- {1}", sb, 2, 2); + sink.rangePattern = SimpleFormatterImpl.compileToStringMinMaxArguments("{0}–{1}", sb, 2, 2); } if (sink.approximatelyPattern == null) { sink.approximatelyPattern = SimpleFormatterImpl.compileToStringMinMaxArguments("~{0}", sb, 1, 1); -- 2.40.0