]> git.lyx.org Git - features.git/commitdiff
Make sure to add at least one element in row if possible
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 27 Jan 2018 11:29:27 +0000 (12:29 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 30 Jan 2018 10:07:44 +0000 (11:07 +0100)
breakRow should only produce an empty row when there is nothing left
in the paragraph.

Fixes bug #10996.

(cherry picked from commit 253b935f65759ba15b6af02117f8316e2aaf676e)

src/TextMetrics.cpp

index 620514421b78e9764be8eab39d66875379a15383..4768157bda676cb14b060f9aa95c5d95a4f617fe 100644 (file)
@@ -852,7 +852,7 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
        // or the end of the par, then build a representation of the row.
        pos_type i = pos;
        FontIterator fi = FontIterator(*this, par, row.pit(), pos);
-       while (i < end && row.width() <= width) {
+       while (i < end && (i == pos || row.width() <= width)) {
                char_type c = par.getChar(i);
                // The most special cases are handled first.
                if (par.isInset(i)) {