]> git.lyx.org Git - lyx.git/blobdiff - src/kbmap.C
remove more forms.h cruft
[lyx.git] / src / kbmap.C
index 51d9ecbfdc65117a0265c7de54cb30b7a3e6e8dc..13ec0039eafeae3814adc3ed6b07907bfda87e46 100644 (file)
@@ -4,13 +4,13 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #include <config.h>
 
-#include <cstring>
+//#include <cstring>
 #include <X11/Xlib.h>
 
 #ifdef __GNUG__
@@ -234,7 +234,7 @@ string const kb_keymap::keyname(kb_key const & k)
 
 
 // Finds a key for a keyaction, if possible
-string const kb_keymap::findbinding(int act) const
+string const kb_keymap::findbinding(int act, string const & prefix) const
 {
        string res;
        if (table.empty()) return res;
@@ -243,17 +243,13 @@ string const kb_keymap::findbinding(int act) const
        for (Table::const_iterator cit = table.begin();
            cit != end; ++cit) {
                if ((*cit).table.get()) {
-                       string suffix = (*cit).table->findbinding(act);
-                       suffix = strip(suffix, ' ');
-                       suffix = strip(suffix, ']');
-                       suffix = frontStrip(suffix, '[');
-                       if (!suffix.empty()) {
-                               res += "[" + keyname((*cit)) + " "
-                                       + suffix + "] ";
-                       }
+                       res += (*cit).table->findbinding(act,
+                                                        prefix
+                                                        + keyname((*cit))
+                                                        + " ");
                } else if ((*cit).action == act) {
                        res += "[";
-                       res += keyname((*cit));
+                       res += prefix + keyname((*cit));
                        res += "] ";
                }
        }