diff options
author | Povilas Kanapickas <povilas.kanapickas@gmail.com> | 2010-10-18 16:52:05 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-18 16:52:27 +0100 |
commit | 849a713ffd29a58ae79e48f80835c28bbd9d5a72 (patch) | |
tree | 7d2c662f43a00f3bc04a0d51c685544074538a5c /i18npool/source | |
parent | f7cbde525450a1a9427873c264791c65056c4f2a (diff) |
remove non-compiled code
Diffstat (limited to 'i18npool/source')
6 files changed, 1 insertions, 244 deletions
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 342479cb8f35..51180b01d058 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -171,17 +171,6 @@ Calendar_gregorian::init(Era *_eraArray) UErrorCode status; body = icu::Calendar::createInstance( aIcuLocale, status = U_ZERO_ERROR); if (!body || !U_SUCCESS(status)) throw ERROR; - -#if 0 - { - icu::Locale loc; - loc = body->getLocale( ULOC_ACTUAL_LOCALE, status = U_ZERO_ERROR); - fprintf( stderr, "\nICU calendar actual locale: %s\n", loc.getName()); - loc = body->getLocale( ULOC_VALID_LOCALE, status = U_ZERO_ERROR); - fprintf( stderr, "ICU calendar valid locale: %s\n", loc.getName()); - } -#endif - eraArray=_eraArray; } diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 6785bf819444..600c4fa91895 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -260,35 +260,6 @@ OUString toRoman( sal_Int32 n ) } // not used: -#if 0 - -static -const char* expected_name( int i, int last ) -{ - if(0); - else if( i==0 ) return "Prefix"; - else if( i==1 ) return "NumberingType"; - else if( i==2 ) return "Suffix"; - else if( i==last ) return "Value"; - else { OSL_ASSERT(0); return ""; } -} -static -const char* expected_type( int i, int last ) -{ - if(0); - else if( i==0 ) return "OUString"; - else if( i==1 ) return "sal_Int16"; - else if( i==2 ) return "OUString"; - else if( i==last ) return "sal_Int32"; - else { OSL_ASSERT(0); return ""; } -} -static -void failedToConvert( int i, int last ) -{ - throw IllegalArgumentException(); -} - -#endif static void lcl_formatChars( sal_Unicode table[], int tableSize, int n, OUString& s ) diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 1d974d1d701a..6c69ea5c4ad9 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -675,14 +675,9 @@ LocaleData::getAllFormats( const Locale& rLocale ) throw(RuntimeException) } } section[SECTIONS]; -#if 0 -// #i79398# wntmsci10 MSVC doesn't get this right with optimization. - const sal_Int32 formatCount = section[0].getFunc( *this, rLocale, "getAllFormats0") - + section[1].getFunc( *this, rLocale, "getAllFormats1"); -#else sal_Int32 formatCount = section[0].getFunc( *this, rLocale, "getAllFormats0"); formatCount += section[1].getFunc( *this, rLocale, "getAllFormats1"); -#endif + Sequence< FormatElement > seq(formatCount); sal_Int32 f = 0; for (int s = 0; s < SECTIONS; ++s) diff --git a/i18npool/source/transliteration/data/numberchar.h b/i18npool/source/transliteration/data/numberchar.h index 7bc0c50fc35d..fe4bb793d1d6 100644 --- a/i18npool/source/transliteration/data/numberchar.h +++ b/i18npool/source/transliteration/data/numberchar.h @@ -63,46 +63,6 @@ static const sal_Unicode NumberChar[][10] = { { 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59 } // Thai }; -// not used -#if 0 -static sal_Unicode DecimalChar[] = { - 0x002E, // Half Width (Ascii) - 0xFF0E, // Full Width - 0xFF0E, // Chinese Lower - 0x70B9, // S. Chinese Upper - 0x9EDE, // T. Chinese Upper - 0x30FB, // Japanese Modern - 0x30FB, // Japanese Trad. - 0xFF0E, // Korean Lower - 0x9EDE, // Korean Upper - 0xC810, // Korean Hangul - 0x066B, // Arabic Indic - 0x002E, // Est. Arabic Indic - 0x002E, // Indic - 0x002E // Thai -}; -#endif - -// not used -#if 0 -static sal_Unicode MinusChar[] = { - 0x002D, // Half Width (Ascii) - 0xFF0D, // Full Width - 0xFF0D, // Chinese Lower - 0x8D1F, // S. Chinese Upper - 0x5069, // T. Chinese Upper - 0x2212, // Japanese Modern - 0x2212, // Japanese Trad. - 0xFF0D, // Korean Lower - 0x5069, // Korean Upper - 0xFF0D, // Korean Hangul ??? - 0x002D, // Arabic Indic - 0x002D, // Est. Arabic Indic - 0x002D, // Indic - 0x002D, // Thai -}; -#endif - #define NUMBER_ZERO NumberChar[NumberChar_HalfWidth][0] // 0x0030 #define NUMBER_ONE NumberChar[NumberChar_HalfWidth][1] // 0x0031 #define NUMBER_NINE NumberChar[NumberChar_HalfWidth][9] // 0x0039 @@ -123,40 +83,9 @@ const sal_Int16 Multiplier_Count = 7; const sal_Int16 ExponentCount_CJK = 6; -// not used -#if 0 -static sal_Int16 MultiplierExponent_CJK[ExponentCount_CJK] = { - 12, 8, 4, 3, 2, 1 -}; -static sal_Unicode MultiplierChar_CJK[][ExponentCount_CJK] = { - 0x5146, 0x4EBF, 0x4E07, 0x5343, 0x767E, 0x5341, // S. Chinese Lower - 0x5146, 0x4EBF, 0x4E07, 0x4EDF, 0x4F70, 0x62FE, // S. Chinese Upper - 0x5146, 0x5104, 0x842C, 0x5343, 0x767E, 0x5341, // T. Chinese & Korean Lower - 0x5146, 0x5104, 0x842C, 0x4EDF, 0x4F70, 0x62FE, // T. Chinese & Korean Upper - 0xC870, 0xC5B5, 0xB9CC, 0xCC9C, 0xBC31, 0xC2ED, // Korean Hangul - 0x5146, 0x5104, 0x4E07, 0x5343, 0x767E, 0x5341, // Japanese Modern - 0x5146, 0x5104, 0x842C, 0x9621, 0x767E, 0x62FE, // Japanese Traditional -}; -#endif const sal_Int16 ExponentCount_short_CJK = 2; -// not used -#if 0 -static sal_Int16 MultiplierExponent_short_CJK[ExponentCount_short_CJK] = { - 8, 4, -}; - -static sal_Unicode MultiplierChar_short_CJK[][ExponentCount_short_CJK] = { - 0x4EBF, 0x4E07, // S. Chinese Lower - 0x4EBF, 0x4E07, // S. Chinese Upper - 0x5104, 0x842C, // T. Chinese & Korean Lower - 0x5104, 0x842C, // T. Chinese & Korean Upper - 0xC5B5, 0xB9CC, // Korean Hangul - 0x5104, 0x4E07, // Japanese Modern - 0x5104, 0x842C, // Japanese Traditional -}; -#endif } } } } diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index b23243fae5c2..27c66866eb9d 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -113,64 +113,7 @@ Transliteration_body::transliterate( Sequence< sal_Int32 >& offset) throw(RuntimeException) { -#if 0 -/* Performance optimization: - * The two realloc() consume 48% (32% grow, 16% shrink) runtime of this method! - * getValue() needs about 15%, so there is equal balance if we trade the second - * (shrinking) realloc() for a getValue(). But if the caller initializes the - * sequence to nCount elements there isn't any change in size necessary in most - * cases (one-to-one mapping) and we gain 33%. - * - * Of that constellation the getValue() method takes 20% upon each call, so 40% - * for both. By remembering the first calls' results we could gain some extra - * percentage again, but unfortunately getValue() may return a reference to a - * static buffer, so we can't store the pointer directly but would have to - * copy-construct an array, which doesn't give us any advantage. - * - * Much more is accomplished by working directly on the sequence buffer - * returned by getArray() instead of using operator[] for each and every - * access. - * - * And while we're at it: now that we know the size in advance we don't need to - * copy the buffer anymore, just create the real string buffer and let the - * return value take ownership. - * - * All together these changes result in the new implementation needing only 62% - * of the time of the old implementation (in other words: that one was 1.61 - * times slower ...) - */ - - // Allocate the max possible buffer. Try to use stack instead of heap which - // would have to be reallocated most times anyway. - const sal_Int32 nLocalBuf = 512 * NMAPPINGMAX; - sal_Unicode aLocalBuf[nLocalBuf], *out = aLocalBuf, *aHeapBuf = NULL; - - const sal_Unicode *in = inStr.getStr() + startPos; - if (nCount > 512) - out = aHeapBuf = (sal_Unicode*) malloc((nCount * NMAPPINGMAX) * sizeof(sal_Unicode)); - - if (useOffset) - offset.realloc(nCount * NMAPPINGMAX); - sal_Int32 j = 0; - for (sal_Int32 i = 0; i < nCount; i++) { - Mapping &map = casefolding::getValue(in, i, nCount, aLocale, nMappingType); - for (sal_Int32 k = 0; k < map.nmap; k++) { - if (useOffset) - offset[j] = i + startPos; - out[j++] = map.map[k]; - } - } - if (useOffset) - offset.realloc(j); - - OUString r(out, j); - - if (aHeapBuf) - free(aHeapBuf); - - return r; -#else const sal_Unicode *in = inStr.getStr() + startPos; // Two different blocks to eliminate the if(useOffset) condition inside the @@ -252,7 +195,6 @@ Transliteration_body::transliterate( delete [] pHeapBuf; return aRet; } -#endif } OUString SAL_CALL @@ -332,61 +274,6 @@ Transliteration_titlecase::Transliteration_titlecase() implementationName = "com.sun.star.i18n.Transliteration.Transliteration_titlecase"; } -#if 0 -struct LigatureData -{ - sal_uInt32 cChar; - sal_Char * pUtf8Text; -}; - -// available Unicode ligatures: -// http://www.unicode.org/charts -// http://www.unicode.org/charts/PDF/UFB00.pdf -static LigatureData aLigatures[] = -{ - { 0x0FB00, "ff" }, - { 0x0FB01, "fi" }, - { 0x0FB02, "fl" }, - { 0x0FB03, "ffi" }, - { 0x0FB04, "ffl" }, - { 0x0FB05, "ft" }, - { 0x0FB06, "st" }, - - { 0x0FB13, "\xD5\xB4\xD5\xB6" }, // Armenian small men now - { 0x0FB14, "\xD5\xB4\xD5\xA5" }, // Armenian small men ech - { 0x0FB15, "\xD5\xB4\xD5\xAB" }, // Armenian small men ini - { 0x0FB16, "\xD5\xBE\xD5\xB6" }, // Armenian small vew now - { 0x0FB17, "\xD5\xB4\xD5\xAD" }, // Armenian small men xeh - { 0x00000, "" } -}; - -static inline bool lcl_IsLigature( sal_uInt32 cChar ) -{ - return (0x0FB00 <= cChar && cChar <= 0x0FB06) || (0x0FB13 <= cChar && cChar <= 0x0FB17); -} - -static rtl::OUString lcl_ResolveLigature( sal_uInt32 cChar ) -{ - rtl::OUString aRes; - if (lcl_IsLigature( cChar )) - { - LigatureData *pFound = NULL; - LigatureData *pData = aLigatures; - while (!pFound && pData->cChar != 0) - { - if (pData->cChar == cChar) - pFound = pData; - ++pData; - } - if (pFound) - aRes = rtl::OUString( pFound->pUtf8Text, strlen( pFound->pUtf8Text ), RTL_TEXTENCODING_UTF8 ); - } - else - aRes = rtl::OUString( &cChar, 1 ); - return aRes; -} -#endif // if 0 - static rtl::OUString transliterate_titlecase_Impl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, const Locale &rLocale, diff --git a/i18npool/source/transliteration/transliteration_caseignore.cxx b/i18npool/source/transliteration/transliteration_caseignore.cxx index 1c8eaffd626f..3d2432c617f6 100644 --- a/i18npool/source/transliteration/transliteration_caseignore.cxx +++ b/i18npool/source/transliteration/transliteration_caseignore.cxx @@ -50,20 +50,6 @@ Transliteration_caseignore::Transliteration_caseignore() implementationName = "com.sun.star.i18n.Transliteration.Transliteration_caseignore"; } -#if 0 -/* NOTE: We had this, derived from Transliteration_caseignore, but it was - * unused code. Deactivated with #i89580# but left for reference in case - * MappingTypeSimpleFolding would be needed at some time. - */ -Transliteration_simplecaseignore::Transliteration_simplecaseignore() -{ - nMappingType = MappingTypeSimpleFolding; - moduleLoaded = (TransliterationModules)0; - transliterationName = "simple case ignore (generic)"; - implementationName = "com.sun.star.i18n.Transliteration.Transliteration_simplecaseignore"; -} -#endif - void SAL_CALL Transliteration_caseignore::loadModule( TransliterationModules modName, const Locale& rLocale ) throw(RuntimeException) |