mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
Code simplification.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31523 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b34763a4c8
commit
96f5fec524
@ -162,27 +162,13 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd.action) {
|
if (cmd.action == LFUN_UNKNOWN_ACTION) {
|
||||||
case LFUN_UNKNOWN_ACTION:
|
|
||||||
flag.unknown(true);
|
flag.unknown(true);
|
||||||
flag.setEnabled(false);
|
flag.setEnabled(false);
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag.unknown()) {
|
|
||||||
flag.message(from_utf8(N_("Unknown action")));
|
flag.message(from_utf8(N_("Unknown action")));
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flag.enabled()) {
|
|
||||||
if (flag.message().empty())
|
|
||||||
flag.message(from_utf8(N_("Command disabled")));
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
// I would really like to avoid having this switch and rather try to
|
// I would really like to avoid having this switch and rather try to
|
||||||
// encode this in the function itself.
|
// encode this in the function itself.
|
||||||
// -- And I'd rather let an inset decide which LFUNs it is willing
|
// -- And I'd rather let an inset decide which LFUNs it is willing
|
||||||
|
Loading…
Reference in New Issue
Block a user