]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QLPopupMenu.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QLPopupMenu.C
index 5c130876c4a934bf2e04665f9d5ee113008f8eed..863243d42cf992fd5fdd46fa19f06149973f7383 100644 (file)
 #include "lyxfunc.h"
 #include "kbmap.h"
 #include "debug.h"
+
 #include "QtView.h"
 
 #include "QLPopupMenu.h"
 
 #include <boost/scoped_ptr.hpp>
+
 using std::pair;
 using std::make_pair;
+
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
+
 namespace {
 
 string const getLabel(MenuItem const & mi)
@@ -44,16 +44,16 @@ string const getLabel(MenuItem const & mi)
        string::size_type pos = label.find(shortcut);
        if (pos == string::npos)
                return label;
-       label.insert(pos, "&");
+       label.insert(pos, 1, '&');
+
        if (mi.kind() == MenuItem::Command) {
                // FIXME: backend should do this
                string const accel(toplevel_keymap->findbinding(mi.action()));
-               
+
                if (!accel.empty()) {
-                       label += "\t" + accel.substr(1, accel.find(']') - 1);
+                       label += '\t' + accel.substr(1, accel.find(']') - 1);
                }
-               
+
                lyxerr[Debug::GUI] << "Label: " << mi.label()
                                   << " Shortcut: " << mi.shortcut()
                                   << " Accel: " << accel << endl;