]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.cpp
cleanup and reorder initialisation code of GuiView and GuiToolbars. Move some things...
[lyx.git] / src / MenuBackend.cpp
index ac3cbfa33937f09778dcf08b3de347441eabb39c..8368f8e5c31e594eff262f06e264ff972fcaa85f 100644 (file)
@@ -35,6 +35,7 @@
 #include "LyXFunc.h"
 #include "Lexer.h"
 #include "Paragraph.h"
+#include "TextClass.h"
 #include "TocBackend.h"
 #include "ToolbarBackend.h"
 
@@ -139,16 +140,13 @@ docstring const MenuItem::binding(bool forgui) const
        // first one later
        KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(func_);
 
-       if (bindings.size()) {
+       if (bindings.size())
                return bindings.begin()->print(KeySequence::ForGui);
-       } else {
-               LYXERR(Debug::KBMAP)
-                       << "No binding for "
-                       << lyxaction.getActionName(func_.action)
-                       << '(' << to_utf8(func_.argument()) << ')' << endl;
-               return docstring();
-       }
 
+       LYXERR(Debug::KBMAP, "No binding for "
+               << lyxaction.getActionName(func_.action)
+               << '(' << to_utf8(func_.argument()) << ')');
+       return docstring();
 }
 
 
@@ -494,8 +492,9 @@ void expandDocuments(Menu & tomenu)
                
                // We cannot use a for loop as the buffer list cycles.
                do {
-                       docstring label = makeDisplayPath(b->absFileName(), 20);
-                       if (!b->isClean()) label = label + "*";
+                       docstring label = b->fileName().displayName(20);
+                       if (!b->isClean())
+                               label = label + "*";
                        if (ii < 10)
                                label = convert<docstring>(ii) + ". " + label + '|' + convert<docstring>(ii);
                        tomenu.add(MenuItem(MenuItem::Command, label,
@@ -507,7 +506,6 @@ void expandDocuments(Menu & tomenu)
        } else {
                tomenu.add(MenuItem(MenuItem::Command, _("No Documents Open!"),
                           FuncRequest(LFUN_NOACTION)));
-               return;
        }
 }