- int const action = lyxaction.getPseudoAction(LFUN_PASTE,
- tostr(index));
- tomenu.add(MenuItem(MenuItem::Command, *cit, action));
+ tomenu.add(MenuItem(MenuItem::Command, *cit,
+ FuncRequest(LFUN_PASTE, tostr(index))));
+ }
+}
+
+
+void expandBranches(Menu & tomenu, LyXView const * view)
+{
+ if (!view || !view->buffer())
+ return;
+
+ BufferParams const & params = view->buffer()->params();
+
+ std::list<Branch>::const_iterator cit = params.branchlist().begin();
+ std::list<Branch>::const_iterator end = params.branchlist().end();
+
+ for (int ii = 1; cit != end; ++cit, ++ii) {
+ string label = cit->getBranch();
+ if (ii < 10)
+ label = tostr(ii) + ". " + label + "|" + tostr(ii);
+ tomenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_INSERT_BRANCH,
+ cit->getBranch())), view);