]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.C
Helge's infamous brackets bug
[lyx.git] / src / MenuBackend.C
index 97fd3a7d4f0300539641adc7092907e321b9622c..89101d55e66943ca0ef604845eae7eea5bf32f96 100644 (file)
@@ -666,7 +666,9 @@ void expandToc(Menu & tomenu, LyXView const * view)
        // know that all the entries in a TOC will be have status_ ==
        // OK, so we avoid this unnecessary overhead (JMarc)
 
-       if (!view->buffer()) {
+
+       Buffer const * buf = view->buffer();
+       if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
                                    _("No Documents Open!"),
                                    FuncRequest(LFUN_NOACTION)),
@@ -674,7 +676,8 @@ void expandToc(Menu & tomenu, LyXView const * view)
                return;
        }
 
-       lyx::toc::TocList toc_list = lyx::toc::getTocList(*view->buffer());
+       FloatList const & floatlist = buf->params().getLyXTextClass().floats();
+       lyx::toc::TocList toc_list = lyx::toc::getTocList(*buf);
        lyx::toc::TocList::const_iterator cit = toc_list.begin();
        lyx::toc::TocList::const_iterator end = toc_list.end();
        for (; cit != end; ++cit) {
@@ -692,8 +695,7 @@ void expandToc(Menu & tomenu, LyXView const * view)
                                           label,
                                           FuncRequest(ccit->action())));
                }
-               string const & floatName = cit->first;
-               // Is the _(...) really needed here? (Lgb)
+               string const & floatName = floatlist.getType(cit->first).listName();
                MenuItem item(MenuItem::Submenu, _(floatName));
                item.submenu(menu.release());
                tomenu.add(item);
@@ -735,10 +737,10 @@ void expandBranches(Menu & tomenu, LyXView const * view)
        if (!view || !view->buffer())
                return;
 
-       BufferParams const & params = view->buffer()->params();
+       BufferParams const & params = view->buffer()->getMasterBuffer()->params();
 
-       std::list<Branch>::const_iterator cit = params.branchlist().begin();
-       std::list<Branch>::const_iterator end = params.branchlist().end();
+       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();