]> git.lyx.org Git - lyx.git/blobdiff - src/KeySequence.cpp
Cosmetics.
[lyx.git] / src / KeySequence.cpp
index c13c41ecdfaf08c81665fafd7323111db7236864..19677388749c217632e20a256fd3f84aef37ba7e 100644 (file)
 #include "KeyMap.h"
 #include "lfuns.h"
 
-#include "frontends/LyXKeySym.h"
-#include "frontends/LyXKeySymFactory.h"
-
-
-namespace lyx {
+#include "frontends/KeySymbol.h"
 
 using std::make_pair;
 using std::string;
 
 
-FuncRequest const &
-KeySequence::addkey(LyXKeySymPtr key,
-                   key_modifier::state mod, key_modifier::state nmod)
+namespace lyx {
+
+FuncRequest const & KeySequence::addkey(KeySymbol const & key,
+       key_modifier::state mod, key_modifier::state nmod)
 {
        // adding a key to a deleted sequence
        // starts a new sequence
@@ -108,10 +105,10 @@ size_t KeySequence::parse(string const & s)
                        for (; j < s.length() && s[j] != ' '; ++j)
                                tbuf += s[j];    // (!!!check bounds :-)
 
-                       LyXKeySymPtr key(LyXKeySymFactory::create());
-                       key->init(tbuf);
+                       KeySymbol key;
+                       key.init(tbuf);
 
-                       if (!key->isOK())
+                       if (!key.isOK())
                                return j;
 
                        i = j;
@@ -136,10 +133,10 @@ docstring const KeySequence::print(bool forgui) const
 
        size_t const length = sequence.size();
 
-       for (size_t i = 0; i < length; ++i) {
-               buf += sequence[i]->print(modifiers[i].first, forgui);
+       for (size_t i = 0; i != length; ++i) {
+               buf += sequence[i].print(modifiers[i].first, forgui);
                // append a blank
-               if (i + 1 < length)
+               if (i + 1 != length)
                        buf += ' ';
        }
        return buf;
@@ -148,9 +145,7 @@ docstring const KeySequence::print(bool forgui) const
 
 docstring const KeySequence::printOptions(bool forgui) const
 {
-       docstring buf;
-
-       buf += print(forgui);
+       docstring buf = print(forgui);
 
        if (!curmap)
                return buf;
@@ -173,6 +168,7 @@ void KeySequence::reset()
        curmap = stdmap;
 }
 
+
 void KeySequence::clear()
 {
        sequence.clear();