]> git.lyx.org Git - features.git/commitdiff
Fix bug #9040: In RtL documents end-of-paragraph marker shifts the row display
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 20 Mar 2014 10:00:14 +0000 (11:00 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 8 Jul 2014 19:23:59 +0000 (21:23 +0200)
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.

src/Row.cpp

index 15af2c2d09e440eb05b1b3f80334c5f670d01a0b..6e60e97cf9b191fe2a03c723efb2e93bd65be058 100644 (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();