| 4042 | } |
| 4043 | |
| 4044 | void limitStringSize(lString16 & str, int maxSize) { |
| 4045 | if ((int) str.length() < maxSize) |
| 4046 | return; |
| 4047 | int lastSpace = -1; |
| 4048 | for (int i = str.length() - 1; i > 0; i--) |
| 4049 | if (str[i] == ' ') { |
| 4050 | while (i > 0 && str[i - 1] == ' ') |
| 4051 | i--; |
| 4052 | lastSpace = i; |
| 4053 | break; |
| 4054 | } |
| 4055 | int split = lastSpace > 0 ? lastSpace : maxSize; |
| 4056 | str = str.substr(0, split); |
| 4057 | str += L"..."; |
| 4058 | } |
| 4059 |
no test coverage detected