fix command-sequence handling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8734 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-05-04 14:12:50 +00:00
parent fc09056ccc
commit 37b93beec5
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2004-05-03 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (dispatch):
(getStatus): fix handling of LFUN_SEQUENCE
2004-04-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* debug.C (showLevel): do not forget the end-of-line marker

View File

@ -437,6 +437,14 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
break;
}
// this one is difficult to get right. As a half-baked
// solution, we consider only the first action of the sequence
case LFUN_SEQUENCE: {
// argument contains ';'-terminated commands
string const firstcmd = token(cmd.argument, ';', 0);
flag = getStatus(lyxaction.lookupFunc(firstcmd));
}
case LFUN_MENUNEW:
case LFUN_MENUNEWTMPLT:
case LFUN_WORDFINDFORWARD:
@ -477,7 +485,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
case LFUN_REPEAT:
case LFUN_EXPORT_CUSTOM:
case LFUN_PRINT:
case LFUN_SEQUENCE:
case LFUN_SAVEPREFERENCES:
case LFUN_SCREEN_FONT_UPDATE:
case LFUN_SET_COLOR:
@ -1191,14 +1198,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
break;
}
case LFUN_SEQUENCE:
case LFUN_SEQUENCE: {
// argument contains ';'-terminated commands
while (!argument.empty()) {
string arg = argument;
while (!arg.empty()) {
string first;
string rest = split(argument, first, ';');
dispatch(lyxaction.lookupFunc(rest));
arg = split(arg, first, ';');
dispatch(lyxaction.lookupFunc(first));
}
break;
}
case LFUN_SAVEPREFERENCES: {
Path p(user_lyxdir());