5891N/A/*
5891N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5891N/A *
5891N/A * This code is free software; you can redistribute it and/or modify it
5891N/A * under the terms of the GNU General Public License version 2 only, as
5891N/A * published by the Free Software Foundation. Oracle designates this
5891N/A * particular file as subject to the "Classpath" exception as provided
5891N/A * by Oracle in the LICENSE file that accompanied this code.
5891N/A *
5891N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5891N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5891N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5891N/A * version 2 for more details (a copy is included in the LICENSE file that
5891N/A * accompanied this code).
5891N/A *
5891N/A * You should have received a copy of the GNU General Public License version
5891N/A * 2 along with this work; if not, write to the Free Software Foundation,
5891N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5891N/A *
5891N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5891N/A * or visit www.oracle.com if you need additional information or have any
5891N/A * questions.
5891N/A *
5891N/A */
5891N/A
5891N/A/*
5891N/A *
5891N/A * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
5891N/A *
5891N/A */
5891N/A
5891N/A#include "LETypes.h"
5891N/A#include "MorphTables.h"
5891N/A#include "SubtableProcessor2.h"
5891N/A#include "NonContextualGlyphSubst.h"
5891N/A#include "NonContextualGlyphSubstProc2.h"
5891N/A#include "SimpleArrayProcessor2.h"
5891N/A#include "LEGlyphStorage.h"
5891N/A#include "LESwaps.h"
5891N/A
5891N/AU_NAMESPACE_BEGIN
5891N/A
5891N/AUOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleArrayProcessor2)
5891N/A
5891N/ASimpleArrayProcessor2::SimpleArrayProcessor2()
5891N/A{
5891N/A}
5891N/A
5980N/ASimpleArrayProcessor2::SimpleArrayProcessor2(const LEReferenceTo<MorphSubtableHeader2> &morphSubtableHeader, LEErrorCode &success)
5980N/A : NonContextualGlyphSubstitutionProcessor2(morphSubtableHeader, success)
5891N/A{
5980N/A const LEReferenceTo<NonContextualGlyphSubstitutionHeader2> header(morphSubtableHeader, success);
5891N/A
5980N/A simpleArrayLookupTable = LEReferenceTo<SimpleArrayLookupTable>(morphSubtableHeader, success, &header->table);
5980N/A valueArray = LEReferenceToArrayOf<LookupValue>(morphSubtableHeader, success, &simpleArrayLookupTable->valueArray[0], LE_UNBOUNDED_ARRAY);
5891N/A}
5891N/A
5891N/ASimpleArrayProcessor2::~SimpleArrayProcessor2()
5891N/A{
5891N/A}
5891N/A
5980N/Avoid SimpleArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
5891N/A{
5980N/A if (LE_FAILURE(success)) return;
5891N/A le_int32 glyphCount = glyphStorage.getGlyphCount();
5891N/A le_int32 glyph;
5891N/A
5891N/A for (glyph = 0; glyph < glyphCount; glyph += 1) {
5891N/A LEGlyphID thisGlyph = glyphStorage[glyph];
5891N/A if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) {
5980N/A TTGlyphID newGlyph = SWAPW(valueArray(LE_GET_GLYPH(thisGlyph),success));
5891N/A
5891N/A glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
5891N/A }
5891N/A }
5891N/A}
5891N/A
5891N/AU_NAMESPACE_END