Author: mir3x
Date: Sun Feb 12 20:10:46 2017
New Revision: 35018

URL: http://svn.gna.org/viewcvs/freeciv?rev=35018&view=rev
Log:
Qt client - Fixed 'glued' links in chat.

See gna bug #25499


Modified:
    branches/S2_6/client/gui-qt/chatline.cpp

Modified: branches/S2_6/client/gui-qt/chatline.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/chatline.cpp?rev=35018&r1=35017&r2=35018&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/chatline.cpp    (original)
+++ branches/S2_6/client/gui-qt/chatline.cpp    Sun Feb 12 20:10:46 2017
@@ -613,15 +613,26 @@
   /* insert html starting from last items */
   last_i = str.count();
   QMultiMap<int, QString>::const_iterator i = mm.constEnd();
+  QMultiMap<int, QString>::const_iterator j = mm.constEnd();
   while (i != mm.constBegin()) {
     --i;
     if (i.key() < last_i) {
       final_string = final_string.prepend(QString(qba.mid(i.key(),
                                                           last_i - i.key()))
-                                             .toHtmlEscaped());
+                                          .toHtmlEscaped());
     }
     last_i = i.key();
-    final_string = final_string.prepend(i.value());
+    j = i;
+    if (i != mm.constBegin()) {
+      j--;
+    }
+    if (j.key() == i.key() && i != j) {
+      final_string = final_string.prepend(j.value());
+      final_string = final_string.prepend(i.value());
+      i--;
+    } else {
+      final_string = final_string.prepend(i.value());
+    }
   }
   if (last_i == str.count()) {
     return str;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to