~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/layout/MultipleSubstSubtables.cpp

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * %W% %E%
3
 
 *
4
 
 * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
5
 
 *
6
 
 */
7
 
 
8
 
#include "LETypes.h"
9
 
#include "LEGlyphFilter.h"
10
 
#include "OpenTypeTables.h"
11
 
#include "GlyphSubstitutionTables.h"
12
 
#include "MultipleSubstSubtables.h"
13
 
#include "GlyphIterator.h"
14
 
#include "LESwaps.h"
15
 
 
16
 
U_NAMESPACE_BEGIN
17
 
 
18
 
le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const
19
 
{
20
 
    LEGlyphID glyph = (LEGlyphID) glyphIterator->getCurrGlyphID();
21
 
    le_int32 coverageIndex = getGlyphCoverage(glyph);
22
 
    le_uint16 seqCount = SWAPW(sequenceCount);
23
 
 
24
 
    if (coverageIndex >= 0 && coverageIndex < seqCount)
25
 
    {
26
 
        Offset sequenceTableOffset = SWAPW(sequenceTableOffsetArray[coverageIndex]);
27
 
        const SequenceTable *sequenceTable = (const SequenceTable *) ((char *) this + sequenceTableOffset);
28
 
        le_uint16 glyphCount = SWAPW(sequenceTable->glyphCount);
29
 
 
30
 
        if (glyphCount == 0) {
31
 
            glyphIterator->setCurrGlyphID(0xFFFF);
32
 
            return 1;
33
 
        }
34
 
        else {
35
 
            // Can't do this 'till there's a way to
36
 
            // grow the glyph array...
37
 
            return 1;
38
 
        }
39
 
    }
40
 
 
41
 
    return 0;
42
 
}
43
 
 
44
 
U_NAMESPACE_END