From d3bd31c3a72f825abc6c0a01d4888136f69f3221 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 27 Oct 2003 00:34:09 +0000 Subject: [project @ 2003-10-27 00:34:09 by bursa] Fix controls which aren't inside a form. svn path=/import/netsurf/; revision=393 --- render/box.c | 12 ++++++++---- 1 file 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"); -- cgit v1.2.3