Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: source/i18n/plurrule.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/plurfmt.cpp ('k') | source/i18n/plurrule_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/plurrule.cpp
diff --git a/source/i18n/plurrule.cpp b/source/i18n/plurrule.cpp
index ab9fba451406ea1fc59771cdaf64b2c03cee27ab..0f1ff8d6c4c177e1011e7e46708236d0e3257eb3 100644
--- a/source/i18n/plurrule.cpp
+++ b/source/i18n/plurrule.cpp
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (C) 2007-2014, International Business Machines Corporation and
+* Copyright (C) 2007-2015, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
@@ -31,6 +31,9 @@
#include "uvectr32.h"
#include "sharedpluralrules.h"
#include "unifiedcache.h"
+#include "digitinterval.h"
+#include "visibledigits.h"
+
#if !UCONFIG_NO_FORMATTING
@@ -253,6 +256,16 @@ PluralRules::select(const FixedDecimal &number) const {
}
}
+UnicodeString
+PluralRules::select(const VisibleDigitsWithExponent &number) const {
+ if (number.getExponent() != NULL) {
+ return UnicodeString(TRUE, PLURAL_DEFAULT_RULE, -1);
+ }
+ return select(FixedDecimal(number.getMantissa()));
+}
+
+
+
StringEnumeration*
PluralRules::getKeywords(UErrorCode& status) const {
if (U_FAILURE(status)) return NULL;
@@ -1370,7 +1383,14 @@ PluralKeywordEnumeration::count(UErrorCode& /*status*/) const {
PluralKeywordEnumeration::~PluralKeywordEnumeration() {
}
-
+FixedDecimal::FixedDecimal(const VisibleDigits &digits) {
+ digits.getFixedDecimal(
+ source, intValue, decimalDigits,
+ decimalDigitsWithoutTrailingZeros,
+ visibleDecimalDigitCount, hasIntegerValue);
+ isNegative = digits.isNegative();
+ isNanOrInfinity = digits.isNaNOrInfinity();
+}
FixedDecimal::FixedDecimal(double n, int32_t v, int64_t f) {
init(n, v, f);
« no previous file with comments | « source/i18n/plurfmt.cpp ('k') | source/i18n/plurrule_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698