}
}
-void ReplaceBidirectionalInfo( LogicalModel& model,
- CharacterIndex characterIndex,
- Length numberOfCharactersToRemove,
- Length numberOfCharactersToInsert )
-{
-}
-
void ReorderLines( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
Vector<LineRun>& lineRuns,
Vector<BidirectionalLineInfoRun>& lineInfoRuns )
// The memory is freed after the visual to logical to visual conversion tables are built in the logical model.
lineInfoRun.visualToLogicalMap = reinterpret_cast<CharacterIndex*>( malloc( line.characterRun.numberOfCharacters * sizeof( CharacterIndex ) ) );
- // Reorders the line.
- bidirectionalSupport.Reorder( paragraphInfo.bidirectionalInfoIndex,
- line.characterRun.characterIndex - paragraphInfo.characterRun.characterIndex,
- line.characterRun.numberOfCharacters,
- lineInfoRun.visualToLogicalMap );
+ if( NULL != lineInfoRun.visualToLogicalMap )
+ {
+ // Reorders the line.
+ bidirectionalSupport.Reorder( paragraphInfo.bidirectionalInfoIndex,
+ line.characterRun.characterIndex - paragraphInfo.characterRun.characterIndex,
+ line.characterRun.numberOfCharacters,
+ lineInfoRun.visualToLogicalMap );
+ }
// Push the run into the vector.
lineInfoRuns.PushBack( lineInfoRun );
}
}
-void ReorderLines( LogicalModel& logicalModel,
- const VisualModel& visualModel,
- CharacterIndex characterIndex,
- Length numberOfCharactersToRemove,
- Length numberOfCharactersToInsert )
-{
-}
-
bool GetMirroredText( const Vector<Character>& text,
- Vector<Character>& mirroredText )
+ Vector<Character>& mirroredText,
+ const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo )
{
+ bool hasTextMirrored = false;
+
// Handle to the bidirectional info module in text-abstraction.
TextAbstraction::BidirectionalSupport bidirectionalSupport = TextAbstraction::BidirectionalSupport::Get();
mirroredText = text;
- return bidirectionalSupport.GetMirroredText( mirroredText.Begin(),
- mirroredText.Count() );
+ Character* mirroredTextBuffer = mirroredText.Begin();
+
+ // 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& run = *it;
+
+ const bool tmpMirrored = bidirectionalSupport.GetMirroredText( mirroredTextBuffer + run.characterRun.characterIndex,
+ run.characterRun.numberOfCharacters );
+
+ hasTextMirrored = hasTextMirrored || tmpMirrored;
+ }
+
+ return hasTextMirrored;
}
void GetCharactersDirection( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,