]> git.lyx.org Git - lyx.git/blobdiff - src/KeySequence.cpp
Cleanup the TEXT_TO_INSET_OFFSET mess. This correction is done now once in InsetText...
[lyx.git] / src / KeySequence.cpp
index 9f25e9b0ab89e7615b4854d4f11670605e87d4ba..510e202ebbe532c69c0e16e9dc139f72ac5b171b 100644 (file)
 
 #include "frontends/KeySymbol.h"
 
-
-namespace lyx {
-
 using std::make_pair;
 using std::string;
 
 
-FuncRequest const &
-KeySequence::addkey(KeySymbolPtr 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
@@ -107,10 +105,10 @@ size_t KeySequence::parse(string const & s)
                        for (; j < s.length() && s[j] != ' '; ++j)
                                tbuf += s[j];    // (!!!check bounds :-)
 
-                       KeySymbolPtr key(createKeySymbol());
-                       key->init(tbuf);
+                       KeySymbol key;
+                       key.init(tbuf);
 
-                       if (!key->isOK())
+                       if (!key.isOK())
                                return j;
 
                        i = j;
@@ -135,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;