diff options
Diffstat (limited to 'src/os/os2')
-rw-r--r-- | src/os/os2/os2.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/os/os2/os2.cpp b/src/os/os2/os2.cpp index 06508b361..ead6f78c3 100644 --- a/src/os/os2/os2.cpp +++ b/src/os/os2/os2.cpp @@ -176,14 +176,7 @@ int CDECL main(int argc, char *argv[]) return ttd_main(argc, argv); } -/** - * 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 - * @param tb Textbuf type to be changed - * @return Return true on successful change of Textbuf, or false otherwise - */ -bool InsertTextBufferClipboard(Textbuf *tb) +bool GetClipboardContents(char *buffer, size_t buff_len) { /* XXX -- Currently no clipboard support implemented with GCC */ #ifndef __INNOTEK_LIBC__ @@ -195,30 +188,7 @@ bool InsertTextBufferClipboard(Textbuf *tb) if (text != NULL) { - uint length = 0; - uint width = 0; - const char *i; - - for (i = text; IsValidAsciiChar(*i); i++) - { - uint w; - - if (tb->size + length + 1 > tb->maxsize) break; - - w = GetCharacterWidth(FS_NORMAL, (byte)*i); - if (tb->maxwidth != 0 && width + tb->width + w > tb->maxwidth) break; - - width += w; - length++; - } - - memmove(tb->buf + tb->caretpos + length, tb->buf + tb->caretpos, tb->size - tb->caretpos); - memcpy(tb->buf + tb->caretpos, text, length); - tb->width += width; - tb->caretxoffs += width; - tb->size += length; - tb->caretpos += length; - + ttd_strlcpy(buffer, text, buff_len); WinCloseClipbrd(hab); return true; } |