Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (revision 16960) +++ apps/gui/wps_parser.c (working copy) @@ -463,7 +463,39 @@ token->value.i = n | (subimage << 8); return 2; /* We have consumed 2 bytes */ } else { + /* insert the first sub-image here */ token->value.i = n; + + /* and if it's inside a conditional list, insert all of the remaining + * sub-images as well */ + if (level >= 0) + for (subimage = 1; subimage < wps_data->img[n].num_subimages; ++subimage) + { + wps_data->num_tokens++; + token++; + + /* add a conditional option ("|") token */ + + token->type = WPS_TOKEN_CONDITIONAL_OPTION; + if (lastcond[level]) + wps_data->tokens[lastcond[level]].value.i = wps_data->num_tokens; + else + { + return PARSE_FAIL_COND_SYNTAX_ERROR; /* FIXME: is this correct? */ + } + + lastcond[level] = wps_data->num_tokens; + numoptions[level]++; + + wps_data->num_tokens++; + token++; + + /* now add the next sub-image! */ + + token->type = WPS_TOKEN_IMAGE_PRELOAD_DISPLAY; + token->value.i = n | (subimage << 8); + } + return 1; /* We have consumed 1 byte */ } }