diff options
Diffstat (limited to 'Build/source/libs/icu-xetex/i18n/fmtable.cpp')
-rw-r--r-- | Build/source/libs/icu-xetex/i18n/fmtable.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Build/source/libs/icu-xetex/i18n/fmtable.cpp b/Build/source/libs/icu-xetex/i18n/fmtable.cpp index b3a882e9056..b767b332166 100644 --- a/Build/source/libs/icu-xetex/i18n/fmtable.cpp +++ b/Build/source/libs/icu-xetex/i18n/fmtable.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1997-2005, International Business Machines Corporation and * +* Copyright (C) 1997-2006, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -43,30 +43,43 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Formattable) // of the Measure class, which is true as of 3.0. [alan] // Return TRUE if *a == *b. -inline UBool objectEquals(const UObject* a, const UObject* b) { +static inline UBool objectEquals(const UObject* a, const UObject* b) { // LATER: return *a == *b; return *((const Measure*) a) == *((const Measure*) b); } // Return a clone of *a. -inline UObject* objectClone(const UObject* a) { +static inline UObject* objectClone(const UObject* a) { // LATER: return a->clone(); return ((const Measure*) a)->clone(); } // Return TRUE if *a is an instance of Measure. -inline UBool instanceOfMeasure(const UObject* a) { +static inline UBool instanceOfMeasure(const UObject* a) { // LATER: return a->instanceof(Measure::getStaticClassID()); return a->getDynamicClassID() == CurrencyAmount::getStaticClassID(); } +/** + * Creates a new Formattable array and copies the values from the specified + * original. + * @param array the original array + * @param count the original array count + * @return the new Formattable array. + */ +static inline Formattable* createArrayCopy(const Formattable* array, int32_t count) { + Formattable *result = new Formattable[count]; + for (int32_t i=0; i<count; ++i) result[i] = array[i]; // Don't memcpy! + return result; +} + //-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. /** * Set 'ec' to 'err' only if 'ec' is not already set to a failing UErrorCode. */ -inline void setError(UErrorCode& ec, UErrorCode err) { +static inline void setError(UErrorCode& ec, UErrorCode err) { if (U_SUCCESS(ec)) { ec = err; } |