cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21391 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-11-02 21:27:37 +00:00
parent 47cd08999c
commit c08309a9e2
5 changed files with 16 additions and 21 deletions

View File

@ -429,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();
@ -447,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;

View File

@ -22,7 +22,6 @@
#include <boost/shared_ptr.hpp>
#include <vector>
#include <deque>
namespace lyx {
@ -91,13 +90,13 @@ public:
lookup(KeySymbol const & key, KeyModifier mod, KeySequence * seq) const;
///
typedef std::deque<KeySequence> Bindings;
typedef std::vector<KeySequence> Bindings;
/// Given an action, find all keybindings.
Bindings findbindings(FuncRequest const & func) const;
Bindings findBindings(FuncRequest const & func) const;
/// Given an action, print the keybindings.
docstring const printbindings(FuncRequest const & func) const;
docstring printBindings(FuncRequest const & func) const;
struct Binding {
Binding(FuncRequest const & r, KeySequence const & s, int t)
@ -139,13 +138,10 @@ private:
struct Key {
/// Keysym
KeySymbol code;
/// Modifier masks
ModifierPair mod;
/// Keymap for prefix keys
boost::shared_ptr<KeyMap> table;
/// Action for !prefix keys
FuncRequest func;
};
@ -155,7 +151,7 @@ private:
* @param func the action
* @param prefix a sequence to prepend the results
*/
Bindings findbindings(FuncRequest const & func,
Bindings findBindings(FuncRequest const & func,
KeySequence const & prefix) const;
void listBindings(BindingList & list, KeySequence const & prefix,

View File

@ -2141,7 +2141,7 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd
}
}
docstring const shortcuts = theTopLevelKeymap().printbindings(cmd);
docstring const shortcuts = theTopLevelKeymap().printBindings(cmd);
if (!shortcuts.empty())
comname += ": " + shortcuts;

View File

@ -137,7 +137,7 @@ docstring const MenuItem::binding(bool forgui) const
// Get the keys bound to this action, but keep only the
// first one later
KeyMap::Bindings bindings = theTopLevelKeymap().findbindings(func_);
KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(func_);
if (bindings.size()) {
return bindings.begin()->print(KeySequence::ForGui);

View File

@ -182,7 +182,7 @@ void InsetInfo::updateInfo()
case SHORTCUT_INFO: {
FuncRequest func = lyxaction.lookupFunc(name_);
if (func.action != LFUN_UNKNOWN_ACTION)
setText(theTopLevelKeymap().printbindings(func),
setText(theTopLevelKeymap().printBindings(func),
bp_.getFont(), false);
break;
}