]> git.lyx.org Git - features.git/commitdiff
Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=5008 .
authorPavel Sanda <sanda@lyx.org>
Thu, 10 Jul 2008 23:35:12 +0000 (23:35 +0000)
committerPavel Sanda <sanda@lyx.org>
Thu, 10 Jul 2008 23:35:12 +0000 (23:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25553 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/insets/InsetCommand.cpp

index 8dd7205ca219555762d3cc947f28d310d5158c49..4f240b5340125198e40659f296ed812026828bab 100644 (file)
@@ -1457,7 +1457,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                            || inset_code == it->lyxCode())) {
                                Cursor tmpcur = cur;
                                tmpcur.pushBackward(*it);
-                               it->dispatch(tmpcur, fr);
+                               FuncStatus flag;
+                               it->getStatus(tmpcur, fr, flag);
+                               if (flag.enabled())
+                                       it->dispatch(tmpcur, fr);
                        }
                }
                processUpdateFlags(Update::Force | Update::FitCursor);
index 745cfeca8a1e0956ed43abbeeaf7d1c52a25bebc..3e87b7fa1dc6f0536e3137007e6e68bf9eb9b7f3 100644 (file)
@@ -170,6 +170,13 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_DIALOG_UPDATE:
                status.setEnabled(true);
                return true;
+       // We can't suppress entire LFUN_INSET_TOGGLE as long as
+       // LFUN_NEXT_INSET_TOGGLE is used for editation purposes.
+       case LFUN_INSET_TOGGLE:
+               status.setEnabled(cmd.argument() != "open" &&
+                                 cmd.argument() != "close" &&
+                                 cmd.argument() != "toggle");
+               return true;
        default:
                return Inset::getStatus(cur, cmd, status);
        }