+
+ if (buf == buf->masterBuffer())
+ return;
+
+ MenuDefinition child_branches;
+
+ BranchList::const_iterator ccit = params.branchlist().begin();
+ BranchList::const_iterator cend = params.branchlist().end();
+
+ for (int ii = 1; ccit != cend; ++ccit, ++ii) {
+ docstring label = ccit->branch();
+ if (ii < 10) {
+ label = convert<docstring>(ii) + ". " + label
+ + char_type('|') + convert<docstring>(ii);
+ }
+ child_branches.addWithStatusCheck(MenuItem(MenuItem::Command,
+ toqstr(label),
+ FuncRequest(LFUN_BRANCH_INSERT,
+ ccit->branch())));
+ }
+
+ if (!child_branches.empty()) {
+ MenuItem item(MenuItem::Submenu, qt_("Child Document"));
+ item.setSubmenu(child_branches);
+ add(item);
+ }