Author: mir3x
Date: Mon Aug  1 13:23:45 2016
New Revision: 33411

URL: http://svn.gna.org/viewcvs/freeciv?rev=33411&view=rev
Log:
Qt client -  tags in chat were incorrectly placed if there were unicode 
characters

See bug #24888


Modified:
    trunk/client/gui-qt/chatline.cpp

Modified: trunk/client/gui-qt/chatline.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/chatline.cpp?rev=33411&r1=33410&r2=33411&view=diff
==============================================================================
--- trunk/client/gui-qt/chatline.cpp    (original)
+++ trunk/client/gui-qt/chatline.cpp    Mon Aug  1 13:23:45 2016
@@ -343,14 +343,16 @@
   QString str_col;
   QString color;
   QString final_string;
+  QByteArray qba;
   QColor qc;
   QMultiMap <int, QString> mm;
   if (tags == NULL) {
     return str;
   }
+  qba = str.toLocal8Bit().data();
   text_tag_list_iterate(tags, ptag) {
     if ((text_tag_stop_offset(ptag) == FT_OFFSET_UNSET)) {
-      stop = str.count();
+      stop = qba.count();
     } else {
       stop = text_tag_stop_offset(ptag);
     }
@@ -438,7 +440,8 @@
   while (i != mm.constBegin()) {
     --i;
     if (i.key() < last_i) {
-      final_string = final_string.prepend(str.mid(i.key(), last_i - i.key())
+      final_string = final_string.prepend(QString(qba.mid(i.key(),
+                                                          last_i - i.key()))
                                              .toHtmlEscaped());
     }
     last_i = i.key();


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

Reply via email to