NEW:limit the length of project name
jira:[project name] Change-Id: I955620f7073b3b7fda280d1118524f561d047751
This commit is contained in:
parent
9f545fd18d
commit
594a189108
|
@ -76,9 +76,15 @@ std::string PrintJob::truncate_string(const std::string& str, size_t maxLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString local_str = wxString::FromUTF8(str);
|
wxString local_str = wxString::FromUTF8(str);
|
||||||
wxString truncatedStr = local_str.Mid(0, maxLength - 3);
|
wxString truncatedStr;
|
||||||
truncatedStr.append("...");
|
|
||||||
|
|
||||||
|
for (auto i = 1; i < local_str.Length(); i++) {
|
||||||
|
wxString tagStr = local_str.Mid(0, i);
|
||||||
|
if (tagStr.ToUTF8().length() >= maxLength) {
|
||||||
|
truncatedStr = local_str.Mid(0, i - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return truncatedStr.utf8_string();
|
return truncatedStr.utf8_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue