+2004-06-04 Angus Leeming <leeming@lyx.org>
+
+ * combox.c (combox_handle): prevent crash when trying to draw
+ non-existent 'button_state' button on an 'FL_NORMAL_COMBOX' combox.
+
2004-06-02 Lars Gullik Bjønnes <larsbj@lyx.org>
* forms/Makefile.am (.fd.C): Use '-r' to test for file existence,
case FL_DRAWLABEL: {
COMBOX_SPEC * sp = ob->spec;
- FL_Coord const xbs =
- ob->x + (sp->button_state->x - sp->button_chosen->x);
-
- if (ob->x != sp->button_chosen->x ||
- ob->y != sp->button_chosen->y ||
- xbs != sp->button_state->x ||
- ob->y != sp->button_state->y) {
+ int change =
+ ob->x != sp->button_chosen->x ||
+ ob->y != sp->button_chosen->y;
+
+ FL_Coord xbs = 0;
+ if (sp->button_state) {
+ xbs = ob->x + (sp->button_state->x - sp->button_chosen->x);
+ change = change ||
+ xbs != sp->button_state->x ||
+ ob->y != sp->button_state->y;
+ }
+ if (change) {
fl_freeze_form(ob->form);
fl_set_object_position(sp->button_chosen, ob->x, ob->y);
- fl_set_object_position(sp->button_state, xbs, ob->y);
+ if (sp->button_state)
+ fl_set_object_position(sp->button_state, xbs, ob->y);
fl_unfreeze_form(ob->form);
}