diff options
author | James Bursa <james@netsurf-browser.org> | 2003-10-27 00:34:09 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-10-27 00:34:09 +0000 |
commit | d3bd31c3a72f825abc6c0a01d4888136f69f3221 (patch) | |
tree | 9de287c665a24ce8fb4f97ed0d032b91109cb9cd /render | |
parent | d846800eb7c9919911f6feb42a7e161141bcaa4e (diff) | |
download | netsurf-d3bd31c3a72f825abc6c0a01d4888136f69f3221.tar.gz netsurf-d3bd31c3a72f825abc6c0a01d4888136f69f3221.tar.bz2 |
[project @ 2003-10-27 00:34:09 by bursa]
Fix controls which aren't inside a form.
svn path=/import/netsurf/; revision=393
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/render/box.c b/render/box.c index 4d0f155c2..16bfd23b7 100644 --- a/render/box.c +++ b/render/box.c @@ -782,7 +782,8 @@ struct result box_textarea(xmlNode *n, struct status *status, box->gadget = xcalloc(1, sizeof(struct form_control)); box->gadget->box = box; box->gadget->type = GADGET_TEXTAREA; - form_add_control(status->current_form, box->gadget); + if (status->current_form) + form_add_control(status->current_form, box->gadget); style->display = CSS_DISPLAY_INLINE_BLOCK; /* split the content at newlines and make an inline container with an @@ -832,7 +833,8 @@ struct result box_select(xmlNode *n, struct status *status, xmlNode *c, *c2; gadget->type = GADGET_SELECT; - form_add_control(status->current_form, gadget); + if (status->current_form) + form_add_control(status->current_form, gadget); gadget->data.select.multiple = false; if ((s = (char *) xmlGetProp(n, (const xmlChar *) "multiple"))) { @@ -1036,7 +1038,8 @@ struct result box_input(xmlNode *n, struct status *status, xmlFree(type); if (gadget != 0) { - form_add_control(status->current_form, gadget); + if (status->current_form) + form_add_control(status->current_form, gadget); gadget->name = (char *) xmlGetProp(n, (const xmlChar *) "name"); add_gadget_element(status->elements, gadget); } @@ -1116,7 +1119,8 @@ struct result box_button(xmlNode *n, struct status *status, if (type) xmlFree(type); - form_add_control(status->current_form, box->gadget); + if (status->current_form) + form_add_control(status->current_form, box->gadget); box->gadget->box = box; box->gadget->name = (char *) xmlGetProp(n, (const xmlChar *) "name"); box->gadget->value = (char *) xmlGetProp(n, (const xmlChar *) "value"); |