>>>>> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:
Dekel> 2) The menus for chapter 14-25 are disabled (grayed out). This
Dekel> happens as there is a limit of 32 submenus in the XForms
Dekel> library. However, this limit can be changed. I've attached a
Dekel> patch that increases the limit from 32 to 128 (patch.gz).
Dekel> Note to lyx-devel: The patch is for lyx-1.1.5fix1. Should it be
Dekel> applied to the 1.1.5 branch? Increasing the maximum number of
Dekel> pups doesn't seem to affect performance, though it costs ~400
Dekel> bytes per pup, so the increase 32->128 takes about ~40 Kb of
Dekel> memory. An alternative approach is to increase the maximum
Dekel> number of pups only when needed, which is done in patch2.gz.
Dekel> However, the xforms documentation doesn't say if it is legal to
Dekel> call to fl_setpup_maxpup() in the middle of the program, when
Dekel> some pups are already defined.
After looking at the documentation, it seems that fl_setpup_maxpup()
is safe to use when there already are popups defined, which means that
you second patch is probably a better approach. Note also that the
max_number_of_menus variable is not really necessary, since
fl_setup_maxpup(0) returns exactly this value (and does nothing).
Finally, it does not really have a reason to fail, unless memory is
severely full.
However, I am not sure the patch is always the right solution, since
there may be other places where the number of popups is not high
enough.
What about a simple solution: at the beginning of Menus:ShowTocMenu(),
add a
fl_setpup_maxpup(max_number_of_menus);
which ensures we have atleast this number of menus, and costs
virtually nothing in terms of time.
JMarc