X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..6be67b064733ad8f9e904623c29984bb874c1e0c:/icuSources/test/intltest/reptest.cpp diff --git a/icuSources/test/intltest/reptest.cpp b/icuSources/test/intltest/reptest.cpp index c7fae483..35a3f5dc 100644 --- a/icuSources/test/intltest/reptest.cpp +++ b/icuSources/test/intltest/reptest.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: - * Copyright (c) 2001-2003, International Business Machines Corporation and + * Copyright (c) 2001-2010, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /************************************************************************ @@ -92,18 +94,18 @@ public: } /** - * ICU "poor man's RTTI", returns a UClassID for the actual class. + * ICU "poor man's RTTI", returns a UClassID for this class. * * @draft ICU 2.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } /** - * ICU "poor man's RTTI", returns a UClassID for this class. + * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @draft ICU 2.2 */ - static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } + virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } protected: virtual int32_t getLength() const { @@ -118,15 +120,6 @@ protected: return chars.char32At(offset); } - virtual void handleReplaceBetween(int32_t start, int32_t limit, const UnicodeString& text) { - UnicodeString s; - this->extractBetween(start, limit, s); - if (s == text) return; // NO ACTION! - this->chars.replaceBetween(start, limit, text); - fixStyles(start, limit, text.length()); - } - - void fixStyles(int32_t start, int32_t limit, int32_t newLen) { UChar newStyle = NO_STYLE; if (start != limit && styles.charAt(start) != NO_STYLE) { @@ -151,6 +144,15 @@ protected: styles.replaceBetween(start, limit, s); } + virtual void handleReplaceBetween(int32_t start, int32_t limit, const UnicodeString& text) { + UnicodeString s; + this->extractBetween(start, limit, s); + if (s == text) return; // NO ACTION! + this->chars.replaceBetween(start, limit, text); + fixStyles(start, limit, text.length()); + } + + virtual void copy(int32_t start, int32_t limit, int32_t dest) { chars.copy(start, limit, dest); styles.copy(start, limit, dest); @@ -201,8 +203,8 @@ public: /* do nothing */ } - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; } + virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } private: static const char fgClassID; @@ -296,9 +298,7 @@ void ReplaceableTest::check(const UnicodeString& transliteratorName, t = Transliterator::createInstance(transliteratorName, UTRANS_FORWARD, status); } if (U_FAILURE(status)) { - log("FAIL: failed to create the "); - log(transliteratorName); - errln(" transliterator."); + dataerrln("FAIL: failed to create the " + transliteratorName + " transliterator"); delete tr; return; }