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

Unified Diff: source/i18n/currunit.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 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/currfmt.cpp ('k') | source/i18n/datefmt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/currunit.cpp
diff --git a/source/i18n/currunit.cpp b/source/i18n/currunit.cpp
index 870d9d0c4ce8bb6f60500e9ac7ce9960ebd3f036..eaf5000d9b23b9298b8f480811a2d5be2d4eaaaa 100644
--- a/source/i18n/currunit.cpp
+++ b/source/i18n/currunit.cpp
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (c) 2004-2012, International Business Machines
+* Copyright (c) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@@ -8,8 +8,6 @@
* Since: ICU 3.0
**********************************************************************
*/
-#include "utypeinfo.h" // for 'typeid' to work
-
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
@@ -24,6 +22,9 @@ CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) {
if (U_SUCCESS(ec)) {
if (_isoCode && u_strlen(_isoCode)==3) {
u_strcpy(isoCode, _isoCode);
+ char simpleIsoCode[4];
+ u_UCharsToChars(isoCode, simpleIsoCode, 4);
+ initCurrency(simpleIsoCode);
} else {
ec = U_ILLEGAL_ARGUMENT_ERROR;
}
@@ -32,13 +33,15 @@ CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) {
CurrencyUnit::CurrencyUnit(const CurrencyUnit& other) :
MeasureUnit(other) {
- *this = other;
+ u_strcpy(isoCode, other.isoCode);
}
CurrencyUnit& CurrencyUnit::operator=(const CurrencyUnit& other) {
- if (this != &other) {
- u_strcpy(isoCode, other.isoCode);
+ if (this == &other) {
+ return *this;
}
+ MeasureUnit::operator=(other);
+ u_strcpy(isoCode, other.isoCode);
return *this;
}
@@ -49,12 +52,6 @@ UObject* CurrencyUnit::clone() const {
CurrencyUnit::~CurrencyUnit() {
}
-UBool CurrencyUnit::operator==(const UObject& other) const {
- const CurrencyUnit& c = (const CurrencyUnit&) other;
- return typeid(*this) == typeid(other) &&
- u_strcmp(isoCode, c.isoCode) == 0;
-}
-
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyUnit)
U_NAMESPACE_END
« no previous file with comments | « source/i18n/currfmt.cpp ('k') | source/i18n/datefmt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698