FIX: display of Label and warning dialog

Change-Id: Ib147f28096336b07b033c2e8104a56f5c28b7d93
This commit is contained in:
tao.jin 2023-02-08 11:08:26 +08:00 committed by Lane.Wei
parent 7c728452a2
commit c2eeb2522b
4 changed files with 78 additions and 56 deletions

View file

@ -116,16 +116,20 @@ public:
// Find the last word to chop off.
size_t lastSpace = posEnd;
while (lastSpace != size_t(-1)) {
while (lastSpace > 0) {
auto c = line[lastSpace];
if (c == ' ' || c > 0x4E00)
if (c == ' ')
break;
if (c > 0x4E00) {
if (lastSpace != posEnd)
++lastSpace;
break;
}
--lastSpace;
}
if (lastSpace == size_t(-1)) {
if (lastSpace == 0) {
// No spaces, so can't wrap.
DoOutputLine(line);
break;
lastSpace = posEnd;
}
// Output the part that fits.