X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/51004dcb01e06fef634b61be77ed73dd61cb6db9..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/layout/SimpleArrayProcessor2.cpp?ds=sidebyside diff --git a/icuSources/layout/SimpleArrayProcessor2.cpp b/icuSources/layout/SimpleArrayProcessor2.cpp index c136ed6d..2ca0f318 100644 --- a/icuSources/layout/SimpleArrayProcessor2.cpp +++ b/icuSources/layout/SimpleArrayProcessor2.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2015 - All Rights Reserved * */ @@ -21,27 +21,30 @@ SimpleArrayProcessor2::SimpleArrayProcessor2() { } -SimpleArrayProcessor2::SimpleArrayProcessor2(const MorphSubtableHeader2 *morphSubtableHeader) - : NonContextualGlyphSubstitutionProcessor2(morphSubtableHeader) +SimpleArrayProcessor2::SimpleArrayProcessor2(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success) + : NonContextualGlyphSubstitutionProcessor2(morphSubtableHeader, success) { - const NonContextualGlyphSubstitutionHeader2 *header = (const NonContextualGlyphSubstitutionHeader2 *) morphSubtableHeader; + const LEReferenceTo header(morphSubtableHeader, success); - simpleArrayLookupTable = (const SimpleArrayLookupTable *) &header->table; + simpleArrayLookupTable = LEReferenceTo(morphSubtableHeader, success, &header->table); + valueArray = LEReferenceToArrayOf(morphSubtableHeader, success, &simpleArrayLookupTable->valueArray[0], LE_UNBOUNDED_ARRAY); } SimpleArrayProcessor2::~SimpleArrayProcessor2() { } -void SimpleArrayProcessor2::process(LEGlyphStorage &glyphStorage) +void SimpleArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success) { le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) { - TTGlyphID newGlyph = SWAPW(simpleArrayLookupTable->valueArray[LE_GET_GLYPH(thisGlyph)]); + TTGlyphID newGlyph = SWAPW(valueArray(LE_GET_GLYPH(thisGlyph),success)); glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph); }