I take it that no-one else is suffering from crashes using the main window's 
scroll bar? (See earlier mail.) Is this something to do with xforms-0.89 I 
wonder? Why has the problem surfaced now and not before?

Anyway, find attached a patch that fixes possible crashes when resizing 
xforms dialogs. 

Actually, the patch is for dialogs derived only from FormBase, so the two 
classes not yet converted, FormTabular and FormGraphics may still crash. In 
fact, FormTabular definitely causes a crash if the dialog is made smaller 
than the tabs. I'm happy to fix this, but one thing at a time...

I decided that the cleanest thing to do was to set the minsize of ALL dialogs 
by doing it in FormBase::connect(). See attachment.

NOTE to anyone writing xforms dialogs:
============================
Reading the xforms documentation, I discovered that the correct place to call 
fl_set_form_minsize()/maxsize() is BEFORE a call to fl_show_form(). Moreover, 
it is in force only until the next call to fl_show_form().

QUESTION:
=========
Can someone explain why we pass pointers to the Dialog constructors. Eg:

        FormCitation::FormCitation(LyXView * lv, Dialogs * d)

lv and d both exist when the dialog is constructed. Why not pass 
(LyXView & lv), etc? In fact, since lv and d are never changed, they can be 
stored as references also.

Similarly with:

void FormCommand::showInset( InsetCommand * inset )
{
        if (inset == 0) return;  // maybe we should Assert this?
        ...
}

I think I'm right in saying that showInset is called only with a valid inset. 
In which case we should pass (InsetCommand & inset) and have no need to worry 
about Assert()ing anything.

Thoughts?

Angus


patch19Oct2000.bz2

Reply via email to