Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/1cb5272c95d7e09adda67adc8ec94de6a3da176c
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/1cb5272c95d7e09adda67adc8ec94de6a3da176c
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/1cb5272c95d7e09adda67adc8ec94de6a3da176c

The branch, master has been updated
       via  1cb5272c95d7e09adda67adc8ec94de6a3da176c (commit)
      from  5747465437ebc476dfa1385825e7844d8a253485 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/1cb5272c95d7e09adda67adc8ec94de6a3da176c
commit 1cb5272c95d7e09adda67adc8ec94de6a3da176c
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Use selection_copy_to_clipboard instead of peering into core innards.

diff --git a/riscos/textselection.c b/riscos/textselection.c
index d080099..5f02113 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -64,9 +64,6 @@ static char *clipboard = NULL;
 static size_t clip_alloc = 0;
 static size_t clip_length = 0;
 
-static bool copy_handler(const char *text, size_t length, struct box *box,
-               void *handle, const char *whitespace_text,
-               size_t whitespace_length);
 static void ro_gui_discard_clipboard_contents(void);
 static void ro_gui_dragging_bounced(wimp_message *message);
 
@@ -190,42 +187,6 @@ void ro_gui_selection_drag_end(struct gui_window *g, 
wimp_dragged *drag)
 
 
 /**
- * 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
- */
-
-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
  *
@@ -361,7 +322,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();
 }


-----------------------------------------------------------------------

Summary of changes:
 riscos/textselection.c |   41 +----------------------------------------
 1 files changed, 1 insertions(+), 40 deletions(-)

diff --git a/riscos/textselection.c b/riscos/textselection.c
index d080099..5f02113 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -64,9 +64,6 @@ static char *clipboard = NULL;
 static size_t clip_alloc = 0;
 static size_t clip_length = 0;
 
-static bool copy_handler(const char *text, size_t length, struct box *box,
-               void *handle, const char *whitespace_text,
-               size_t whitespace_length);
 static void ro_gui_discard_clipboard_contents(void);
 static void ro_gui_dragging_bounced(wimp_message *message);
 
@@ -190,42 +187,6 @@ void ro_gui_selection_drag_end(struct gui_window *g, 
wimp_dragged *drag)
 
 
 /**
- * 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
- */
-
-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
  *
@@ -361,7 +322,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();
 }


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to