diff options
Diffstat (limited to 'Build/source/libs/icu-xetex/i18n/ucol_bld.cpp')
-rw-r--r-- | Build/source/libs/icu-xetex/i18n/ucol_bld.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/Build/source/libs/icu-xetex/i18n/ucol_bld.cpp b/Build/source/libs/icu-xetex/i18n/ucol_bld.cpp index 1768d13c189..1191a86b825 100644 --- a/Build/source/libs/icu-xetex/i18n/ucol_bld.cpp +++ b/Build/source/libs/icu-xetex/i18n/ucol_bld.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2001-2005, International Business Machines +* Copyright (C) 2001-2006, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -333,7 +333,7 @@ U_CFUNC void ucol_inv_getGapPositions(UColTokenParser *src, UColTokListHeader *l //if(lh->baseCE >= PRIMARY_IMPLICIT_MIN && lh->baseCE < PRIMARY_IMPLICIT_MAX ) { /* implicits - */ lh->pos[0] = 0; t1 = lh->baseCE; - t2 = lh->baseContCE; + t2 = lh->baseContCE & UCOL_REMOVE_CONTINUATION; lh->gapsLo[0] = (t1 & UCOL_PRIMARYMASK) | (t2 & UCOL_PRIMARYMASK) >> 16; lh->gapsLo[1] = (t1 & UCOL_SECONDARYMASK) << 16 | (t2 & UCOL_SECONDARYMASK) << 8; lh->gapsLo[2] = (UCOL_TERTIARYORDER(t1)) << 24 | (UCOL_TERTIARYORDER(t2)) << 16; @@ -341,7 +341,7 @@ U_CFUNC void ucol_inv_getGapPositions(UColTokenParser *src, UColTokListHeader *l primaryCE = uprv_uca_getImplicitFromRaw(uprv_uca_getRawFromImplicit(primaryCE)+1); t1 = primaryCE & UCOL_PRIMARYMASK | 0x0505; - t2 = (primaryCE << 16) & UCOL_PRIMARYMASK | UCOL_CONTINUATION_MARKER; + t2 = (primaryCE << 16) & UCOL_PRIMARYMASK; // | UCOL_CONTINUATION_MARKER; lh->gapsHi[0] = (t1 & UCOL_PRIMARYMASK) | (t2 & UCOL_PRIMARYMASK) >> 16; lh->gapsHi[1] = (t1 & UCOL_SECONDARYMASK) << 16 | (t2 & UCOL_SECONDARYMASK) << 8; @@ -350,12 +350,12 @@ U_CFUNC void ucol_inv_getGapPositions(UColTokenParser *src, UColTokListHeader *l //} else if(lh->baseCE == UCOL_RESET_TOP_VALUE && lh->baseContCE == 0) { lh->pos[0] = 0; t1 = lh->baseCE; - t2 = lh->baseContCE; + t2 = lh->baseContCE&UCOL_REMOVE_CONTINUATION; lh->gapsLo[0] = (t1 & UCOL_PRIMARYMASK) | (t2 & UCOL_PRIMARYMASK) >> 16; lh->gapsLo[1] = (t1 & UCOL_SECONDARYMASK) << 16 | (t2 & UCOL_SECONDARYMASK) << 8; lh->gapsLo[2] = (UCOL_TERTIARYORDER(t1)) << 24 | (UCOL_TERTIARYORDER(t2)) << 16; t1 = lh->nextCE; - t2 = lh->nextContCE; + t2 = lh->nextContCE&UCOL_REMOVE_CONTINUATION; lh->gapsHi[0] = (t1 & UCOL_PRIMARYMASK) | (t2 & UCOL_PRIMARYMASK) >> 16; lh->gapsHi[1] = (t1 & UCOL_SECONDARYMASK) << 16 | (t2 & UCOL_SECONDARYMASK) << 8; lh->gapsHi[2] = (UCOL_TERTIARYORDER(t1)) << 24 | (UCOL_TERTIARYORDER(t2)) << 16; @@ -687,17 +687,19 @@ U_CFUNC void ucol_doCE(UColTokenParser *src, uint32_t *CEparts, UColToken *tok, // we want to set case bits here and now, not later. // Case bits handling - tok->CEs[0] &= 0xFFFFFF3F; // Clean the case bits field - int32_t cSize = (tok->source & 0xFF000000) >> 24; - UChar *cPoints = (tok->source & 0x00FFFFFF) + src->source; - - if(cSize > 1) { - // Do it manually - tok->CEs[0] |= ucol_uprv_getCaseBits(src->UCA, cPoints, cSize, status); - } else { - // Copy it from the UCA - uint32_t caseCE = ucol_getFirstCE(src->UCA, cPoints[0], status); - tok->CEs[0] |= (caseCE & 0xC0); + if(tok->CEs[0] != 0) { // case bits should be set only for non-ignorables + tok->CEs[0] &= 0xFFFFFF3F; // Clean the case bits field + int32_t cSize = (tok->source & 0xFF000000) >> 24; + UChar *cPoints = (tok->source & 0x00FFFFFF) + src->source; + + if(cSize > 1) { + // Do it manually + tok->CEs[0] |= ucol_uprv_getCaseBits(src->UCA, cPoints, cSize, status); + } else { + // Copy it from the UCA + uint32_t caseCE = ucol_getFirstCE(src->UCA, cPoints[0], status); + tok->CEs[0] |= (caseCE & 0xC0); + } } #if UCOL_DEBUG==2 @@ -1200,7 +1202,7 @@ UCATableHeader *ucol_assembleTailoringTable(UColTokenParser *src, UErrorCode *st } // Add completely ignorable elements - utrie_enum(t->UCA->mapping, NULL, _processUCACompleteIgnorables, t); + utrie_enum(&t->UCA->mapping, NULL, _processUCACompleteIgnorables, t); // canonical closure |