- //LYXERR0("-------------------------------------------------------");
- pos_type const end = row_.endpos();
- // Spaces at logical line breaks in bidi text must be skipped during
- // painting. However, they may appear visually in the middle
- // of a row; they must be skipped, wherever they are...
- // * logically "abc_[HEBREW_\nHEBREW]"
- // * visually "abc_[_WERBEH\nWERBEH]"
- pos_type skipped_sep_vpos = -1;
- pos_type body_pos = par_.beginOfBody();
- if (body_pos > 0 &&
- (body_pos > end || !par_.isLineSeparator(body_pos - 1))) {
- body_pos = 0;
- }
-
- Layout const & layout = par_.layout();
-
- Change change_running;
- int change_last_x = 0;
-
- // check for possible inline completion
- DocIterator const & inlineCompletionPos = pi_.base.bv->inlineCompletionPos();
- pos_type inlineCompletionVPos = -1;
- if (inlineCompletionPos.inTexted()
- && inlineCompletionPos.text() == &text_
- && inlineCompletionPos.pit() == pit_
- && inlineCompletionPos.pos() - 1 >= row_.pos()
- && inlineCompletionPos.pos() - 1 < row_.endpos()) {
- // draw logically behind the previous character
- inlineCompletionVPos = bidi_.log2vis(inlineCompletionPos.pos() - 1);
- }
-
- // Use font span to speed things up, see below
- FontSpan font_span;
- Font font;
-
- // If the last logical character is a separator, don't paint it, unless
- // it's in the last row of a paragraph; see skipped_sep_vpos declaration
- if (end > 0 && end < par_.size() && par_.isSeparator(end - 1))
- skipped_sep_vpos = bidi_.log2vis(end - 1);
-
- for (pos_type vpos = row_.pos(); vpos < end; ) {
- if (x_ > pi_.base.bv->workWidth())