From 3f7c60107842e822922c7d954aac6f76e56cfda3 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 22 Apr 2010 14:37:32 +0000 Subject: Ensure we can search textplain again svn path=/trunk/netsurf/; revision=10454 --- desktop/search.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/desktop/search.c b/desktop/search.c index f84f1f06e..4598e60f7 100644 --- a/desktop/search.c +++ b/desktop/search.c @@ -239,7 +239,7 @@ void search_text(const char *string, int string_len, { struct rect bounds; hlcache_handle *c; - struct box *box; + struct box *box = NULL; bool case_sensitive, forwards, showall; case_sensitive = ((flags & SEARCH_FLAG_CASE_SENSITIVE) != 0) ? @@ -255,11 +255,13 @@ void search_text(const char *string, int string_len, if ((!c) || (content_get_type(c) != CONTENT_HTML && content_get_type(c) != CONTENT_TEXTPLAIN)) return; + + if (content_get_type(c) == CONTENT_HTML) { + box = html_get_box_tree(c); - box = html_get_box_tree(c); - - if (!box) - return; + if (!box) + return; + } /* LOG(("do_search '%s' - '%s' (%p, %p) %p (%d, %d) %d", search_data.string, string, search_data.content, c, search_data.found->next, -- cgit v1.2.3