Merge branch 'master' into jgrpp
# Conflicts: # src/console.cpp # src/os/os2/os2.cpp # src/os/unix/font_unix.cpp # src/strgen/strgen.h # src/strgen/strgen_base.cpp # src/table/settings/gui_settings.ini
This commit is contained in:
@@ -24,11 +24,9 @@
|
||||
* Try to retrieve the current clipboard contents.
|
||||
*
|
||||
* @note OS-specific function.
|
||||
* @param buffer Clipboard content.
|
||||
* @param last The pointer to the last element of the destination buffer
|
||||
* @return True if some text could be retrieved.
|
||||
* @return The (optional) clipboard contents.
|
||||
*/
|
||||
bool GetClipboardContents(char *buffer, const char *last);
|
||||
std::optional<std::string> GetClipboardContents();
|
||||
|
||||
int _caret_timer;
|
||||
|
||||
@@ -225,11 +223,10 @@ bool Textbuf::InsertString(const char *str, bool marked, const char *caret, cons
|
||||
*/
|
||||
bool Textbuf::InsertClipboard()
|
||||
{
|
||||
char utf8_buf[512];
|
||||
auto contents = GetClipboardContents();
|
||||
if (!contents.has_value()) return false;
|
||||
|
||||
if (!GetClipboardContents(utf8_buf, lastof(utf8_buf))) return false;
|
||||
|
||||
return this->InsertString(utf8_buf, false);
|
||||
return this->InsertString(contents.value().c_str(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user