]> git.lyx.org Git - features.git/commitdiff
A better fix for bug 675:
authorAbdelrazak Younes <younes@lyx.org>
Thu, 1 Feb 2007 14:43:13 +0000 (14:43 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 1 Feb 2007 14:43:13 +0000 (14:43 +0000)
http://bugzilla.lyx.org/show_bug.cgi?id=675

The former one also disabled cross-reference insertion.

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

src/insets/insetcaption.C
src/lyxfunc.C

index 23882afa08e6826f5435bc78d5d4b8b81c3a36b8..a2d259dfee985eb867057ccfd79c3e579e5fc837 100644 (file)
@@ -199,10 +199,14 @@ bool InsetCaption::getStatus(LCursor & cur, FuncRequest const & cmd,
                status.enabled(false);
                return true;
 
+       case LFUN_DIALOG_SHOW_NEW_INSET:
        case LFUN_INSET_INSERT: {
                string const name = cmd.getArg(0);
-               if (name == "graphics"
-                       || name == "include") {
+               if (name == "float"
+                       || name == "graphics"
+                       || name == "include"
+                       || name == "wrap"
+                       ) {
                status.enabled(false);
                return true;
                }
index 776b220ff20ba0b7a1d4259bd4e6d9a948c97277..4570bfba8f511ab85c6e4ac5f501e9d105ff67ce 100644 (file)
@@ -576,8 +576,12 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        }
 
        case LFUN_DIALOG_SHOW_NEW_INSET:
-               enable = cur.inset().lyxCode() != InsetBase::ERT_CODE 
-                       && cur.inset().lyxCode() != InsetBase::CAPTION_CODE;
+               enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
+               if (cur.inset().lyxCode() == InsetBase::CAPTION_CODE) {
+                       FuncStatus flag;
+                       if (cur.inset().getStatus(cur, cmd, flag))
+                               return flag;
+               }
                break;
 
        case LFUN_DIALOG_UPDATE: {