MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / InsertClipboard

Method InsertClipboard

src/textbuf.cpp:223–229  ·  view source on GitHub ↗

* Insert a chunk of text from the clipboard onto the textbuffer. Get TEXT clipboard * and append this up to the maximum length (either absolute or screenlength). If maxlength * is zero, we don't care about the screenlength but only about the physical length of the string * @return true on successful change of Textbuf, or false otherwise */

Source from the content-addressed store, hash-verified

221 * @return true on successful change of Textbuf, or false otherwise
222 */
223bool Textbuf::InsertClipboard()
224{
225 auto contents = GetClipboardContents();
226 if (!contents.has_value()) return false;
227
228 return this->InsertString(contents.value(), false);
229}
230
231/**
232 * Delete a part of the text.

Callers 1

HandleKeyPressMethod · 0.95

Calls 3

InsertStringMethod · 0.95
GetClipboardContentsFunction · 0.50
valueMethod · 0.45

Tested by

no test coverage detected