mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
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:
parent
3194afe343
commit
a94c091d9d
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user