ICU-11737 Units shouldn't fall back from short to wide

X-SVN-Rev: 37512
This commit is contained in:
John Emmons 2015-06-09 19:07:53 +00:00
parent 68597cddb7
commit eed4d9c2a1

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2004-2014, International Business Machines
* Copyright (c) 2004-2015, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@ -507,7 +507,7 @@ MeasureFormat::MeasureFormat() :
cache(NULL),
numberFormat(NULL),
pluralRules(NULL),
width(UMEASFMT_WIDTH_WIDE),
width(UMEASFMT_WIDTH_SHORT),
listFormatter(NULL) {
}
@ -935,9 +935,6 @@ const QuantityFormatter *MeasureFormat::getQuantityFormatter(
if (formatters[UMEASFMT_WIDTH_SHORT].isValid()) {
return &formatters[UMEASFMT_WIDTH_SHORT];
}
if (formatters[UMEASFMT_WIDTH_WIDE].isValid()) {
return &formatters[UMEASFMT_WIDTH_WIDE];
}
status = U_MISSING_RESOURCE_ERROR;
return NULL;
}
@ -953,9 +950,6 @@ const SimplePatternFormatter *MeasureFormat::getPerUnitFormatter(
if (perUnitFormatters[UMEASFMT_WIDTH_SHORT] != NULL) {
return perUnitFormatters[UMEASFMT_WIDTH_SHORT];
}
if (perUnitFormatters[UMEASFMT_WIDTH_WIDE] != NULL) {
return perUnitFormatters[UMEASFMT_WIDTH_WIDE];
}
return NULL;
}
@ -973,9 +967,6 @@ const SimplePatternFormatter *MeasureFormat::getPerFormatter(
if (perFormatters[UMEASFMT_WIDTH_SHORT].getPlaceholderCount() == 2) {
return &perFormatters[UMEASFMT_WIDTH_SHORT];
}
if (perFormatters[UMEASFMT_WIDTH_WIDE].getPlaceholderCount() == 2) {
return &perFormatters[UMEASFMT_WIDTH_WIDE];
}
status = U_MISSING_RESOURCE_ERROR;
return NULL;
}