* Pass the glyph index to the methods that calculates the conversion tables.
Change-Id: I150e1a747dea196b9b3669d0e8b02d834b41d28f
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
+ GlyphIndex startGlyphIndex = 0u;
if( 0u != charactersToGlyph.Count() )
{
// The number of glyphs to be removed.
const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex];
+ startGlyphIndex = charactersToGlyph[data.startIndex];
charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex,
charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters );
// 3) Call the CreateGlyphsPerCharacterTable() function
visualModel->CreateGlyphsPerCharacterTable( data.startIndex,
+ startGlyphIndex,
data.numberOfCharacters );
// 4) Compare the results.
Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
+ GlyphIndex startGlyphIndex = 0u;
if( 0u != charactersToGlyph.Count() )
{
// The number of glyphs to be removed.
const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex];
+ startGlyphIndex = charactersToGlyph[data.startIndex];
charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex,
charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters );
// 3) Call the CreateCharacterToGlyphTable() function
visualModel->CreateCharacterToGlyphTable( data.startIndex,
+ startGlyphIndex,
data.numberOfCharacters );
// 4) Compare the results.
newParagraphGlyphs );
// Create the 'number of glyphs' per character and the glyph to character conversion tables.
- visualModel->CreateGlyphsPerCharacterTable( 0u, numberOfCharacters );
- visualModel->CreateCharacterToGlyphTable( 0u, numberOfCharacters );
+ visualModel->CreateGlyphsPerCharacterTable( 0u, 0u, numberOfCharacters );
+ visualModel->CreateCharacterToGlyphTable( 0u, 0u, numberOfCharacters );
const Length numberOfGlyphs = glyphs.Count();
newParagraphGlyphs );
// Create the 'number of glyphs' per character and the glyph to character conversion tables.
- mVisualModel->CreateGlyphsPerCharacterTable( startIndex, numberOfCharacters );
- mVisualModel->CreateCharacterToGlyphTable( startIndex, numberOfCharacters );
+ mVisualModel->CreateGlyphsPerCharacterTable( startIndex, startGlyphIndex, numberOfCharacters );
+ mVisualModel->CreateCharacterToGlyphTable( startIndex, startGlyphIndex, numberOfCharacters );
}
const Length numberOfGlyphs = glyphs.Count();
}
void VisualModel::CreateCharacterToGlyphTable( CharacterIndex startIndex,
+ GlyphIndex startGlyphIndex,
Length numberOfCharacters )
{
if( 0u == numberOfCharacters )
// 2) Traverse the glyphs and set the glyph indices per character.
// Index to the glyph.
- const GlyphIndex startGlyphIndex = updateCurrentBuffer ? *( mCharactersToGlyph.Begin() + startIndex ) : 0u;
GlyphIndex glyphIndex = startGlyphIndex;
CharacterIndex characterIndex = startIndex;
const CharacterIndex lastCharacterIndexPlusOne = startIndex + numberOfCharacters;
}
void VisualModel::CreateGlyphsPerCharacterTable( CharacterIndex startIndex,
+ GlyphIndex startGlyphIndex,
Length numberOfCharacters )
{
if( 0u == numberOfCharacters )
// 2) Traverse the glyphs and set the number of glyphs per character.
- // The glyph index.
- const GlyphIndex glyphIndex = updateCurrentBuffer ? *( mCharactersToGlyph.Begin() + startIndex ) : 0u;
Length traversedCharacters = 0;
// The number of 'characters per glyph' equal to zero.
Length zeroCharactersPerGlyph = 0u;
- for( Vector<Length>::ConstIterator it = mCharactersPerGlyph.Begin() + glyphIndex,
+ for( Vector<Length>::ConstIterator it = mCharactersPerGlyph.Begin() + startGlyphIndex,
endIt = mCharactersPerGlyph.End();
( it != endIt ) && ( traversedCharacters < numberOfCharacters );
++it )
* @pre The glyphs per character table needs to be created first.
*
* @param[in] startIndex The character from where the conversion table is created.
+ * @param[in] startGlyphIndex The glyph from where the conversion table is created.
* @param[in] numberOfCharacters The number of characters.
*/
void CreateCharacterToGlyphTable( CharacterIndex startIndex,
+ GlyphIndex startGlyphIndex,
Length numberOfCharacters );
/**
* @brief Creates an array containing the number of glyphs per character.
*
* @param[in] startIndex The character from where the table is created.
+ * @param[in] startGlyphIndex The glyph from where the conversion table is created.
* @param[in] numberOfCharacters The number of characters.
*/
void CreateGlyphsPerCharacterTable( CharacterIndex startIndex,
+ GlyphIndex startGlyphIndex,
Length numberOfCharacters );
/**