| 287 | } |
| 288 | |
| 289 | void FCommandBuffer::AddString(FString clip) |
| 290 | { |
| 291 | if (clip.IsNotEmpty()) |
| 292 | { |
| 293 | // Only paste the first line. |
| 294 | auto brk = clip.IndexOfAny("\r\n\b"); |
| 295 | std::u32string build; |
| 296 | if (brk >= 0) |
| 297 | { |
| 298 | clip.Truncate(brk); |
| 299 | } |
| 300 | auto strp = (const uint8_t*)clip.GetChars(); |
| 301 | while (auto chr = GetCharFromString(strp)) build += chr; |
| 302 | |
| 303 | if (Text.length() == 0) |
| 304 | { |
| 305 | Text = build; |
| 306 | } |
| 307 | else |
| 308 | { |
| 309 | Text.insert(CursorPos, build); |
| 310 | } |
| 311 | CursorPos += (unsigned)build.length(); |
| 312 | MakeStartPosGood(); |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | void FCommandBuffer::SetString(const FString &str) |
| 317 | { |
no test coverage detected