]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.cpp
do what the FIXME suggested
[lyx.git] / src / MenuBackend.cpp
index 9959bd0d4c083a2e3d0cd082bcc54eb00a0d86f1..de7172f5d0bfa8436591fc56391729786c231207 100644 (file)
@@ -598,8 +598,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
                return;
        }
 
-       FloatList const & floats =
-               buf->params().getTextClass().floats();
+       FloatList const & floats = buf->params().documentClass().floats();
        FloatList::const_iterator cit = floats.begin();
        FloatList::const_iterator end = floats.end();
        for (; cit != end; ++cit) {
@@ -620,8 +619,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
                return;
        }
 
-       FloatList const & floats =
-               buf->params().getTextClass().floats();
+       FloatList const & floats = buf->params().documentClass().floats();
        FloatList::const_iterator cit = floats.begin();
        FloatList::const_iterator end = floats.end();
        for (; cit != end; ++cit) {
@@ -642,10 +640,10 @@ void expandFlexInsert(Menu & tomenu, Buffer const * buf, string s)
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
-       InsetLayouts const & insetlayouts =
-               buf->params().getTextClass().insetlayouts();
-       InsetLayouts::const_iterator cit = insetlayouts.begin();
-       InsetLayouts::const_iterator end = insetlayouts.end();
+       TextClass::InsetLayouts const & insetLayouts =
+               buf->params().documentClass().insetLayouts();
+       TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin();
+       TextClass::InsetLayouts::const_iterator end = insetLayouts.end();
        for (; cit != end; ++cit) {
                docstring const label = cit->first;
                if (cit->second.lyxtype() == s)
@@ -743,7 +741,7 @@ void expandToc(Menu & tomenu, Buffer const * buf)
                tomenu.add(MenuItem(MenuItem::Command, _("Master Document"), f));
        }
 
-       FloatList const & floatlist = buf->params().getTextClass().floats();
+       FloatList const & floatlist = buf->params().documentClass().floats();
        TocList const & toc_list = buf->tocBackend().tocs();
        TocList::const_iterator cit = toc_list.begin();
        TocList::const_iterator end = toc_list.end();
@@ -780,6 +778,10 @@ void expandToc(Menu & tomenu, Buffer const * buf)
                        label = _("List of Notes");
                else if (cit->first == "footnote")
                        label = _("List of Foot notes");
+               else if (cit->first == "label")
+                       label = _("Labels and References");
+               else if (cit->first == "citation")
+                       label = _("List of Citations");
                // this should not happen now, but if something else like
                // listings is added later, this can avoid an empty menu name.
                else
@@ -801,13 +803,9 @@ void expandToc(Menu & tomenu, Buffer const * buf)
 }
 
 
-void expandPasteRecent(Menu & tomenu, Buffer const * buf)
+void expandPasteRecent(Menu & tomenu)
 {
-       if (!buf)
-               return;
-
-       vector<docstring> const sel =
-               cap::availableSelections(*buf);
+       vector<docstring> const sel = cap::availableSelections();
 
        vector<docstring>::const_iterator cit = sel.begin();
        vector<docstring>::const_iterator end = sel.end();
@@ -929,7 +927,7 @@ void MenuBackend::expand(Menu const & frommenu, Menu & tomenu,
                        break;
 
                case MenuItem::PasteRecent:
-                       expandPasteRecent(tomenu, buf);
+                       expandPasteRecent(tomenu);
                        break;
 
                case MenuItem::Toolbars: