]> git.lyx.org Git - lyx.git/commitdiff
* src/Text3.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 24 Mar 2008 13:20:06 +0000 (13:20 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 24 Mar 2008 13:20:06 +0000 (13:20 +0000)
- disallow comments and greyedout notes inside commands (sections etc.)
  This fixes bug 4180 partially (the change is still possible via the dialog).

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

src/Text3.cpp

index 80f782d8057101f000534312a2ac6f9c3c7deb9b..86a7e8b99b151d7ad531c151c95c15e3960fd916 100644 (file)
@@ -1879,7 +1879,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                code = ERT_CODE;
                break;
        case LFUN_LISTING_INSERT:
-           code = LISTINGS_CODE;
+               code = LISTINGS_CODE;
                break;
        case LFUN_FOOTNOTE_INSERT:
                code = FOOT_CODE;
@@ -1910,6 +1910,9 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                break;
        case LFUN_NOTE_INSERT:
                code = NOTE_CODE;
+               // in commands (sections etc., only Notes are allowed)
+               enable = (cmd.argument().empty() || cmd.getArg(0) == "Note" ||
+                         !cur.paragraph().layout().isCommand());
                break;
        case LFUN_FLEX_INSERT: {
                code = FLEX_CODE;