diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-07 06:22:15 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-07 06:22:15 +0000 |
commit | cbf55bd418814a943422dffacf37f18c4ab3e839 (patch) | |
tree | 8ad8fd9e6680856cdac9b0560045ffad99903d42 /desktop/browser.c | |
parent | 72520da221afb0b124bf65d973f81ab05b1402a0 (diff) | |
download | netsurf-cbf55bd418814a943422dffacf37f18c4ab3e839.tar.gz netsurf-cbf55bd418814a943422dffacf37f18c4ab3e839.tar.bz2 |
Fix textarea crash.
I cannot express just how much I hate the necessity of this change: browser windows (and other code in desktop/) should stop poking around inside content objects
svn path=/trunk/netsurf/; revision=10258
Diffstat (limited to 'desktop/browser.c')
-rw-r--r-- | desktop/browser.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index df53819c7..2b7c50740 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -2315,9 +2315,15 @@ void browser_window_form_select(struct browser_window *bw, struct box *inline_box; struct form_option *o; int count; + struct content *current_content; - assert(bw); - assert(control); + assert(bw != NULL); + assert(control != NULL); + assert(bw->current_content != NULL); + + /** \todo This must die. Browser windows have no business poking + * around inside contents */ + current_content = hlcache_handle_get_content(bw->current_content); inline_box = control->box->children->children; @@ -2346,13 +2352,13 @@ void browser_window_form_select(struct browser_window *bw, talloc_free(inline_box->text); inline_box->text = 0; if (control->data.select.num_selected == 0) - inline_box->text = talloc_strdup(bw->current_content, + inline_box->text = talloc_strdup(current_content, messages_get("Form_None")); else if (control->data.select.num_selected == 1) - inline_box->text = talloc_strdup(bw->current_content, + inline_box->text = talloc_strdup(current_content, control->data.select.current->text); else - inline_box->text = talloc_strdup(bw->current_content, + inline_box->text = talloc_strdup(current_content, messages_get("Form_Many")); if (!inline_box->text) { warn_user("NoMemory", 0); |