Logo Search packages:      
Sourcecode: icu version File versions  Download package

void LEGlyphStorage::moveGlyph ( le_int32  fromPosition,
le_int32  toPosition,
le_uint32  marker 
)

This method is used to reposition glyphs during Indic v2 processing. It moves all of the relevant glyph information ( glyph, indices, positions, and auxData ), from the source position to the target position, and also allows for a marker bit to be set in the target glyph's auxData so that it won't be reprocessed later in the cycle.

Parameters:
fromPosition - position of the glyph to be moved
toPosition - target position of the glyph
marker marker bit
ICU 4.2

Definition at line 515 of file LEGlyphStorage.cpp.

References getAuxData(), getCharIndex(), getGlyphID(), LE_NO_ERROR, setAuxData(), setCharIndex(), and setGlyphID().

{

    LEErrorCode success = LE_NO_ERROR;

    LEGlyphID holdGlyph = getGlyphID(fromPosition,success);
    le_int32 holdCharIndex = getCharIndex(fromPosition,success);
    le_uint32 holdAuxData = getAuxData(fromPosition,success);

    if ( fromPosition < toPosition ) {
        for ( le_int32 i = fromPosition ; i < toPosition ; i++ ) {
            setGlyphID(i,getGlyphID(i+1,success),success);
            setCharIndex(i,getCharIndex(i+1,success),success);
            setAuxData(i,getAuxData(i+1,success),success);
        }
    } else {
        for ( le_int32 i = toPosition ; i > fromPosition ; i-- ) {
            setGlyphID(i,getGlyphID(i-1,success),success);
            setCharIndex(i,getCharIndex(i-1,success),success);
            setAuxData(i,getAuxData(i-1,success),success);

        }
    }

    setGlyphID(toPosition,holdGlyph,success);
    setCharIndex(toPosition,holdCharIndex,success);
    setAuxData(toPosition,holdAuxData | marker,success);

}


Generated by  Doxygen 1.6.0   Back to index