+ Character* mirroredTextBuffer = mirroredText.Begin();
+ CharacterDirection* directionsBuffer = directions.Begin();
+
+ CharacterIndex index = startIndex;
+ const CharacterIndex lastCharacter = startIndex + numberOfCharacters;
+
+ // Traverse the paragraphs and mirror the right to left ones.
+ for( Vector<BidirectionalParagraphInfoRun>::ConstIterator it = bidirectionalInfo.Begin(),
+ endIt = bidirectionalInfo.End();
+ it != endIt;
+ ++it )
+ {
+ const BidirectionalParagraphInfoRun& paragraph = *it;
+
+ if( index >= paragraph.characterRun.characterIndex + paragraph.characterRun.numberOfCharacters )
+ {
+ // Skip the paragraph as it has already been processed.
+ continue;
+ }
+
+ if( lastCharacter <= paragraph.characterRun.characterIndex )
+ {
+ // Do not get mirror characters beyond startIndex + numberOfCharacters.
+ break;
+ }
+
+ index += paragraph.characterRun.numberOfCharacters;
+ const bool tmpMirrored = bidirectionalSupport.GetMirroredText( mirroredTextBuffer + paragraph.characterRun.characterIndex,
+ directionsBuffer + paragraph.characterRun.characterIndex,
+ paragraph.characterRun.numberOfCharacters );
+
+ hasTextMirrored = hasTextMirrored || tmpMirrored;
+ }
+
+ return hasTextMirrored;