commit 253b935f65759ba15b6af02117f8316e2aaf676e
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Jan 27 12:29:27 2018 +0100

    Make sure to add at least one element in row if possible
    
    breakRow should only produce an empty row when there is nothing left
    in the paragraph.
    
    Fixes bug #10996.
---
 src/TextMetrics.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 5877e0f..5e0f3f8 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -862,7 +862,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)) {

Reply via email to