Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/0a9c64352001ea9c094f275c52d220d768ab73ac
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/0a9c64352001ea9c094f275c52d220d768ab73ac
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/0a9c64352001ea9c094f275c52d220d768ab73ac

The branch, vince/gtk-tab-restyle has been updated
       via  0a9c64352001ea9c094f275c52d220d768ab73ac (commit)
      from  15e24488cb8721dc8d07c260e30aa8e4490e1369 (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/commit/?id=0a9c64352001ea9c094f275c52d220d768ab73ac
commit 0a9c64352001ea9c094f275c52d220d768ab73ac
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    fix core find in page behaviour when case sensitivity is toggled

diff --git a/content/handlers/html/html_interaction.c 
b/content/handlers/html/html_interaction.c
index 5f165e3..d31ad1d 100644
--- a/content/handlers/html/html_interaction.c
+++ b/content/handlers/html/html_interaction.c
@@ -1165,21 +1165,25 @@ bool html_keypress(struct content *c, uint32_t key)
 /**
  * Handle search.
  *
- * \param  c                   content of type HTML
- * \param  context             front end private data
- * \param  flags               search flags
- * \param  string              search string
+ * \param c content of type HTML
+ * \param context front end private data
+ * \param flags search flags
+ * \param string search string
  */
-void html_search(struct content *c, void *context,
-               search_flags_t flags, const char *string)
+void
+html_search(struct content *c,
+           void *context,
+           search_flags_t flags,
+           const char *string)
 {
        html_content *html = (html_content *)c;
 
        assert(c != NULL);
 
-       if (string != NULL && html->search_string != NULL &&
-                       strcmp(string, html->search_string) == 0 &&
-                       html->search != NULL) {
+       if ((string != NULL) &&
+           (html->search_string != NULL) &&
+           (strcmp(string, html->search_string) == 0) &&
+           (html->search != NULL)) {
                /* Continue prev. search */
                search_step(html->search, flags, string);
 
diff --git a/content/handlers/html/search.c b/content/handlers/html/search.c
index e26510e..3599951 100644
--- a/content/handlers/html/search.c
+++ b/content/handlers/html/search.c
@@ -422,6 +422,49 @@ static bool find_occurrences_text(const char *pattern, int 
p_len,
 
 
 /**
+ * Specifies whether all matches or just the current match should
+ * be highlighted in the search text.
+ */
+static void search_show_all(bool all, struct search_context *context)
+{
+       struct list_entry *a;
+
+       for (a = context->found->next; a; a = a->next) {
+               bool add = true;
+               if (!all && a != context->current) {
+                       add = false;
+                       if (a->sel) {
+                               selection_clear(a->sel, true);
+                               selection_destroy(a->sel);
+                               a->sel = NULL;
+                       }
+               }
+               if (add && !a->sel) {
+
+                       if (context->is_html == true) {
+                               html_content *html = (html_content *)context->c;
+                               a->sel = selection_create(context->c, true);
+                               if (!a->sel)
+                                       continue;
+
+                               selection_init(a->sel, html->layout,
+                                               &html->len_ctx);
+                       } else {
+                               a->sel = selection_create(context->c, false);
+                               if (!a->sel)
+                                       continue;
+
+                               selection_init(a->sel, NULL, NULL);
+                       }
+
+                       selection_set_start(a->sel, a->start_idx);
+                       selection_set_end(a->sel, a->end_idx);
+               }
+       }
+}
+
+
+/**
  * Search for a string in the box tree
  *
  * \param string the string to search for
@@ -429,8 +472,11 @@ static bool find_occurrences_text(const char *pattern, int 
p_len,
  * \param context The search context to add the entry to.
  * \param flags flags to control the search.
  */
-static void search_text(const char *string, int string_len,
-               struct search_context *context, search_flags_t flags)
+static void
+search_text(const char *string,
+           int string_len,
+           struct search_context *context,
+           search_flags_t flags)
 {
        struct rect bounds;
        struct box *box = NULL;
@@ -456,7 +502,8 @@ static void search_text(const char *string, int string_len,
 
 
        /* check if we need to start a new search or continue an old one */
-       if (context->newsearch) {
+       if ((context->newsearch) ||
+           (context->prev_case_sens != case_sensitive)) {
                bool res;
 
                if (context->string != NULL)
@@ -543,16 +590,15 @@ static void search_text(const char *string, int 
string_len,
 
 
 /* Exported function documented in search.h */
-void search_step(struct search_context *context, search_flags_t flags,
-               const char *string)
+void
+search_step(struct search_context *context,
+           search_flags_t flags,
+           const char *string)
 {
        int string_len;
        int i = 0;
 
-       if (context == NULL) {
-               guit->misc->warning("SearchError", 0);
-               return;
-       }
+       assert(context != NULL);
 
        guit->search->add_recent(string, context->gui_p);
 
@@ -598,44 +644,6 @@ bool search_term_highlighted(struct content *c,
 }
 
 
-/* Exported function documented in search.h */
-void search_show_all(bool all, struct search_context *context)
-{
-       struct list_entry *a;
-
-       for (a = context->found->next; a; a = a->next) {
-               bool add = true;
-               if (!all && a != context->current) {
-                       add = false;
-                       if (a->sel) {
-                               selection_clear(a->sel, true);
-                               selection_destroy(a->sel);
-                               a->sel = NULL;
-                       }
-               }
-               if (add && !a->sel) {
-
-                       if (context->is_html == true) {
-                               html_content *html = (html_content *)context->c;
-                               a->sel = selection_create(context->c, true);
-                               if (!a->sel)
-                                       continue;
-
-                               selection_init(a->sel, html->layout,
-                                               &html->len_ctx);
-                       } else {
-                               a->sel = selection_create(context->c, false);
-                               if (!a->sel)
-                                       continue;
-
-                               selection_init(a->sel, NULL, NULL);
-                       }
-
-                       selection_set_start(a->sel, a->start_idx);
-                       selection_set_end(a->sel, a->end_idx);
-               }
-       }
-}
 
 
 /* Exported function documented in search.h */
diff --git a/content/handlers/html/search.h b/content/handlers/html/search.h
index 5c9408e..dfb1afc 100644
--- a/content/handlers/html/search.h
+++ b/content/handlers/html/search.h
@@ -60,11 +60,6 @@ void search_destroy_context(struct search_context *context);
 void search_step(struct search_context *context, search_flags_t flags,
                const char * string);
 
-/**
- * Specifies whether all matches or just the current match should
- * be highlighted in the search text.
- */
-void search_show_all(bool all, struct search_context *context);
 
 /**
  * Determines whether any portion of the given text box should be


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

Summary of changes:
 content/handlers/html/html_interaction.c |   22 ++++---
 content/handlers/html/search.c           |  102 ++++++++++++++++--------------
 content/handlers/html/search.h           |    5 --
 3 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/content/handlers/html/html_interaction.c 
b/content/handlers/html/html_interaction.c
index 5f165e3..d31ad1d 100644
--- a/content/handlers/html/html_interaction.c
+++ b/content/handlers/html/html_interaction.c
@@ -1165,21 +1165,25 @@ bool html_keypress(struct content *c, uint32_t key)
 /**
  * Handle search.
  *
- * \param  c                   content of type HTML
- * \param  context             front end private data
- * \param  flags               search flags
- * \param  string              search string
+ * \param c content of type HTML
+ * \param context front end private data
+ * \param flags search flags
+ * \param string search string
  */
-void html_search(struct content *c, void *context,
-               search_flags_t flags, const char *string)
+void
+html_search(struct content *c,
+           void *context,
+           search_flags_t flags,
+           const char *string)
 {
        html_content *html = (html_content *)c;
 
        assert(c != NULL);
 
-       if (string != NULL && html->search_string != NULL &&
-                       strcmp(string, html->search_string) == 0 &&
-                       html->search != NULL) {
+       if ((string != NULL) &&
+           (html->search_string != NULL) &&
+           (strcmp(string, html->search_string) == 0) &&
+           (html->search != NULL)) {
                /* Continue prev. search */
                search_step(html->search, flags, string);
 
diff --git a/content/handlers/html/search.c b/content/handlers/html/search.c
index e26510e..3599951 100644
--- a/content/handlers/html/search.c
+++ b/content/handlers/html/search.c
@@ -422,6 +422,49 @@ static bool find_occurrences_text(const char *pattern, int 
p_len,
 
 
 /**
+ * Specifies whether all matches or just the current match should
+ * be highlighted in the search text.
+ */
+static void search_show_all(bool all, struct search_context *context)
+{
+       struct list_entry *a;
+
+       for (a = context->found->next; a; a = a->next) {
+               bool add = true;
+               if (!all && a != context->current) {
+                       add = false;
+                       if (a->sel) {
+                               selection_clear(a->sel, true);
+                               selection_destroy(a->sel);
+                               a->sel = NULL;
+                       }
+               }
+               if (add && !a->sel) {
+
+                       if (context->is_html == true) {
+                               html_content *html = (html_content *)context->c;
+                               a->sel = selection_create(context->c, true);
+                               if (!a->sel)
+                                       continue;
+
+                               selection_init(a->sel, html->layout,
+                                               &html->len_ctx);
+                       } else {
+                               a->sel = selection_create(context->c, false);
+                               if (!a->sel)
+                                       continue;
+
+                               selection_init(a->sel, NULL, NULL);
+                       }
+
+                       selection_set_start(a->sel, a->start_idx);
+                       selection_set_end(a->sel, a->end_idx);
+               }
+       }
+}
+
+
+/**
  * Search for a string in the box tree
  *
  * \param string the string to search for
@@ -429,8 +472,11 @@ static bool find_occurrences_text(const char *pattern, int 
p_len,
  * \param context The search context to add the entry to.
  * \param flags flags to control the search.
  */
-static void search_text(const char *string, int string_len,
-               struct search_context *context, search_flags_t flags)
+static void
+search_text(const char *string,
+           int string_len,
+           struct search_context *context,
+           search_flags_t flags)
 {
        struct rect bounds;
        struct box *box = NULL;
@@ -456,7 +502,8 @@ static void search_text(const char *string, int string_len,
 
 
        /* check if we need to start a new search or continue an old one */
-       if (context->newsearch) {
+       if ((context->newsearch) ||
+           (context->prev_case_sens != case_sensitive)) {
                bool res;
 
                if (context->string != NULL)
@@ -543,16 +590,15 @@ static void search_text(const char *string, int 
string_len,
 
 
 /* Exported function documented in search.h */
-void search_step(struct search_context *context, search_flags_t flags,
-               const char *string)
+void
+search_step(struct search_context *context,
+           search_flags_t flags,
+           const char *string)
 {
        int string_len;
        int i = 0;
 
-       if (context == NULL) {
-               guit->misc->warning("SearchError", 0);
-               return;
-       }
+       assert(context != NULL);
 
        guit->search->add_recent(string, context->gui_p);
 
@@ -598,44 +644,6 @@ bool search_term_highlighted(struct content *c,
 }
 
 
-/* Exported function documented in search.h */
-void search_show_all(bool all, struct search_context *context)
-{
-       struct list_entry *a;
-
-       for (a = context->found->next; a; a = a->next) {
-               bool add = true;
-               if (!all && a != context->current) {
-                       add = false;
-                       if (a->sel) {
-                               selection_clear(a->sel, true);
-                               selection_destroy(a->sel);
-                               a->sel = NULL;
-                       }
-               }
-               if (add && !a->sel) {
-
-                       if (context->is_html == true) {
-                               html_content *html = (html_content *)context->c;
-                               a->sel = selection_create(context->c, true);
-                               if (!a->sel)
-                                       continue;
-
-                               selection_init(a->sel, html->layout,
-                                               &html->len_ctx);
-                       } else {
-                               a->sel = selection_create(context->c, false);
-                               if (!a->sel)
-                                       continue;
-
-                               selection_init(a->sel, NULL, NULL);
-                       }
-
-                       selection_set_start(a->sel, a->start_idx);
-                       selection_set_end(a->sel, a->end_idx);
-               }
-       }
-}
 
 
 /* Exported function documented in search.h */
diff --git a/content/handlers/html/search.h b/content/handlers/html/search.h
index 5c9408e..dfb1afc 100644
--- a/content/handlers/html/search.h
+++ b/content/handlers/html/search.h
@@ -60,11 +60,6 @@ void search_destroy_context(struct search_context *context);
 void search_step(struct search_context *context, search_flags_t flags,
                const char * string);
 
-/**
- * Specifies whether all matches or just the current match should
- * be highlighted in the search text.
- */
-void search_show_all(bool all, struct search_context *context);
 
 /**
  * Determines whether any portion of the given text box should be


-- 
NetSurf Browser

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

Reply via email to