X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=b1a071b8f864dedebe6fb04a831bd3434c5f560a;hp=e3ab1abb408f148b90979c36b715b6c2e458f07d;hb=b2de861297e7bb461b37ff041827c89360ecfec6;hpb=d36a37a4a2e2fa889cf12d596258f9ba4dfcc5ed diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index e3ab1abb..b1a071b8 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -460,7 +460,7 @@ void ContentsChatItem::doLayout(QTextLayout *layout) const { // Sometimes, setNumColumns will create a line that's too long (cf. Qt bug 238249) // We verify this and try setting the width again, making it shorter each time until the lengths match. // Dead fugly, but seems to work… - for(int i = line.textLength()-1; line.textLength() > num; i--) { + for(int i = line.textLength()-1; i >= 0 && line.textLength() > num; i--) { line.setNumColumns(i); } if(num != line.textLength()) {