jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp
author prr
Thu, 07 Mar 2013 10:02:20 -0800
changeset 16891 91e99bed64ae
parent 16889 3df90f344221
permissions -rw-r--r--
8001031: Better font processing Reviewed-by: srl, vadim
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16889
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     1
/*
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     3
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     9
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    14
 * accompanied this code).
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    15
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    19
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    22
 * questions.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    23
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    24
 */
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    25
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    26
/*
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    27
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    28
 * (C) Copyright IBM Corp.  and others 1998-2013 - All Rights Reserved
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    29
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    30
 */
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    31
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    32
#include "LETypes.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    33
#include "MorphTables.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    34
#include "StateTables.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    35
#include "MorphStateTables.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    36
#include "SubtableProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    37
#include "StateTableProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    38
#include "IndicRearrangementProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    39
#include "LEGlyphStorage.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    40
#include "LESwaps.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    41
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    42
U_NAMESPACE_BEGIN
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    43
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    44
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicRearrangementProcessor2)
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    45
16891
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    46
IndicRearrangementProcessor2::IndicRearrangementProcessor2(
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    47
      const LEReferenceTo<MorphSubtableHeader2> &morphSubtableHeader, LEErrorCode &success)
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    48
  : StateTableProcessor2(morphSubtableHeader, success), indicRearrangementSubtableHeader(morphSubtableHeader, success),
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    49
  entryTable(stHeader, success, entryTableOffset, LE_UNBOUNDED_ARRAY)
16889
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    50
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    51
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    52
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    53
IndicRearrangementProcessor2::~IndicRearrangementProcessor2()
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    54
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    55
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    56
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    57
void IndicRearrangementProcessor2::beginStateTable()
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    58
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    59
    firstGlyph = 0;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    60
    lastGlyph = 0;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    61
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    62
16891
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    63
le_uint16 IndicRearrangementProcessor2::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph,
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    64
                                                          EntryTableIndex2 index, LEErrorCode &success)
