summaryrefslogtreecommitdiff
path: root/render/search.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-08-14 14:03:54 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-08-14 14:03:54 +0100
commit5526d7e6f2e071a115359f6b9c0dca7b2c4c4efe (patch)
tree74e72ab157ae3c7177aae24d4ff62fa586096535 /render/search.c
parentb51816c222dded2095fc2d5c1581575540095f43 (diff)
downloadnetsurf-5526d7e6f2e071a115359f6b9c0dca7b2c4c4efe.tar.gz
netsurf-5526d7e6f2e071a115359f6b9c0dca7b2c4c4efe.tar.bz2
Stop render/search.c from dereferencing bw and remove dependency on html & text contents' bw pointer.
Diffstat (limited to 'render/search.c')
-rw-r--r--render/search.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/render/search.c b/render/search.c
index 70ff3337e..d30c43f11 100644
--- a/render/search.c
+++ b/render/search.c
@@ -30,7 +30,6 @@
#include "content/content.h"
#include "content/hlcache.h"
-#include "desktop/browser.h"
#include "desktop/gui.h"
#include "desktop/selection.h"
#include "render/box.h"
@@ -76,26 +75,6 @@ struct search_context {
/**
- * Find the browser window that contains the content associated with a search
- *
- * \param search search context
- * \return the browser window, or NULL if none
- */
-static struct browser_window *search_get_browser_window(
- struct search_context *search)
-{
- if (search->c != NULL) {
- if (search->is_html == true) {
- return html_get_browser_window(search->c);
- } else {
- return textplain_get_browser_window(search->c);
- }
- }
- return NULL;
-}
-
-
-/**
* create a search_context
* \param h the hlcache_handle the search_context is connected to
* \param callbacks the callbacks to modify appearance according to results
@@ -722,13 +701,11 @@ void search_destroy_context(struct search_context *context)
{
assert(context != NULL);
- if (context->c != NULL) {
- struct browser_window *bw = search_get_browser_window(context);
+ if (context->callbacks.invalidate != NULL) {
+ context->callbacks.invalidate(context, context->callbacks.p);
+ }
- /* TODO: don't poke inside bw */
- if (bw->cur_search == context) {
- bw->cur_search = NULL;
- }
+ if (context->c != NULL) {
if (context->is_html)
html_set_search(context->c, NULL);