Jean-Marc Lasgouttes wrote:

> Angus: I see this too. Could you have a look? the crash is in
> combox.c.

Strange that this never came up before, because the bug has always
been there. Patch attached. Committing now.

-- 
Angus
Index: src/frontends/xforms/combox.c
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/combox.c,v
retrieving revision 1.6
diff -u -p -r1.6 combox.c
--- src/frontends/xforms/combox.c	28 Apr 2004 10:21:37 -0000	1.6
+++ src/frontends/xforms/combox.c	4 Jun 2004 13:13:59 -0000
@@ -377,17 +377,24 @@ combox_handle(FL_OBJECT * ob, int event,
     case FL_DRAWLABEL: {
 	COMBOX_SPEC * sp = ob->spec;
 
-	FL_Coord const xbs =
-	    ob->x + (sp->button_state->x - sp->button_chosen->x);
+	int change =
+	    ob->x != sp->button_chosen->x ||
+	    ob->y != sp->button_chosen->y;
 
-	if (ob->x != sp->button_chosen->x ||
-	    ob->y != sp->button_chosen->y ||
-	    xbs   != sp->button_state->x ||
-	    ob->y != sp->button_state->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);
 	}
 

Reply via email to