aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-11-18 00:51:11 +0100
committerSebastian Geerken <devnull@localhost>2013-11-18 00:51:11 +0100
commit69afabf89b19f1c57cb7de966b1a9e4b50645ded (patch)
tree182ce86cd5b58ac80b6cccd250a1a34994968e5c /src
parent1346a5fa9aa365e24724586adcb39746588712bf (diff)
parent0ff5581158180cde9d49c507aacd5d1a4e1a5b53 (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 a91e170b..b6df56f5 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);
@@ -2027,8 +2027,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);
}