move handling of LFUN_SET_GRAPHICS_GROUP status where it belongs

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24940 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-05-26 09:08:30 +00:00
parent 3194afe343
commit a94c091d9d
2 changed files with 9 additions and 14 deletions

View File

@ -433,20 +433,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
bool enable = true;
switch (cmd.action) {
// FIXME optimally this should be in Text::getStatus. In such a case the flags
// are not passed when using context menu. This way it works.
case LFUN_SET_GRAPHICS_GROUP: {
if (!view())
break;
InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(view()->cursor());
if (!ins)
break;
if (!cmd.argument().empty())
flag.setOnOff(to_utf8(cmd.argument()) == ins->getParams().groupId);
enable = true;
break;
}
case LFUN_BUFFER_TOGGLE_READ_ONLY:
flag.setOnOff(buf->isReadonly());
break;

View File

@ -2182,6 +2182,15 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
enable = (cur.pos() > cur.paragraph().beginOfBody());
break;
case LFUN_SET_GRAPHICS_GROUP: {
InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur);
if (!ins)
enable = false;
else
flag.setOnOff(to_utf8(cmd.argument()) == ins->getParams().groupId);
break;
}
case LFUN_WORD_DELETE_FORWARD:
case LFUN_WORD_DELETE_BACKWARD:
case LFUN_LINE_DELETE: