44 |
44 |
45 TrimmedArrayProcessor::TrimmedArrayProcessor() |
45 TrimmedArrayProcessor::TrimmedArrayProcessor() |
46 { |
46 { |
47 } |
47 } |
48 |
48 |
49 TrimmedArrayProcessor::TrimmedArrayProcessor(const MorphSubtableHeader *morphSubtableHeader) |
49 TrimmedArrayProcessor::TrimmedArrayProcessor(const LEReferenceTo<MorphSubtableHeader> &morphSubtableHeader, LEErrorCode &success) |
50 : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader) |
50 : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader, success), firstGlyph(0), lastGlyph(0) |
51 { |
51 { |
52 const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader; |
52 LEReferenceTo<NonContextualGlyphSubstitutionHeader> header(morphSubtableHeader, success); |
53 |
53 |
54 trimmedArrayLookupTable = (const TrimmedArrayLookupTable *) &header->table; |
54 if(LE_FAILURE(success)) return; |
55 firstGlyph = SWAPW(trimmedArrayLookupTable->firstGlyph); |
55 |
56 lastGlyph = firstGlyph + SWAPW(trimmedArrayLookupTable->glyphCount); |
56 trimmedArrayLookupTable = LEReferenceTo<TrimmedArrayLookupTable>(morphSubtableHeader, success, (const TrimmedArrayLookupTable*)&header->table); |
|
57 |
|
58 if(LE_FAILURE(success)) return; |
|
59 |
|
60 firstGlyph = SWAPW(trimmedArrayLookupTable->firstGlyph); |
|
61 lastGlyph = firstGlyph + SWAPW(trimmedArrayLookupTable->glyphCount); |
57 } |
62 } |
58 |
63 |
59 TrimmedArrayProcessor::~TrimmedArrayProcessor() |
64 TrimmedArrayProcessor::~TrimmedArrayProcessor() |
60 { |
65 { |
61 } |
66 } |
62 |
67 |
63 void TrimmedArrayProcessor::process(LEGlyphStorage &glyphStorage) |
68 void TrimmedArrayProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success) |
64 { |
69 { |
|
70 if(LE_FAILURE(success)) return; |
65 le_int32 glyphCount = glyphStorage.getGlyphCount(); |
71 le_int32 glyphCount = glyphStorage.getGlyphCount(); |
66 le_int32 glyph; |
72 le_int32 glyph; |
67 |
73 |
68 for (glyph = 0; glyph < glyphCount; glyph += 1) { |
74 for (glyph = 0; glyph < glyphCount; glyph += 1) { |
69 LEGlyphID thisGlyph = glyphStorage[glyph]; |
75 LEGlyphID thisGlyph = glyphStorage[glyph]; |