aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-11-21 16:10:05 +0100
committerSebastian Geerken <devnull@localhost>2013-11-21 16:10:05 +0100
commit4a1d3f2493053f97a2280a3606904b784a740475 (patch)
tree5b12e03a9d0b019f36eaac67bf67be91e78f06e5 /src
parent68d69bddbd6e5249b4174a6e7ba5ec91ee9cbf3e (diff)
parent4d1af64ac56cf2a7c43e602269e4e02eeb29ab13 (diff)
Merge with main repo.
Diffstat (limited to 'src')
-rw-r--r--src/form.cc37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/form.cc b/src/form.cc
index 843a63c2..8476b73b 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -785,14 +785,14 @@ void Html_tag_close_select(DilloHtml *html)
html->InFlags &= ~IN_OPTION;
DilloHtmlInput *input = Html_get_current_input(html);
- DilloHtmlSelect *select = input->select;
-
- if (input->type == DILLO_HTML_INPUT_SELECT) {
- // option menu interface requires that something be selected */
- select->ensureSelection ();
+ if (input) {
+ DilloHtmlSelect *select = input->select;
+ if (input->type == DILLO_HTML_INPUT_SELECT) {
+ // option menu interface requires that something be selected */
+ select->ensureSelection ();
+ }
+ select->addOptsTo ((SelectionResource*)input->embed->getResource());
}
- SelectionResource *res = (SelectionResource*)input->embed->getResource();
- select->addOptsTo (res);
}
}
@@ -814,9 +814,9 @@ void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
html->InFlags |= IN_OPTGROUP;
DilloHtmlInput *input = Html_get_current_input(html);
-
- if (input->type == DILLO_HTML_INPUT_SELECT ||
- input->type == DILLO_HTML_INPUT_SEL_LIST) {
+ if (input &&
+ (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST)) {
char *label = a_Html_get_attr_wdef(html, tag, tagsize, "label", NULL);
bool enabled = (a_Html_get_attr(html, tag, tagsize, "disabled") == NULL);
@@ -843,9 +843,9 @@ void Html_tag_close_optgroup(DilloHtml *html)
}
DilloHtmlInput *input = Html_get_current_input(html);
-
- if (input->type == DILLO_HTML_INPUT_SELECT ||
- input->type == DILLO_HTML_INPUT_SEL_LIST) {
+ if (input &&
+ (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST)) {
DilloHtmlOptgroupClose *opt = new DilloHtmlOptgroupClose ();
input->select->addOpt(opt);
@@ -867,9 +867,9 @@ void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
html->InFlags |= IN_OPTION;
DilloHtmlInput *input = Html_get_current_input(html);
-
- if (input->type == DILLO_HTML_INPUT_SELECT ||
- input->type == DILLO_HTML_INPUT_SEL_LIST) {
+ if (input &&
+ (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST)) {
char *value = a_Html_get_attr_wdef(html, tag, tagsize, "value", NULL);
char *label = a_Html_get_attr_wdef(html, tag, tagsize, "label", NULL);
bool selected = (a_Html_get_attr(html, tag, tagsize,"selected") != NULL);
@@ -2023,8 +2023,9 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
static void Html_option_finish(DilloHtml *html)
{
DilloHtmlInput *input = Html_get_current_input(html);
- if (input->type == DILLO_HTML_INPUT_SELECT ||
- input->type == DILLO_HTML_INPUT_SEL_LIST) {
+ if (input &&
+ (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST)) {
DilloHtmlOptbase *opt = input->select->getCurrentOpt ();
opt->setContent (html->Stash->str, html->Stash->len);
}