- Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo = mImpl->mModel->mLogicalModel->mBidirectionalParagraphInfo;
- Vector<BidirectionalLineInfoRun>& bidirectionalLineInfo = mImpl->mModel->mLogicalModel->mBidirectionalLineInfo;
-
- // Check first if there are paragraphs with bidirectional info.
- if( 0u != bidirectionalInfo.Count() )
- {
- // Get the lines
- const Length numberOfLines = mImpl->mModel->mVisualModel->mLines.Count();
-
- // Reorder the lines.
- bidirectionalLineInfo.Reserve( numberOfLines ); // Reserve because is not known yet how many lines have right to left characters.
- ReorderLines( bidirectionalInfo,
- startIndex,
- requestedNumberOfCharacters,
- mImpl->mModel->mVisualModel->mLines,
- bidirectionalLineInfo );
-
- // Set the bidirectional info per line into the layout parameters.
- layoutParameters.lineBidirectionalInfoRunsBuffer = bidirectionalLineInfo.Begin();
- layoutParameters.numberOfBidirectionalInfoRuns = bidirectionalLineInfo.Count();
-
- // Re-layout the text. Reorder those lines with right to left characters.
- mImpl->mLayoutEngine.ReLayoutRightToLeftLines( layoutParameters,
- startIndex,
- requestedNumberOfCharacters,
- glyphPositions );
-
- if ( ( NO_OPERATION != ( UPDATE_DIRECTION & operations ) ) && ( numberOfLines > 0 ) )
- {
- const LineRun* const firstline = mImpl->mModel->mVisualModel->mLines.Begin();
- if ( firstline )
- {
- mImpl->mIsTextDirectionRTL = firstline->direction;
- }
- }
- }
- } // REORDER