Fix bug #9040: In RtL documents end-of-paragraph marker shifts the row display

The fact that the bug was still present in the features/str-metrics
branch comes from a goof in the initial implementation of 'virtual'
row elements (completion and end-of-par markers). Now that this is
corrected, everything works as it should.

The fact that the bug is present in master is due to some other reason
that is not useful to investigate now.
This commit is contained in:
Jean-Marc Lasgouttes 2014-03-20 11:00:14 +01:00
parent 1a4b3201e7
commit 7167d90b50

View File

@ -282,7 +282,6 @@ void Row::add(pos_type const pos, char_type const c,
Element e(STRING, pos, f, ch);
elements_.push_back(e);
}
//lyxerr << "FONT " <<back().font.language() << endl;
back().str += c;
back().endpos = pos + 1;
}
@ -294,7 +293,8 @@ void Row::addVirtual(pos_type const pos, docstring const & s,
finalizeLast();
Element e(VIRTUAL, pos, f, ch);
e.str = s;
// A completion has no size
e.dim.wid = theFontMetrics(f).width(s);
dim_.wid += e.dim.wid;
e.endpos = pos;
elements_.push_back(e);
finalizeLast();