void expandToc(Menu & tomenu, Buffer const * buf)
{
+ if (!buf) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"), LFUN_NOACTION));
+ return;
+ }
+
FloatList const & floats = buf->params.getLyXTextClass().floats();
toc::TocList toc_list = toc::getTocList(buf);
toc::TocList::const_iterator cit = toc_list.begin();
{
const_iterator cit = find_if(begin(), end(),
lyx::compare_memfun(&Menu::name, name));
+ if (cit == end())
+ lyxerr << "No submenu named " << name << endl;
lyx::Assert(cit != end());
return (*cit);
}