- if( 0u == numberOfCharacters )
- {
- mText.Clear();
- }
- else
- {
- mText.Resize( numberOfCharacters );
- memcpy( mText.Begin(), text, numberOfCharacters * sizeof( Character ) );
- }
-}
-
-Length LogicalModel::GetNumberOfCharacters() const
-{
- return mText.Count();
-}
-
-void LogicalModel::GetText( Character* text,
- CharacterIndex characterIndex,
- Length numberOfCharacters ) const
-{
- memcpy( text, mText.Begin() + characterIndex, numberOfCharacters * sizeof( Character ) );
-}
-
-Character LogicalModel::GetCharacter( CharacterIndex characterIndex ) const
-{
- return mText[characterIndex];
-}
-
-void LogicalModel::ReplaceText( CharacterIndex characterIndex,
- Length numberOfCharactersToRemove,
- const Character* const text,
- Length numberOfCharactersToInsert )
-{
-}
-
-void LogicalModel::SetScripts( const ScriptRun* const scripts,
- Length numberOfRuns )
-{
- if( 0u == numberOfRuns )
- {
- mScriptRuns.Clear();
- }
- else
- {
- mScriptRuns.Resize( numberOfRuns );
- memcpy( mScriptRuns.Begin(), scripts, numberOfRuns * sizeof( ScriptRun ) );
- }
-}
-
-void LogicalModel::GetNumberOfScriptRuns( CharacterIndex characterIndex,
- Length numberOfCharacters,
- ScriptRunIndex& firstScriptRun,
- Length& numberOfScriptRuns ) const
-{
- // Initialize the number of scripts and the index to the first script.
- firstScriptRun = 0u;
- numberOfScriptRuns = 0;
- bool firstScriptFound = false;
-
- const CharacterIndex lastCharacterIndex = characterIndex + numberOfCharacters;
-
- // Traverse the scripts and count those scripts within the range of characters.
- for( Vector<ScriptRun>::ConstIterator it = mScriptRuns.Begin(),
- endIt = mScriptRuns.End();