16889
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    65
{
16891
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    66
    const IndicRearrangementStateEntry2 *entry = entryTable.getAlias(index, success);
91e99bed64ae 8001031: Better font processing
prr
parents: 16889
diff changeset
    67
    if (LE_FAILURE(success)) return 0; // TODO - what to return in bad state?
16889
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    68
    le_uint16 newState = SWAPW(entry->newStateIndex); // index to the new state
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    69
    IndicRearrangementFlags  flags =  (IndicRearrangementFlags) SWAPW(entry->flags);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    70
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    71
    if (flags & irfMarkFirst) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    72
        firstGlyph = currGlyph;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    73
    }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    74
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    75
    if (flags & irfMarkLast) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    76
        lastGlyph = currGlyph;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    77
    }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    78
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    79
    doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask));
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    80
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    81
    if (!(flags & irfDontAdvance)) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    82
        currGlyph += dir;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    83
    }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    84
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    85
    return newState; // index to new state
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    86
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    87
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    88
void IndicRearrangementProcessor2::endStateTable()
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    89
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    90
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    91
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    92
void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    93
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    94
    LEGlyphID a, b, c, d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    95
    le_int32 ia, ib, ic, id, ix, x;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    96
    LEErrorCode success = LE_NO_ERROR;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    97
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    98
    switch(verb)
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    99
    {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   100
    case irvNoAction:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   101
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   102
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   103
    case irvxA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   104
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   105
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   106
        x = firstGlyph + 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   107
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   108
        while (x <= lastGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   109
            glyphStorage[x - 1] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   110
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   111
            glyphStorage.setCharIndex(x - 1, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   112
            x += 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   113
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   114
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   115
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   116
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   117
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   118
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   119
    case irvDx:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   120
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   121
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   122
        x = lastGlyph - 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   123
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   124
        while (x >= firstGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   125
            glyphStorage[x + 1] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   126
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   127
            glyphStorage.setCharIndex(x + 1, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   128
            x -= 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   129
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   130
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   131
        glyphStorage[firstGlyph] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   132
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   133
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   134
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   135
    case irvDxA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   136
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   137
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   138
        id = glyphStorage.getCharIndex(lastGlyph,  success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   139
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   140
        glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   141
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   142
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   143
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   144
        glyphStorage.setCharIndex(lastGlyph,  ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   145
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   146
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   147
    case irvxAB:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   148
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   149
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   150
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   151
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   152
        x = firstGlyph + 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   153
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   154
        while (x <= lastGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   155
            glyphStorage[x - 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   156
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   157
            glyphStorage.setCharIndex(x - 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   158
            x += 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   159
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   160
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   161
        glyphStorage[lastGlyph - 1] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   162
        glyphStorage[lastGlyph] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   163
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   164
        glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   165
        glyphStorage.setCharIndex(lastGlyph, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   166
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   167
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   168
    case irvxBA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   169
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   170
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   171
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   172
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   173
        x = firstGlyph + 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   174
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   175
        while (x <= lastGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   176
            glyphStorage[x - 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   177
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   178
            glyphStorage.setCharIndex(x - 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   179
            x += 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   180
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   181
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   182
        glyphStorage[lastGlyph - 1] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   183
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   184
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   185
        glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   186
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   187
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   188
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   189
    case irvCDx:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   190
        c = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   191
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   192
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   193
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   194
        x = lastGlyph - 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   195
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   196
        while (x >= firstGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   197
            glyphStorage[x + 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   198
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   199
            glyphStorage.setCharIndex(x + 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   200
            x -= 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   201
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   202
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   203
        glyphStorage[firstGlyph] = c;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   204
        glyphStorage[firstGlyph + 1] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   205
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   206
        glyphStorage.setCharIndex(firstGlyph, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   207
        glyphStorage.setCharIndex(firstGlyph + 1, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   208
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   209
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   210
    case irvDCx:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   211
        c = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   212
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   213
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   214
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   215
        x = lastGlyph - 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   216
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   217
        while (x >= firstGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   218
            glyphStorage[x + 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   219
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   220
            glyphStorage.setCharIndex(x + 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   221
            x -= 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   222
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   223
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   224
        glyphStorage[firstGlyph] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   225
        glyphStorage[firstGlyph + 1] = c;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   226
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   227
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   228
        glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   229
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   230
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   231
    case irvCDxA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   232
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   233
        c = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   234
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   235
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   236
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   237
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   238
        x = lastGlyph - 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   239
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   240
        while (x > firstGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   241
            glyphStorage[x + 1] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   242
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   243
            glyphStorage.setCharIndex(x + 1, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   244
            x -= 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   245
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   246
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   247
        glyphStorage[firstGlyph] = c;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   248
        glyphStorage[firstGlyph + 1] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   249
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   250
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   251
        glyphStorage.setCharIndex(firstGlyph, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   252
        glyphStorage.setCharIndex(firstGlyph + 1, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   253
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   254
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   255
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   256
    case irvDCxA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   257
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   258
        c = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   259
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   260
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   261
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   262
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   263
        x = lastGlyph - 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   264
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   265
        while (x > firstGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   266
            glyphStorage[x + 1] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   267
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   268
            glyphStorage.setCharIndex(x + 1, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   269
            x -= 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   270
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   271
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   272
        glyphStorage[firstGlyph] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   273
        glyphStorage[firstGlyph + 1] = c;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   274
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   275
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   276
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   277
        glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   278
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   279
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   280
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   281
    case irvDxAB:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   282
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   283
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   284
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   285
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   286
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   287
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   288
        x = firstGlyph + 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   289
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   290
        while (x < lastGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   291
            glyphStorage[x - 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   292
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   293
            glyphStorage.setCharIndex(x - 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   294
            x += 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   295
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   296
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   297
        glyphStorage[firstGlyph] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   298
        glyphStorage[lastGlyph - 1] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   299
        glyphStorage[lastGlyph] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   300
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   301
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   302
        glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   303
        glyphStorage.setCharIndex(lastGlyph, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   304
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   305
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   306
    case irvDxBA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   307
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   308
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   309
        d = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   310
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   311
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   312
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   313
        x = firstGlyph + 2;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   314
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   315
        while (x < lastGlyph) {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   316
            glyphStorage[x - 2] = glyphStorage[x];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   317
            ix = glyphStorage.getCharIndex(x, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   318
            glyphStorage.setCharIndex(x - 2, ix, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   319
            x += 1;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   320
        }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   321
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   322
        glyphStorage[firstGlyph] = d;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   323
        glyphStorage[lastGlyph - 1] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   324
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   325
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   326
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   327
        glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   328
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   329
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   330
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   331
    case irvCDxAB:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   332
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   333
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   334
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   335
        glyphStorage[firstGlyph] = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   336
        glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   337
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   338
        glyphStorage[lastGlyph - 1] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   339
        glyphStorage[lastGlyph] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   340
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   341
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   342
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   343
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   344
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   345
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   346
        glyphStorage.setCharIndex(firstGlyph, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   347
        glyphStorage.setCharIndex(firstGlyph + 1, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   348
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   349
        glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   350
        glyphStorage.setCharIndex(lastGlyph, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   351
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   352
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   353
    case irvCDxBA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   354
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   355
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   356
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   357
        glyphStorage[firstGlyph] = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   358
        glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   359
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   360
        glyphStorage[lastGlyph - 1] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   361
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   362
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   363
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   364
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   365
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   366
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   367
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   368
        glyphStorage.setCharIndex(firstGlyph, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   369
        glyphStorage.setCharIndex(firstGlyph + 1, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   370
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   371
        glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   372
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   373
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   374
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   375
    case irvDCxAB:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   376
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   377
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   378
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   379
        glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   380
        glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   381
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   382
        glyphStorage[lastGlyph - 1] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   383
        glyphStorage[lastGlyph] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   384
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   385
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   386
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   387
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   388
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   389
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   390
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   391
        glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   392
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   393
        glyphStorage.setCharIndex(lastGlyph - 1, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   394
        glyphStorage.setCharIndex(lastGlyph, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   395
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   396
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   397
    case irvDCxBA:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   398
        a = glyphStorage[firstGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   399
        b = glyphStorage[firstGlyph + 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   400
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   401
        glyphStorage[firstGlyph] = glyphStorage[lastGlyph];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   402
        glyphStorage[firstGlyph + 1] = glyphStorage[lastGlyph - 1];
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   403
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   404
        glyphStorage[lastGlyph - 1] = b;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   405
        glyphStorage[lastGlyph] = a;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   406
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   407
        ia = glyphStorage.getCharIndex(firstGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   408
        ib = glyphStorage.getCharIndex(firstGlyph + 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   409
        ic = glyphStorage.getCharIndex(lastGlyph - 1, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   410
        id = glyphStorage.getCharIndex(lastGlyph, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   411
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   412
        glyphStorage.setCharIndex(firstGlyph, id, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   413
        glyphStorage.setCharIndex(firstGlyph + 1, ic, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   414
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   415
        glyphStorage.setCharIndex(lastGlyph - 1, ib, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   416
        glyphStorage.setCharIndex(lastGlyph, ia, success);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   417
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   418
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   419
    default:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   420
        break;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   421
    }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   422
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   423
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   424
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
   425
U_NAMESPACE_END