diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-01-06 12:22:41 +0100 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-01-06 12:22:41 +0100 |
commit | c21dd3db92837b4fb4360bc1f9abed6ba957ae6f (patch) | |
tree | 7d3cbc597150c2546a633e26ce929442bfcff261 /i18npool | |
parent | b5c61b525cca0d0dbec58273a5209cdc45b742e6 (diff) | |
parent | 0c5348ff2c5cede4607555fdab45642db10b07ba (diff) |
cws tl74: merge with DEV300_m68; AND Unix LF conversion for some files!
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/calendar/calendar_gregorian.cxx | 25 | ||||
-rw-r--r-- | i18npool/source/characterclassification/cclass_unicode_parser.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 15 | ||||
-rw-r--r-- | i18npool/source/isolang/inwnt.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/isolang/mslangid.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 11 | ||||
-rw-r--r-- | i18npool/source/search/makefile.mk | 6 | ||||
-rw-r--r-- | i18npool/source/search/textsearch.cxx | 1 | ||||
-rw-r--r-- | i18npool/source/textconversion/genconv_dict.cxx | 12 |
9 files changed, 38 insertions, 40 deletions
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 50b61eae5cf1..e52cd4938f2a 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -531,8 +531,8 @@ void Calendar_gregorian::setValue() throw(RuntimeException) bool bNeedZone = !(fieldSet & (1 << CalendarFieldIndex::ZONE_OFFSET)); bool bNeedDST = !(fieldSet & (1 << CalendarFieldIndex::DST_OFFSET)); - sal_Int32 nZone1, nDST1, nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone, nDST; - nZone1 = nDST1 = nZone = nDST = 0; + sal_Int32 nZone1, nDST1, nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone0, nDST0; + nZone1 = nDST1 = nZone0 = nDST0 = 0; nYear = nMonth = nDay = nHour = nMinute = nSecond = nMilliSecond = -1; if ( bNeedZone || bNeedDST ) { @@ -581,19 +581,19 @@ void Calendar_gregorian::setValue() throw(RuntimeException) } if ( !(fieldSet & (1 << CalendarFieldIndex::ZONE_OFFSET)) ) { - nZone = body->get( UCAL_ZONE_OFFSET, status = U_ZERO_ERROR); + nZone0 = body->get( UCAL_ZONE_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) - nZone = 0; + nZone0 = 0; } if ( !(fieldSet & (1 << CalendarFieldIndex::DST_OFFSET)) ) { - nDST = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); + nDST0 = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) - nDST = 0; + nDST0 = 0; } // Submit values to obtain a time zone and DST corresponding to the date/time. - submitValues( nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone, nDST); + submitValues( nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone0, nDST0); DUMP_ICU_CAL_MSG(("%s\n","setValue() in bNeedZone||bNeedDST after submitValues()")); DUMP_I18N_CAL_MSG(("%s\n","setValue() in bNeedZone||bNeedDST after submitValues()")); @@ -605,7 +605,8 @@ void Calendar_gregorian::setValue() throw(RuntimeException) nDST1 = 0; } - // The original submission, may lead to a different zone/DST. + // The original submission, may lead to a different zone/DST and + // different date. submitFields(); DUMP_ICU_CAL_MSG(("%s\n","setValue() after original submission")); DUMP_I18N_CAL_MSG(("%s\n","setValue() after original submission")); @@ -619,7 +620,7 @@ void Calendar_gregorian::setValue() throw(RuntimeException) sal_Int32 nDST2 = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) nDST2 = nDST1; - if ( nZone2 != nZone1 || nDST2 != nDST1 ) + if ( nZone0 != nZone1 || nZone2 != nZone1 || nDST0 != nDST1 || nDST2 != nDST1 ) { // Due to different DSTs, resulting date values may differ if // DST is onset at 00:00 and the very onsetRule date was @@ -627,6 +628,12 @@ void Calendar_gregorian::setValue() throw(RuntimeException) // is not what we want. // Resubmit all values, this time including DST => date 01:00 // Similar for zone differences. + // If already the first full submission with nZone0 and nDST0 + // lead to date-1 23:00, the original submission was based on + // that date if it wasn't a full date (nDST0 set, nDST1 not + // set, nDST2==nDST1). If it was January 1st without year we're + // even off by one year now. Resubmit all values including new + // DST => date 00:00. // Set field values accordingly in case they were used. if (!bNeedZone) diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 27d6443a27fc..39e925cb7eb9 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -1038,7 +1038,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 if ( !xNatNumSup.is() ) { throw RuntimeException( OUString( -#ifndef PRODUCT +#ifdef DBG_UTIL RTL_CONSTASCII_USTRINGPARAM( "cclass_Unicode::parseText: can't instanciate " NATIVENUMBERSUPPLIER_SERVICENAME ) diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 9126162d6f36..91d856b19e62 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -39,11 +39,6 @@ #include <stdio.h> #include <string.h> -#if OSL_DEBUG_LEVEL == 0 && !defined(NDEBUG) -#define NDEBUG -#endif -#include <assert.h> - // Cyrillic upper case #define C_CYR_A "\xD0\x90" #define C_CYR_B "\xD0\x91" @@ -277,7 +272,7 @@ const char* expected_name( int i, int last ) else if( i==1 ) return "NumberingType"; else if( i==2 ) return "Suffix"; else if( i==last ) return "Value"; - else { assert(0); return ""; } + else { OSL_ASSERT(0); return ""; } } static const char* expected_type( int i, int last ) @@ -287,7 +282,7 @@ const char* expected_type( int i, int last ) else if( i==1 ) return "sal_Int16"; else if( i==2 ) return "OUString"; else if( i==last ) return "sal_Int32"; - else { assert(0); return ""; } + else { OSL_ASSERT(0); return ""; } } static void failedToConvert( int i, int last ) @@ -461,7 +456,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal return OUString::createFromAscii(""); // ignore prefix and suffix case PAGE_DESCRIPTOR: case BITMAP: - assert(0); + OSL_ASSERT(0); throw IllegalArgumentException(); case CHARS_UPPER_LETTER_N: lcl_formatChars1( upperLetter, 26, number-1, result ); // 1=>A, 2=>B, ..., 26=>Z, 27=>AA, 28=>BB, ... @@ -480,7 +475,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal } catch (Exception& ) { // When translteration property is missing, return default number (bug #101141#) result += OUString::valueOf( number ); - // assert(0); + // OSL_ASSERT(0); // throw IllegalArgumentException(); } break; @@ -674,7 +669,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal break; default: - assert(0); + OSL_ASSERT(0); throw IllegalArgumentException(); } diff --git a/i18npool/source/isolang/inwnt.cxx b/i18npool/source/isolang/inwnt.cxx index 7d5e4d3216e7..2550eb3acd10 100644 --- a/i18npool/source/isolang/inwnt.cxx +++ b/i18npool/source/isolang/inwnt.cxx @@ -104,11 +104,7 @@ LanguageType MsLangId::getPlatformSystemUILanguage() { // TODO: this could be distinguished, #if(WINVER >= 0x0500) // needs _run_ time differentiation though, not at compile time. -#if 0 getPlatformSystemLanguageImpl( nImplSystemUILanguage, &GetUserDefaultUILanguage, &GetSystemDefaultUILanguage); -#endif - getPlatformSystemLanguageImpl( nImplSystemUILanguage, - &GetUserDefaultLangID, &GetSystemDefaultLangID); return nImplSystemUILanguage; } diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx index 3476341fbc79..aab92d717429 100644 --- a/i18npool/source/isolang/mslangid.cxx +++ b/i18npool/source/isolang/mslangid.cxx @@ -154,7 +154,7 @@ LanguageType MsLangId::resolveSystemLanguageByScriptType( LanguageType nLang, sa if (nConfiguredAsianFallback == LANGUAGE_SYSTEM) nLang = LANGUAGE_CHINESE_SIMPLIFIED; else - nLang = nConfiguredComplexFallback; + nLang = nConfiguredAsianFallback; break; case ::com::sun::star::i18n::ScriptType::COMPLEX: if (nConfiguredComplexFallback == LANGUAGE_SYSTEM) diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 083fbc548c8c..e119e71ec14c 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -38,13 +38,6 @@ #include <stdio.h> #include "rtl/instance.hxx" -#if OSL_DEBUG_LEVEL == 0 -# ifndef NDEBUG -# define NDEBUG -# endif -#endif -#include <assert.h> - using namespace com::sun::star::i18n; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -1136,7 +1129,7 @@ LocaleData::getContinuousNumberingLevels( const lang::Locale& rLocale ) throw(Ru rVal.Value <<= (sal_Int16) sVal.toInt32(); break; default: - assert(0); + OSL_ASSERT(0); } } } @@ -1260,7 +1253,7 @@ LocaleData::getOutlineNumberingLevels( const lang::Locale& rLocale ) throw(Runti case 10: level[j].sTransliteration = tmp; break; case 11: level[j].nNatNum = tmp.toInt32(); break; default: - assert(0); + OSL_ASSERT(0); } } } diff --git a/i18npool/source/search/makefile.mk b/i18npool/source/search/makefile.mk index 1b48919624f6..2e81ec3f1d53 100644 --- a/i18npool/source/search/makefile.mk +++ b/i18npool/source/search/makefile.mk @@ -50,6 +50,12 @@ SLOFILES= \ $(EXCEPTIONSFILES) \ $(SLO)$/levdis.obj +# on unxsoli, no optimization for textsearch because of i105945 +.IF "$(OS)$(COM)$(CPUNAME)"=="SOLARISC52INTEL" +EXCEPTIONSNOOPTFILES= \ + $(SLO)$/textsearch.obj +.ENDIF + SHL1TARGET= $(TARGET) SHL1OBJS= $(SLOFILES) diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 96f033f4e4e3..2518a6cb0481 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -562,6 +562,7 @@ sal_Int32 TextSearch::GetDiff( const sal_Unicode cChr ) const } +// TextSearch::NSrchFrwrd is mis-optimized on unxsoli (#i105945#) SearchResult TextSearch::NSrchFrwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) throw(RuntimeException) { diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx index 23a264603df9..a49bf3031bbc 100644 --- a/i18npool/source/textconversion/genconv_dict.cxx +++ b/i18npool/source/textconversion/genconv_dict.cxx @@ -39,6 +39,8 @@ #include <rtl/strbuf.hxx> #include <rtl/ustring.hxx> +#include <vector> + using namespace ::rtl; void make_hhc_char(FILE *sfp, FILE *cfp); @@ -357,8 +359,8 @@ void make_stc_word(FILE *sfp, FILE *cfp) { sal_Int32 count, i, length; sal_Unicode STC_WordData[0x10000]; - Index *STC_WordEntry_S2T = (Index*) malloc(0x10000 * sizeof(Index)); - Index *STC_WordEntry_T2S = (Index*) malloc(0x10000 * sizeof(Index)); + std::vector<Index> STC_WordEntry_S2T(0x10000); + std::vector<Index> STC_WordEntry_T2S(0x10000); sal_Int32 count_S2T = 0, count_T2S = 0; sal_Int32 line = 0, char_total = 0; sal_Char Cstr[1024]; @@ -416,7 +418,7 @@ void make_stc_word(FILE *sfp, FILE *cfp) sal_uInt16 STC_WordIndex[0x100]; if (count_S2T > 0) { - qsort(STC_WordEntry_S2T, count_S2T, sizeof(Index), Index_comp); + qsort(&STC_WordEntry_S2T[0], count_S2T, sizeof(Index), Index_comp); fprintf(cfp, "\nstatic const sal_uInt16 STC_WordEntry_S2T[] = {"); count = 0; @@ -449,7 +451,7 @@ void make_stc_word(FILE *sfp, FILE *cfp) } if (count_T2S > 0) { - qsort(STC_WordEntry_T2S, count_T2S, sizeof(Index), Index_comp); + qsort(&STC_WordEntry_T2S[0], count_T2S, sizeof(Index), Index_comp); fprintf(cfp, "\nstatic const sal_uInt16 STC_WordEntry_T2S[] = {"); count = 0; @@ -480,7 +482,5 @@ void make_stc_word(FILE *sfp, FILE *cfp) fprintf (cfp, "\tconst sal_uInt16* getSTC_WordEntry_T2S() { return NULL; }\n"); fprintf (cfp, "\tconst sal_uInt16* getSTC_WordIndex_T2S(sal_Int32& count) { count = 0; return NULL; }\n"); } - free(STC_WordEntry_S2T); - free(STC_WordEntry_T2S); } |