X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/layout/SegmentSingleProcessor.cpp?ds=inline diff --git a/icuSources/layout/SegmentSingleProcessor.cpp b/icuSources/layout/SegmentSingleProcessor.cpp index 75e33eb0..ec8ca255 100644 --- a/icuSources/layout/SegmentSingleProcessor.cpp +++ b/icuSources/layout/SegmentSingleProcessor.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved * */ @@ -21,29 +21,28 @@ SegmentSingleProcessor::SegmentSingleProcessor() { } -SegmentSingleProcessor::SegmentSingleProcessor(const MorphSubtableHeader *morphSubtableHeader) - : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader) +SegmentSingleProcessor::SegmentSingleProcessor(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success) + : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader, success) { - const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader; - - segmentSingleLookupTable = (const SegmentSingleLookupTable *) &header->table; + LEReferenceTo header(morphSubtableHeader, success); + segmentSingleLookupTable = LEReferenceTo(morphSubtableHeader, success, (const SegmentSingleLookupTable*)&header->table); } SegmentSingleProcessor::~SegmentSingleProcessor() { } -void SegmentSingleProcessor::process(LEGlyphStorage &glyphStorage) +void SegmentSingleProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success) { const LookupSegment *segments = segmentSingleLookupTable->segments; le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; - for (glyph = 0; glyph < glyphCount; glyph += 1) { + for (glyph = 0; glyph < glyphCount && LE_SUCCESS(success); glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; - const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segments, thisGlyph); + const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segmentSingleLookupTable, segments, thisGlyph, success); - if (lookupSegment != NULL) { + if (lookupSegment != NULL && LE_SUCCESS(success)) { TTGlyphID newGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph) + SWAPW(lookupSegment->value); glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);