From 37b93beec5201a2c840e4f53c5e6c11002e02884 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 4 May 2004 14:12:50 +0000 Subject: [PATCH] fix command-sequence handling git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8734 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/lyxfunc.C | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a142cabb5e..e91d34ea25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-05-03 Jean-Marc Lasgouttes + + * lyxfunc.C (dispatch): + (getStatus): fix handling of LFUN_SEQUENCE + 2004-04-29 Jean-Marc Lasgouttes * debug.C (showLevel): do not forget the end-of-line marker diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 4517a7e0ab..0f8d467424 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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()); -- 2.39.2