ICU-11525 apply contributed patches to layout engine.

X-SVN-Rev: 37086
This commit is contained in:
Andy Heninger 2015-02-26 23:31:47 +00:00
parent 7115587929
commit fe90dfe8f9
6 changed files with 33 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
@ -466,6 +466,12 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupPro
const ChainSubClassRuleTable *chainSubClassRuleTable =
(const ChainSubClassRuleTable *) ((char *) chainSubClassSetTable + chainSubClassRuleTableOffset);
le_uint16 backtrackGlyphCount = SWAPW(chainSubClassRuleTable->backtrackGlyphCount);
// TODO: Ticket #11557 - enable this check, originally from ticket #11525.
// Depends on other, more extensive, changes.
// LEReferenceToArrayOf<le_uint16> backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount);
if( LE_FAILURE(success) ) { return 0; }
le_uint16 inputGlyphCount = SWAPW(chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount]) - 1;
const le_uint16 *inputClassArray = &chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount + 1];
le_uint16 lookaheadGlyphCount = SWAPW(inputClassArray[inputGlyphCount]);

View File

@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 1998 - 2013 - All Rights Reserved
* (C) Copyright IBM Corp. 1998 - 2015 - All Rights Reserved
*
*/
@ -20,7 +20,10 @@ le_uint32 CursiveAttachmentSubtable::process(const LEReferenceTo<CursiveAttachme
le_int32 coverageIndex = getGlyphCoverage(base, glyphID, success);
le_uint16 eeCount = SWAPW(entryExitCount);
if (coverageIndex < 0 || coverageIndex >= eeCount) {
LEReferenceToArrayOf<EntryExitRecord>
entryExitRecordsArrayRef(base, success, entryExitRecords, coverageIndex);
if (coverageIndex < 0 || coverageIndex >= eeCount || LE_FAILURE(success)) {
glyphIterator->setCursiveGlyph();
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* @(#)Features.cpp 1.4 00/03/15
*
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
@ -15,6 +15,9 @@ U_NAMESPACE_BEGIN
LEReferenceTo<FeatureTable> FeatureListTable::getFeatureTable(const LETableReference &base, le_uint16 featureIndex, LETag *featureTag, LEErrorCode &success) const
{
LEReferenceToArrayOf<FeatureRecord>
featureRecordArrayRef(base, success, featureRecordArray, featureIndex);
if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) {
return LEReferenceTo<FeatureTable>();
}

View File

@ -1,7 +1,7 @@
/*
* -*- c++ -*-
*
* (C) Copyright IBM Corp. and others 2013 - All Rights Reserved
* (C) Copyright IBM Corp. and others 2015 - All Rights Reserved
*
* Range checking
*
@ -313,7 +313,12 @@ LE_TRACE_TR("INFO: new RTAO")
const T *getAliasRAW() const { LE_DEBUG_TR("getAliasRAW<>"); return (const T*)fStart; }
const T& getObject(le_uint32 i, LEErrorCode &success) const {
return *getAlias(i,success);
const T *ret = getAlias(i, success);
if (LE_FAILURE(success) || ret==NULL) {
return *(new T(0));
} else {
return *ret;
}
}
const T& operator()(le_uint32 i, LEErrorCode &success) const {

View File

@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
@ -27,6 +27,9 @@ le_uint32 LigatureSubstitutionSubtable::process(const LETableReference &base, Gl
Offset ligTableOffset = SWAPW(ligSetTable->ligatureTableOffsetArray[lig]);
const LigatureTable *ligTable = (const LigatureTable *) ((char *)ligSetTable + ligTableOffset);
le_uint16 compCount = SWAPW(ligTable->compCount) - 1;
LEReferenceToArrayOf<TTGlyphID>
componentArrayRef(base, success, ligTable->componentArray, compCount);
if (LE_FAILURE(success)) { return 0; }
le_int32 startPosition = glyphIterator->getCurrStreamPosition();
TTGlyphID ligGlyph = SWAPW(ligTable->ligGlyph);
le_uint16 comp;

View File

@ -1,6 +1,6 @@
/*
*
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
@ -35,7 +35,12 @@ le_uint32 MultipleSubstitutionSubtable::process(const LETableReference &base, Gl
le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
le_uint16 seqCount = SWAPW(sequenceCount);
LEReferenceToArrayOf<Offset>
sequenceTableOffsetArrayRef(base, success, sequenceTableOffsetArray, seqCount);
if (LE_FAILURE(success)) {
return 0;
}
if (coverageIndex >= 0 && coverageIndex < seqCount) {
Offset sequenceTableOffset = SWAPW(sequenceTableOffsetArray[coverageIndex]);
const SequenceTable *sequenceTable = (const SequenceTable *) ((char *) this + sequenceTableOffset);