]> git.lyx.org Git - lyx.git/blobdiff - src/KeyMap.cpp
Further cleanup of InsetFlex, InsetCollapsable and InsetLayout:
[lyx.git] / src / KeyMap.cpp
index 04a3bbcb338c4a615a81859b1565beb17a899023..5f90aa3042d7044cd3c6c91f7c201e560f694b5d 100644 (file)
@@ -31,7 +31,6 @@ using std::endl;
 using std::ios;
 using std::ofstream;
 using std::string;
-using boost::make_tuple;
 
 
 namespace lyx {
@@ -270,11 +269,11 @@ void KeyMap::write(string const & bind_file, bool append, bool unbind) const
        BindingList::const_iterator it = list.begin();
        BindingList::const_iterator it_end = list.end();
        for (; it != it_end; ++it) {
-               kb_action action = it->get<0>().action;
-               string arg = to_utf8(it->get<0>().argument());
+               kb_action action = it->request.action;
+               string arg = to_utf8(it->request.argument());
 
                os << tag << " \""
-                               << to_utf8(it->get<1>().print(KeySequence::BindFile))
+                               << to_utf8(it->sequence.print(KeySequence::BindFile))
                                << "\" \""
                                << lyxaction.getActionName(action)
                                << (arg.empty() ? "" : " ") << arg
@@ -430,9 +429,9 @@ void KeyMap::unbind(KeySequence * seq, FuncRequest const & func, unsigned int r)
 }
 
 
-docstring const KeyMap::printbindings(FuncRequest const & func) const
+docstring KeyMap::printBindings(FuncRequest const & func) const
 {
-       Bindings bindings = findbindings(func);
+       Bindings bindings = findBindings(func);
        if (bindings.empty())
                return docstring();
        
@@ -448,26 +447,25 @@ docstring const KeyMap::printbindings(FuncRequest const & func) const
 }
 
 
-KeyMap::Bindings KeyMap::findbindings(FuncRequest const & func) const
+KeyMap::Bindings KeyMap::findBindings(FuncRequest const & func) const
 {
-       return findbindings(func, KeySequence(0, 0));
+       return findBindings(func, KeySequence(0, 0));
 }
 
 
-KeyMap::Bindings KeyMap::findbindings(FuncRequest const & func,
+KeyMap::Bindings KeyMap::findBindings(FuncRequest const & func,
                        KeySequence const & prefix) const
 {
        Bindings res;
-       if (table.empty()) return res;
+       if (table.empty())
+               return res;
 
        Table::const_iterator end = table.end();
-       for (Table::const_iterator cit = table.begin();
-           cit != end; ++cit) {
+       for (Table::const_iterator cit = table.begin(); cit != end; ++cit) {
                if (cit->table.get()) {
                        KeySequence seq = prefix;
                        seq.addkey(cit->code, cit->mod.first);
-                       Bindings res2 =
-                               cit->table->findbindings(func, seq);
+                       Bindings res2 = cit->table->findBindings(func, seq);
                        res.insert(res.end(), res2.begin(), res2.end());
                } else if (cit->func == func) {
                        KeySequence seq = prefix;
@@ -493,12 +491,12 @@ KeyMap::BindingList KeyMap::listBindings(bool unbound, int tag) const
                        BindingList::const_iterator it = list.begin();
                        BindingList::const_iterator it_end = list.end();
                        for (; it != it_end; ++it)
-                               if (it->get<0>().action == action) {
+                               if (it->request.action == action) {
                                        has_action = true;
                                        break;
                                }
                        if (!has_action)
-                               list.push_back(make_tuple(action, KeySequence(0, 0), tag));
+                               list.push_back(Binding(FuncRequest(action), KeySequence(0, 0), tag));
                }       
        }
        return list;
@@ -519,7 +517,7 @@ void KeyMap::listBindings(BindingList & list,
                } else {
                        KeySequence seq = prefix;
                        seq.addkey(it->code, it->mod.first);
-                       list.push_back(make_tuple(it->func, seq, tag));
+                       list.push_back(Binding(it->func, seq, tag));
                }
        }
 }