]> git.lyx.org Git - features.git/blobdiff - src/KeyMap.cpp
Clean up a bit.
[features.git] / src / KeyMap.cpp
index c6d355c237ce31a8f19d0c6586c71a79ed1d1b57..7cc25765ab04470a55feff6b4803ef910591f4cd 100644 (file)
@@ -3,10 +3,10 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  * \author John Levon
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -262,8 +262,7 @@ FuncRequest const & KeyMap::lookup(KeySymbol const &key,
                  KeyModifier mod, KeySequence * seq) const
 {
        if (table.empty()) {
-               seq->curmap = seq->stdmap;
-               seq->mark_deleted();
+               seq->reset();
                return FuncRequest::unknown;
        }
 
@@ -281,16 +280,14 @@ FuncRequest const & KeyMap::lookup(KeySymbol const &key,
                                return prefix;
                        } else {
                                // final key - reset map
-                               seq->curmap = seq->stdmap;
-                               seq->mark_deleted();
+                               seq->reset();
                                return cit->func;
                        }
                }
        }
 
        // error - key not found:
-       seq->curmap = seq->stdmap;
-       seq->mark_deleted();
+       seq->reset();
 
        return FuncRequest::unknown;
 }
@@ -397,7 +394,8 @@ void KeyMap::unbind(KeySequence * seq, FuncRequest const & func, unsigned int r)
 }
 
 
-docstring KeyMap::printBindings(FuncRequest const & func) const
+docstring KeyMap::printBindings(FuncRequest const & func,
+                               KeySequence::outputFormat format) const
 {
        Bindings bindings = findBindings(func);
        if (bindings.empty())
@@ -406,11 +404,11 @@ docstring KeyMap::printBindings(FuncRequest const & func) const
        odocstringstream res;
        Bindings::const_iterator cit = bindings.begin();
        Bindings::const_iterator cit_end = bindings.end();
-       // prin the first item
-       res << cit->print(KeySequence::ForGui);
+       // print the first item
+       res << cit->print(format);
        // more than one shortcuts?
        for (++cit; cit != cit_end; ++cit)
-               res << ", " << cit->print(KeySequence::ForGui);
+               res << ", " << cit->print(format);
        return res.str();
 }