commit 7167d90b505f9b98db3de00d081023afed473913 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Thu Mar 20 11:00:14 2014 +0100
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. diff --git a/src/Row.cpp b/src/Row.cpp index 15af2c2..6e60e97 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -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();