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

« back to all changes in this revision

Viewing changes to source/layout/TrimmedArrayProcessor.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
 
 * @(#)TrimmedArrayProcessor.cpp        1.6 00/03/15
3
 
 *
4
 
 * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
5
 
 *
6
 
 */
7
 
 
8
 
#include "LETypes.h"
9
 
#include "MorphTables.h"
10
 
#include "SubtableProcessor.h"
11
 
#include "NonContextualGlyphSubst.h"
12
 
#include "NonContextualGlyphSubstProc.h"
13
 
#include "TrimmedArrayProcessor.h"
14
 
#include "LESwaps.h"
15
 
 
16
 
U_NAMESPACE_BEGIN
17
 
 
18
 
TrimmedArrayProcessor::TrimmedArrayProcessor()
19
 
{
20
 
}
21
 
 
22
 
TrimmedArrayProcessor::TrimmedArrayProcessor(const MorphSubtableHeader *morphSubtableHeader)
23
 
  : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader)
24
 
{
25
 
    const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader;
26
 
 
27
 
    trimmedArrayLookupTable = (const TrimmedArrayLookupTable *) &header->table;
28
 
    firstGlyph = SWAPW(trimmedArrayLookupTable->firstGlyph);
29
 
    lastGlyph = firstGlyph + SWAPW(trimmedArrayLookupTable->glyphCount);
30
 
}
31
 
 
32
 
TrimmedArrayProcessor::~TrimmedArrayProcessor()
33
 
{
34
 
}
35
 
 
36
 
void TrimmedArrayProcessor::process(LEGlyphID *glyphs, le_int32 *charIndices, le_int32 glyphCount)
37
 
{
38
 
    le_int32 glyph;
39
 
 
40
 
    for (glyph = 0; glyph < glyphCount; glyph += 1) {
41
 
        if ((glyphs[glyph] > firstGlyph) && (glyphs[glyph] < lastGlyph)) {
42
 
            le_int16 newGlyph = trimmedArrayLookupTable->valueArray[glyphs[glyph] - firstGlyph];
43
 
 
44
 
            glyphs[glyph] = SWAPW(newGlyph);
45
 
        }
46
 
    }
47
 
48
 
 
49
 
U_NAMESPACE_END