]> git.lyx.org Git - features.git/commitdiff
Fix ticket #9276: Labeling cursor off by several characters
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 9 Oct 2014 20:09:33 +0000 (22:09 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 9 Oct 2014 20:09:33 +0000 (22:09 +0200)
The length of STRING row elements is not updated until finalizeLast() is called.

src/TextMetrics.cpp

index eb71f74f1c00088fb1268eee64ce064c44022ff8..c99517c5176eaad2439bf768be8e7426d0b725ce 100644 (file)
@@ -849,6 +849,8 @@ void TextMetrics::breakRow(Row & row, int const right_margin, pit_type const pit
                        // before body_pos. Instead, insert some spacing to
                        // align text
                        FontMetrics const & fm = theFontMetrics(text_->labelFont(par));
+                       // this is needed to make sure that the row width is correct
+                       row.finalizeLast();
                        int const add = max(fm.width(par.layout().labelsep),
                                            labelEnd(pit) - row.width());
                        row.addSpace(i, add, *fi, par.lookupChange(i));