>>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:

Martin> Now added (at Juergen's request) dynamic menu items for
Martin> inserting Branch insets. Attached the files that changed.

The code related to menu backend seems fine to me, except for the
following function:

+void expandBranches(Menu & tomenu, LyXView const * view)
+{
+       int ii = 1;

why isn't this declared in the for() statement?

+       BufferParams params = view->buffer()->params;
+
+       std::list<Branch>::const_iterator cit = params.branchlist.begin();
+       std::list<Branch>::const_iterator end = params.branchlist.end();
+       
+       for (; cit != end && ii < 10; ++cit, ++ii) {

You limit your self artificially to 10 branches by doing this. Why?
The code in expandDocuments has more flexibility.

+               string const label = tostr(ii) + " " +

Is numbering branches the best way to give shortcuts to them? Couldn't
you declare shortcuts in the branch names somehow?

+                               (cit->getSelected() ? "*" : " ") +

I do not like this way of marking selected branches like that. Is this
needed in an Insert menu?

+                               cit->getBranch() + " " + "|" + tostr(ii);

use
                                cit->getBranch() + '|' + tostr(ii);
instead.



JMarc

Reply via email to