Author: mir3x Date: Mon Aug 1 13:23:39 2016 New Revision: 33410 URL: http://svn.gna.org/viewcvs/freeciv?rev=33410&view=rev Log: Qt client - tags in chat were incorrectly placed if there were unicode characters
See bug #24888 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=33410&r1=33409&r2=33410&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/chatline.cpp (original) +++ branches/S2_6/client/gui-qt/chatline.cpp Mon Aug 1 13:23:39 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