diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-02 14:25:19 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-08-02 14:25:19 +0100 |
commit | 408dd00ed448caebf53999704ef03b6c45cdd8b7 (patch) | |
tree | 7500ea84543d4005bc13f603469740a77e9f953d /framebuffer | |
parent | efaca1c1fa7238aa0edc46a0e3e0eda61efda682 (diff) | |
download | netsurf-408dd00ed448caebf53999704ef03b6c45cdd8b7.tar.gz netsurf-408dd00ed448caebf53999704ef03b6c45cdd8b7.tar.bz2 |
Use selection_copy_to_clipboard instead of peering at core innards.
Diffstat (limited to 'framebuffer')
-rw-r--r-- | framebuffer/clipboard.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c index 16831fff6..d534cfe7a 100644 --- a/framebuffer/clipboard.c +++ b/framebuffer/clipboard.c @@ -25,7 +25,6 @@ #include <string.h> #include "desktop/selection.h" #include "framebuffer/gui.h" -#include "render/box.h" #include "utils/log.h" @@ -37,42 +36,6 @@ static struct gui_clipboard { /** - * Selection traversal routine for appending text to the current contents - * of the clipboard. - * - * \param text pointer to text being added, or NULL for newline - * \param length length of text to be appended (bytes) - * \param box pointer to text box, or NULL if from textplain - * \param handle unused handle, we don't need one - * \param whitespace_text whitespace to place before text for formatting - * may be NULL - * \param whitespace_length length of whitespace_text - * \return true iff successful and traversal should continue - */ - -static bool copy_handler(const char *text, size_t length, struct box *box, - void *handle, const char *whitespace_text, - size_t whitespace_length) -{ - bool add_space = box != NULL ? box->space != 0 : false; - - /* add any whitespace which precedes the text from this box */ - if (whitespace_text != NULL && whitespace_length > 0) { - if (!gui_add_to_clipboard(whitespace_text, - whitespace_length, false)) { - return false; - } - } - - /* add the text from this box */ - if (!gui_add_to_clipboard(text, length, add_space)) - return false; - - return true; -} - - -/** * Empty the clipboard, called prior to gui_add_to_clipboard and * gui_commit_clipboard * @@ -159,7 +122,7 @@ bool gui_copy_to_clipboard(struct selection *s) if (!gui_empty_clipboard()) return false; - selection_traverse(s, copy_handler, NULL); + selection_copy_to_clipboard(s); return gui_commit_clipboard(); } |