+void expandPasteRecent(Menu & tomenu, LyXView const * view)
+{
+ if (!view || !view->buffer())
+ return;
+
+ vector<string> const sel =
+ lyx::cap::availableSelections(*view->buffer());
+
+ vector<string>::const_iterator cit = sel.begin();
+ vector<string>::const_iterator end = sel.end();
+
+ for (unsigned int index = 0; cit != end; ++cit, ++index) {
+ tomenu.add(MenuItem(MenuItem::Command, *cit,
+ FuncRequest(LFUN_PASTE, convert<string>(index))));
+ }
+}
+
+
+void expandBranches(Menu & tomenu, LyXView const * view)
+{
+ if (!view || !view->buffer())
+ return;
+
+ BufferParams const & params = view->buffer()->getMasterBuffer()->params();
+
+ BranchList::const_iterator cit = params.branchlist().begin();
+ BranchList::const_iterator end = params.branchlist().end();
+
+ for (int ii = 1; cit != end; ++cit, ++ii) {
+ string label = cit->getBranch();
+ if (ii < 10)
+ label = convert<string>(ii) + ". " + label + "|" + convert<string>(ii);
+ tomenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_INSERT_BRANCH,
+ cit->getBranch())), view);
+ }
+}
+
+