Show one-letter words again
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 15 Sep 2009 06:56:25 +0000 (08:56 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 15 Sep 2009 07:44:20 +0000 (09:44 +0200)
Looks like QTextBoundaryFinder has a pathological issue with strings of length 1.

src/qtui/chatlinemodelitem.cpp

index ea0b44a..824e9da 100644 (file)
@@ -182,8 +182,12 @@ void ChatLineModelItem::computeWrapList() const {
   line.setNumColumns(length);
   layout.endLayout();
 
-  while((idx = finder.toNextBoundary()) >= 0 && idx < length) {
-    idx++;  // the boundary is *before* the actual character
+  while((idx = finder.toNextBoundary()) >= 0 && idx <= length) {
+    if(idx < length)
+      idx++;  // the boundary is *before* the actual character
+
+    if(idx == oldidx)
+      continue;
 
     word.start = oldidx;
     int wordend = idx;