]> git.lyx.org Git - features.git/commitdiff
fix remaining bits of bug #6709
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 4 Dec 2010 16:43:41 +0000 (16:43 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 4 Dec 2010 16:43:41 +0000 (16:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36718 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ui/classic.ui
lib/ui/stdcontext.inc
lib/ui/stdmenus.inc
lib/ui/stdtoolbars.inc
src/Text3.cpp
src/mathed/InsetMathNest.cpp

index d8068701378f6e0af7fbed65f2302a31faa2f79c..3e92c41b93a5d1139e096556732a94fe6f1acd27 100644 (file)
@@ -263,7 +263,7 @@ Menuset
 
        Menu "insert_math"
                Item "Inline Formula|I" "math-mode on"
-               Item "Display Formula|D" "math-display"
+               Item "Display Formula|D" "command-sequence math-mode on; math-mutate equation"
                Item "Eqnarray Environment|E" "command-sequence math-mode on; math-mutate eqnarray;"
                Item "AMS align Environment|a" "command-sequence math-mode on; math-mutate align;"
                Item "AMS alignat Environment|t" "command-sequence math-mode on; math-mutate alignat;"
index 413d88690716c5a8bbfa255c0e21aa026d9f1133..afd0bede85d279840e8be3070bfb407c45c28515 100644 (file)
@@ -26,11 +26,11 @@ Menuset
 #
        Menu "insert_math_context"
                Item "Array Environment|y" "math-matrix 2 2"
-               Item "Cases Environment|C" "command-sequence math-mode on; math-insert \cases"
-               Item "Aligned Environment|l" "command-sequence math-mode on; math-insert \aligned; inset-modify tabular append-column"
-               Item "AlignedAt Environment|v" "command-sequence math-mode on; math-insert \alignedat; inset-modify tabular append-column"
-               Item "Gathered Environment|h" "command-sequence math-mode on; math-insert \gathered"
-               Item "Split Environment|S" "command-sequence math-mode on; math-insert \split; inset-modify tabular append-column"
+               Item "Cases Environment|C" "math-insert \cases"
+               Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column"
+               Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column"
+               Item "Gathered Environment|h" "math-insert \gathered"
+               Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column"
                Separator
                Item "Delimiters...|r" "dialog-show mathdelimiter"
                Item "Matrix...|x" "dialog-show mathmatrix"
index 179a10cc8cb06928c8760f574f3b6eb6f45fa450..806b946ce6d3b7193759325b87d0b824df876c1a 100644 (file)
@@ -381,7 +381,7 @@ Menuset
                Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
                Item "Breakable Slash|a" "specialchar-insert slash"
                Item "Menu Separator|M" "specialchar-insert menu-separator"
-               Item "Phonetic Symbols|P" "command-sequence math-mode on; math-insert \text\textipa ; char-forward ;"
+               Item "Phonetic Symbols|P" "command-sequence math-insert \text\textipa ; char-forward ;"
        End
 
        Menu "insert_formatting"
@@ -408,8 +408,9 @@ Menuset
        End
 
        Menu "insert_math"
-               Item "Inline Formula|I" "math-mode"
-               Item "Display Formula|D" "math-display"
+# Always use "math-mode on" instead of "math-display" etc. because this disables the commands in math mode
+               Item "Inline Formula|I" "math-mode on"
+               Item "Display Formula|D" "command-sequence math-mode on; math-mutate equation"
                Item "Numbered Formula|N" "command-sequence math-mode on; math-mutate equation; math-number-toggle;"
                Item "Eqnarray Environment|E" "command-sequence math-mode on; math-mutate eqnarray;"
                Item "AMS align Environment|a" "command-sequence math-mode on; math-mutate align;"
@@ -418,12 +419,13 @@ Menuset
                Item "AMS gather Environment|g" "command-sequence math-mode on; math-mutate gather;"
                Item "AMS multline Environment|m" "command-sequence math-mode on; math-mutate multline;"
                Separator
+# "math-matrix" and "math-insert" create an inline formula first if called from text mode
                Item "Array Environment|y" "math-matrix 2 2"
-               Item "Cases Environment|C" "command-sequence math-mode on; math-insert \cases"
-               Item "Aligned Environment|l" "command-sequence math-mode on; math-insert \aligned; inset-modify tabular append-column"
-               Item "AlignedAt Environment|v" "command-sequence math-mode on; math-insert \alignedat; inset-modify tabular append-column"
-               Item "Gathered Environment|h" "command-sequence math-mode on; math-insert \gathered"
-               Item "Split Environment|S" "command-sequence math-mode on; math-insert \split; inset-modify tabular append-column"
+               Item "Cases Environment|C" "math-insert \cases"
+               Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column"
+               Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column"
+               Item "Gathered Environment|h" "math-insert \gathered"
+               Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column"
                Separator
                Item "Delimiters...|r" "dialog-show mathdelimiter"
                Item "Matrix...|x" "dialog-show mathmatrix"
index 42eb3f3ff3c0c3613f26dbc1e8033299fafe16a0..5b46595e76f7f2aef2ba84310268f56bdacd60fa 100644 (file)
@@ -86,7 +86,7 @@ ToolbarSet
                Item "Toggle noun" "font-noun"
                Item "Apply last" "textstyle-apply"
                Separator
-               Item "Insert math" "math-mode"
+               Item "Insert math" "math-mode on"
                Item "Insert graphics" "dialog-show-new-inset graphics"
                TableInsert "Insert table"
                Separator
index bc1ef41b188c17e8be901ace7b4d9d3c2931d82a..ed30cf64ccd4aca6b995539aa281aba16a26b8ba 100644 (file)
@@ -1737,6 +1737,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_MATH_MODE:
                if (cmd.argument() == "on")
                        // don't pass "on" as argument
+                       // (it would appear literally in the first cell)
                        mathDispatch(cur, FuncRequest(LFUN_MATH_MODE), false);
                else
                        mathDispatch(cur, cmd, false);
index 784c378c1626dbe74845d8d551df7b92fc1a9ca9..e400974c94df5ed7decbf23087af57412ce1283f 100644 (file)
@@ -1355,6 +1355,12 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
                break;
        }
 
+       case LFUN_MATH_MODE:
+               // forbid "math-mode on" in math mode to prevent irritating
+               // behaviour of menu entries (bug 6709)
+               flag.setEnabled(currentMode() == TEXT_MODE || arg != "on");
+               break;
+
        case LFUN_MATH_INSERT:
                flag.setEnabled(currentMode() != TEXT_MODE);
                break;