]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/layout/MultipleSubstSubtables.cpp
ICU-62141.0.1.tar.gz
[apple/icu.git] / icuSources / layout / MultipleSubstSubtables.cpp
index 450bf35bc94825d99626dfd5249ab6ab94c3b5f3..4fdc0a4dc72d9f6cdb35cef74e42eab44069a314 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
  *
  */
 
 
 U_NAMESPACE_BEGIN
 
-le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const
+le_uint32 MultipleSubstitutionSubtable::process(const LETableReference &base, GlyphIterator *glyphIterator, LEErrorCode& success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
 
     // If there's a filter, we only want to do the
@@ -29,9 +33,14 @@ le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, co
         return 0;
     }
 
-    le_int32 coverageIndex = getGlyphCoverage(glyph);
+    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);
@@ -62,7 +71,11 @@ le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, co
                 }
             }
 
-            LEGlyphID *newGlyphs = glyphIterator->insertGlyphs(glyphCount);
+            LEGlyphID *newGlyphs = glyphIterator->insertGlyphs(glyphCount, success);
+            if (LE_FAILURE(success)) { 
+                return 0;
+            }
+
             le_int32 insert = 0, direction = 1;
 
             if (glyphIterator->isRightToLeft()) {