2000-11-28 20:56:52 +00:00
|
|
|
/*
|
|
|
|
*
|
2004-04-12 18:51:31 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
|
2000-11-28 20:56:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "MorphTables.h"
|
|
|
|
#include "StateTables.h"
|
|
|
|
#include "MorphStateTables.h"
|
|
|
|
#include "SubtableProcessor.h"
|
|
|
|
#include "StateTableProcessor.h"
|
|
|
|
#include "IndicRearrangementProcessor.h"
|
2004-04-12 18:51:31 +00:00
|
|
|
#include "LEGlyphStorage.h"
|
2000-11-28 20:56:52 +00:00
|
|
|
#include "LESwaps.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2004-10-19 06:25:41 +00:00
|
|
|
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicRearrangementProcessor)
|
2002-06-29 00:04:16 +00:00
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
IndicRearrangementProcessor::IndicRearrangementProcessor(const MorphSubtableHeader *morphSubtableHeader)
|
2000-11-28 20:56:52 +00:00
|
|
|
: StateTableProcessor(morphSubtableHeader)
|
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
indicRearrangementSubtableHeader = (const IndicRearrangementSubtableHeader *) morphSubtableHeader;
|
|
|
|
entryTable = (const IndicRearrangementStateEntry *) ((char *) &stateTableHeader->stHeader + entryTableOffset);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
IndicRearrangementProcessor::~IndicRearrangementProcessor()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void IndicRearrangementProcessor::beginStateTable()
|
|
|
|
{
|
|
|
|
firstGlyph = 0;
|
|
|
|
lastGlyph = 0;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2001-01-19 00:30:17 +00:00
|
|
|
const IndicRearrangementStateEntry *entry = &entryTable[index];
|
2000-11-28 20:56:52 +00:00
|
|
|
ByteOffset newState = SWAPW(entry->newStateOffset);
|
|
|
|
IndicRearrangementFlags flags = (IndicRearrangementFlags) SWAPW(entry->flags);
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (flags & irfMarkFirst) {
|
2000-11-28 20:56:52 +00:00
|
|
|
firstGlyph = currGlyph;
|
|
|
|
}
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (flags & irfMarkLast) {
|
2000-11-28 20:56:52 +00:00
|
|
|
lastGlyph = currGlyph;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask));
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
if (!(flags & irfDontAdvance)) {
|
2000-11-28 20:56:52 +00:00
|
|
|
// XXX: Should handle reverse too...
|
|
|
|
currGlyph += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return newState;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IndicRearrangementProcessor::endStateTable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
LEGlyphID a, b, c, d;
|
2004-04-12 18:51:31 +00:00
|
|
|
le_int32 ia, ib, ic, id, ix, x;
|
2004-05-07 23:29:16 +00:00
|
|
|
LEErrorCode success = LE_NO_ERROR;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
switch(verb)
|
|
|
|
{
|
|
|
|
case irvNoAction:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case irvxA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = firstGlyph + 1;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x <= lastGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x - 1] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x - 1, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph] = a;
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDx:
|
2004-04-12 18:51:31 +00:00
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = lastGlyph - 1;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x >= firstGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x + 1] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x + 1, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = d;
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDxA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvxAB:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = firstGlyph + 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x <= lastGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x - 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x - 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = a;
|
|
|
|
glyphStorage[lastGlyph] = b;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ib, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvxBA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-05-07 23:29:16 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = firstGlyph + 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x <= lastGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x - 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x - 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = b;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvCDx:
|
2004-04-12 18:51:31 +00:00
|
|
|
c = glyphStorage[lastGlyph - 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = lastGlyph - 2;
|
|
|
|
|
2003-12-18 16:39:17 +00:00
|
|
|
while (x >= firstGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x + 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x + 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = c;
|
|
|
|
glyphStorage[firstGlyph + 1] = d;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, ic, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, id, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDCx:
|
2004-04-12 18:51:31 +00:00
|
|
|
c = glyphStorage[lastGlyph - 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = lastGlyph - 2;
|
|
|
|
|
2003-12-18 16:39:17 +00:00
|
|
|
while (x >= firstGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x + 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x + 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = d;
|
|
|
|
glyphStorage[firstGlyph + 1] = c;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvCDxA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
c = glyphStorage[lastGlyph - 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = lastGlyph - 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x > firstGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x + 1] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x + 1, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = c;
|
|
|
|
glyphStorage[firstGlyph + 1] = d;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, ic, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, id, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDCxA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
c = glyphStorage[lastGlyph - 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = lastGlyph - 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x > firstGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x + 1] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x + 1, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = d;
|
|
|
|
glyphStorage[firstGlyph + 1] = c;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDxAB:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = firstGlyph + 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x < lastGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x - 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x - 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = d;
|
|
|
|
glyphStorage[lastGlyph - 1] = a;
|
|
|
|
glyphStorage[lastGlyph] = b;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ib, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDxBA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
|
|
|
d = glyphStorage[lastGlyph];
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x = firstGlyph + 2;
|
|
|
|
|
2001-01-19 00:30:17 +00:00
|
|
|
while (x < lastGlyph) {
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[x - 2] = glyphStorage[x];
|
2004-05-07 23:29:16 +00:00
|
|
|
ix = glyphStorage.getCharIndex(x, success);
|
|
|
|
glyphStorage.setCharIndex(x - 2, ix, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
x += 1;
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = d;
|
|
|
|
glyphStorage[lastGlyph - 1] = b;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvCDxAB:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = glyphStorage[lastGlyph - 1];
|
|
|
|
glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = a;
|
|
|
|
glyphStorage[lastGlyph] = b;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, ic, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, id, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ib, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvCDxBA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = glyphStorage[lastGlyph - 1];
|
|
|
|
glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = b;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, ic, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, id, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDCxAB:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
|
|
|
|
glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph - 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = a;
|
|
|
|
glyphStorage[lastGlyph] = b;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ib, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case irvDCxBA:
|
2004-04-12 18:51:31 +00:00
|
|
|
a = glyphStorage[firstGlyph];
|
|
|
|
b = glyphStorage[firstGlyph + 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
|
|
|
|
glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph - 1];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
glyphStorage[lastGlyph - 1] = b;
|
|
|
|
glyphStorage[lastGlyph] = a;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
ia = glyphStorage.getCharIndex(firstGlyph, success);
|
2004-04-12 18:51:31 +00:00
|
|
|
ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
|
2004-05-07 23:29:16 +00:00
|
|
|
ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
|
|
|
|
id = glyphStorage.getCharIndex(lastGlyph, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(firstGlyph, id, success);
|
|
|
|
glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-05-07 23:29:16 +00:00
|
|
|
glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
|
|
|
|
glyphStorage.setCharIndex(lastGlyph, ia, success);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-10-16 00:39:01 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|