-//#ifdef WITH_WARNINGS
-//#warning Not working as it should.
-//#endif
-// I have no clue what is wrong with it... (Lgb)
-int LyXAction::getApproxFunc(string const & func) const
- // This func should perhaps also be able to return a list of all
- // actions that has func as a prefix. That should actually be quite
- // easy, just let it return a vector<int> or something.
-{
- int action = LookupFunc(func);
- if (action == LFUN_UNKNOWN_ACTION) {
- // func is not an action, but perhaps it is
- // part of one...check if it is prefix if one of the
- // actions.
- // Checking for prefix is not so simple, but
- // using a simple bounding function gives
- // a similar result. [ale 19981103]
- func_map::const_iterator fit =
- lyx_func_map.lower_bound(func);
-
- if (fit != lyx_func_map.end()) {
- action = fit->second;
- }
- } else { // Go get the next function
- func_map::const_iterator fit =
- lyx_func_map.upper_bound(func);
-
- if (fit != lyx_func_map.end()) {
- action = fit->second;
- }
- }
-
- return action;
-}
-
-
-string const LyXAction::getApproxFuncName(string const & func) const
-{
- int const f = getApproxFunc(func);
- // This will return empty string if f isn't an action.
- return getActionName(f);
-}
-
-