switch (cmd.action) {
// suppress these
case LFUN_ERT_INSERT:
- status.enabled(false);
+ status.setEnabled(false);
return true;
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
string const newtype = cmd.getArg(1);
- status.enabled(p_.isCompatibleCommand(p_.code(), newtype));
+ status.setEnabled(p_.isCompatibleCommand(p_.code(), newtype));
status.setOnOff(newtype == p_.getCmdName());
- } else
- status.enabled(true);
+ }
+ status.setEnabled(true);
return true;
case LFUN_INSET_DIALOG_UPDATE:
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
params.clear();
if (in.empty())
return false;
-
istringstream data(in);
Lexer lex;
lex.setStream(data);
-
- string n;
- lex >> n;
- if (!lex || n != name) {
- LYXERR0("InsetCommand::string2params(" << in << ")\n"
- "Expected arg 1 to be \"" << name << "\"\n");
- return false;
- }
-
- // This is part of the inset proper that is usually swallowed
- // by Text::readInset
- string id;
- lex >> id;
- if (!lex || id != "CommandInset") {
- LYXERR0("InsetCommand::string2params(" << in << ")\n"
- "Expected arg 2 to be \"CommandInset\"\n");
- return false;
- }
-
+ lex.setContext("InsetCommand::string2params");
+ lex >> name.c_str(); // check for name
+ lex >> "CommandInset";
params.read(lex);
return true;
}