ICU-4132 DeviceTable::getAdjustment() should use "~" for complement. PairPositioningFormat1Subtable::process() should check for zero pairValueCount.

X-SVN-Rev: 16677
This commit is contained in:
Eric Mader 2004-10-29 19:24:42 +00:00
parent aa753e01ef
commit bf497ec1ff
2 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,7 @@
/*
* @(#)DeviceTables.cpp 1.5 00/03/15
*
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
* (C) Copyright IBM Corp. 1998 - 2004 - All Rights Reserved
*
*/
@ -36,7 +36,7 @@ le_int16 DeviceTable::getAdjustment(le_uint16 ppem) const
result = field;
if ((field & fieldSignBits[format]) != 0) {
result |= ! fieldMasks[format];
result |= ~ fieldMasks[format];
}
}

View file

@ -52,12 +52,16 @@ le_uint32 PairPositioningFormat1Subtable::process(GlyphIterator *glyphIterator,
if (coverageIndex >= 0 && glyphIterator->next()) {
Offset pairSetTableOffset = SWAPW(pairSetTableOffsetArray[coverageIndex]);
PairSetTable *pairSetTable = (PairSetTable *) ((char *) this + pairSetTableOffset);
le_uint16 pairValueCount = SWAPW(pairSetTable->pairValueCount);
le_int16 valueRecord1Size = ValueRecord::getSize(SWAPW(valueFormat1));
le_int16 valueRecord2Size = ValueRecord::getSize(SWAPW(valueFormat2));
le_int16 recordSize = sizeof(PairValueRecord) - sizeof(ValueRecord) + valueRecord1Size + valueRecord2Size;
LEGlyphID secondGlyph = glyphIterator->getCurrGlyphID();
const PairValueRecord *pairValueRecord =
findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, SWAPW(pairSetTable->pairValueCount), recordSize);
const PairValueRecord *pairValueRecord = NULL;
if (pairValueCount != 0) {
pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize);
}
if (pairValueRecord == NULL) {
return 0;