From 5526d7e6f2e071a115359f6b9c0dca7b2c4c4efe Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 14 Aug 2012 14:03:54 +0100 Subject: Stop render/search.c from dereferencing bw and remove dependency on html & text contents' bw pointer. --- render/search.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'render/search.c') 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" @@ -75,26 +74,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 @@ -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); -- cgit v1.2.3