]> git.lyx.org Git - features.git/commitdiff
* src/BufferView.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 24 Mar 2008 18:22:54 +0000 (18:22 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 24 Mar 2008 18:22:54 +0000 (18:22 +0000)
- reintroduce check for dispatch state

* src/insets/InsetCaption.cpp:
- disable LFUN_INSET_TOGGLE

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23929 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/insets/InsetCaption.cpp

index 5888e676fa7873e35a6f7e9063b402af42ce1a11..9b3ae322bb3a3eec65c958a8035c6e3506ccfa89 100644 (file)
@@ -877,14 +877,12 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
                        break;
                }
                // if it did not work, try the underlying inset.
-               inset = &cur.inset();
-               if (inset) {
-                       inset->getStatus(cur, tmpcmd, flag);
-                       return flag;
-                       break;
-               }
-               // else disable
-               flag.enabled(false);
+               if (!inset || !cur.result().dispatched())
+                       getStatus(tmpcmd);
+
+               if (!cur.result().dispatched())
+                       // else disable
+                       flag.enabled(false);
                break;
        }
 
@@ -900,14 +898,12 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
                        break;
                }
                // if it did not work, try the underlying inset.
-               inset = &cur.inset();
-               if (inset) {
-                       inset->getStatus(cur, tmpcmd, flag);
-                       return flag;
-                       break;
-               }
-               // else disable
-               flag.enabled(false);
+               if (!inset || !cur.result().dispatched())
+                       getStatus(tmpcmd);
+
+               if (!cur.result().dispatched())
+                       // else disable
+                       flag.enabled(false);
                break;
        }
 
@@ -1335,9 +1331,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                        }
                }
                // if it did not work, try the underlying inset.
-               else if (&cur.inset())
-                       cur.inset().dispatch(cur, tmpcmd);
-               else
+               if (!inset || !cur.result().dispatched())
+                       cur.dispatch(tmpcmd);
+
+               if (!cur.result().dispatched())
                        // It did not work too; no action needed.
                        break;
                cur.clearSelection();
@@ -1354,9 +1351,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                if (inset)
                        inset->dispatch(cur, tmpcmd);
                // if it did not work, try the underlying inset.
-               else if (&cur.inset())
-                       cur.inset().dispatch(cur, tmpcmd);
-               else
+               if (!inset || !cur.result().dispatched())
+                       cur.dispatch(tmpcmd);
+
+               if (!cur.result().dispatched())
                        // It did not work too; no action needed.
                        break;
                cur.clearSelection();
@@ -1572,7 +1570,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 
        // Now dispatch to the temporary cursor. If the real cursor should
        // be modified, the inset's dispatch has to do so explicitly.
-       if (!cur.result().dispatched())
+       if (!inset || !cur.result().dispatched())
                cur.dispatch(cmd);
 
        // Notify left insets
index 4d02187e09f0ccca01c6cffcc3f8b71e12c1ff00..9da029219977442cff9c8d98222a8545ccaad7a7 100644 (file)
@@ -194,6 +194,7 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_BREAK_PARAGRAPH:
        case LFUN_BREAK_PARAGRAPH_SKIP:
+       case LFUN_INSET_TOGGLE:
                status.enabled(false);
                return true;