"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "source/i18n/number_longnames.cpp" between
icu4c-67rc-src.tgz and icu4c-67_1-src.tgz

About: ICU (International Components for Unicode) is a set of C/C++ and Java libraries providing Unicode and Globalization support for software applications on a wide variety of platforms.

number_longnames.cpp  (icu4c-67rc-src.tgz):number_longnames.cpp  (icu4c-67_1-src.tgz)
skipping to change at line 248 skipping to change at line 248
if (!secondaryData[PER_INDEX].isBogus()) { if (!secondaryData[PER_INDEX].isBogus()) {
perUnitFormat = secondaryData[PER_INDEX]; perUnitFormat = secondaryData[PER_INDEX];
} else { } else {
UnicodeString rawPerUnitFormat = getPerUnitFormat(loc, width, status); UnicodeString rawPerUnitFormat = getPerUnitFormat(loc, width, status);
if (U_FAILURE(status)) { return result; } if (U_FAILURE(status)) { return result; }
// rawPerUnitFormat is something like "{0}/{1}"; we need to substitute i n the secondary unit. // rawPerUnitFormat is something like "{0}/{1}"; we need to substitute i n the secondary unit.
SimpleFormatter compiled(rawPerUnitFormat, 2, 2, status); SimpleFormatter compiled(rawPerUnitFormat, 2, 2, status);
if (U_FAILURE(status)) { return result; } if (U_FAILURE(status)) { return result; }
UnicodeString secondaryFormat = getWithPlural(secondaryData, StandardPlu ral::Form::ONE, status); UnicodeString secondaryFormat = getWithPlural(secondaryData, StandardPlu ral::Form::ONE, status);
if (U_FAILURE(status)) { return result; } if (U_FAILURE(status)) { return result; }
SimpleFormatter secondaryCompiled(secondaryFormat, 1, 1, status); // Some "one" pattern may not contain "{0}". For example in "ar" or "ne"
locale.
SimpleFormatter secondaryCompiled(secondaryFormat, 0, 1, status);
if (U_FAILURE(status)) { return result; } if (U_FAILURE(status)) { return result; }
UnicodeString secondaryString = secondaryCompiled.getTextWithNoArguments ().trim(); UnicodeString secondaryString = secondaryCompiled.getTextWithNoArguments ().trim();
// TODO: Why does UnicodeString need to be explicit in the following lin e? // TODO: Why does UnicodeString need to be explicit in the following lin e?
compiled.format(UnicodeString(u"{0}"), secondaryString, perUnitFormat, s tatus); compiled.format(UnicodeString(u"{0}"), secondaryString, perUnitFormat, s tatus);
if (U_FAILURE(status)) { return result; } if (U_FAILURE(status)) { return result; }
} }
result->multiSimpleFormatsToModifiers(primaryData, perUnitFormat, {UFIELD_CA TEGORY_NUMBER, UNUM_MEASURE_UNIT_FIELD}, status); result->multiSimpleFormatsToModifiers(primaryData, perUnitFormat, {UFIELD_CA TEGORY_NUMBER, UNUM_MEASURE_UNIT_FIELD}, status);
return result; return result;
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)