Merge branch 'master' into 'master'
Fix escaped HTML characters screwing up the grapheme cluster sizes. See merge request AttorneyOnline/AO2-Client!61
This commit is contained in:
commit
1552f3f19c
@ -2053,6 +2053,7 @@ void Courtroom::chat_tick()
|
|||||||
{
|
{
|
||||||
QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_message);
|
QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_message);
|
||||||
QString f_character;
|
QString f_character;
|
||||||
|
int f_char_length;
|
||||||
|
|
||||||
tbf.toNextBoundary();
|
tbf.toNextBoundary();
|
||||||
|
|
||||||
@ -2061,8 +2062,10 @@ void Courtroom::chat_tick()
|
|||||||
else
|
else
|
||||||
f_character = f_message.left(tbf.position());
|
f_character = f_message.left(tbf.position());
|
||||||
|
|
||||||
|
f_char_length = f_character.length();
|
||||||
f_character = f_character.toHtmlEscaped();
|
f_character = f_character.toHtmlEscaped();
|
||||||
|
|
||||||
|
|
||||||
if (f_character == " ")
|
if (f_character == " ")
|
||||||
ui_vp_message->insertPlainText(" ");
|
ui_vp_message->insertPlainText(" ");
|
||||||
|
|
||||||
@ -2155,7 +2158,7 @@ void Courtroom::chat_tick()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
next_character_is_not_special = true;
|
next_character_is_not_special = true;
|
||||||
tick_pos--;
|
tick_pos -= f_char_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2176,7 +2179,7 @@ void Courtroom::chat_tick()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
next_character_is_not_special = true;
|
next_character_is_not_special = true;
|
||||||
tick_pos--;
|
tick_pos -= f_char_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2287,7 +2290,7 @@ void Courtroom::chat_tick()
|
|||||||
++blip_pos;
|
++blip_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
tick_pos += f_character.length();
|
tick_pos += f_char_length;
|
||||||
|
|
||||||
// Restart the timer, but according to the newly set speeds, if there were any.
|
// Restart the timer, but according to the newly set speeds, if there were any.
|
||||||
// Keep the speed at bay.
|
// Keep the speed at bay.
|
||||||
|
Loading…
Reference in New Issue
Block a user