backport fix for #6709

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@36797 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2010-12-09 22:17:25 +00:00
parent 7285719a4b
commit 9dac2d4ef4
7 changed files with 25 additions and 14 deletions

View File

@ -263,7 +263,7 @@ Menuset
Menu "insert_math" Menu "insert_math"
Item "Inline Formula|I" "math-mode on" 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 "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 align Environment|a" "command-sequence math-mode on; math-mutate align;"
Item "AMS alignat Environment|t" "command-sequence math-mode on; math-mutate alignat;" Item "AMS alignat Environment|t" "command-sequence math-mode on; math-mutate alignat;"

View File

@ -26,11 +26,11 @@ Menuset
# #
Menu "insert_math_context" Menu "insert_math_context"
Item "Array Environment|y" "math-matrix 2 2" Item "Array Environment|y" "math-matrix 2 2"
Item "Cases Environment|C" "command-sequence math-mode on; math-insert \cases" Item "Cases Environment|C" "math-insert \cases"
Item "Aligned Environment|l" "command-sequence math-mode on; math-insert \aligned; tabular-feature append-column" Item "Aligned Environment|l" "command-sequence math-insert \aligned; tabular-feature append-column"
Item "AlignedAt Environment|v" "command-sequence math-mode on; math-insert \alignedat; tabular-feature append-column" Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; tabular-feature append-column"
Item "Gathered Environment|h" "command-sequence math-mode on; math-insert \gathered" Item "Gathered Environment|h" "math-insert \gathered"
Item "Split Environment|S" "command-sequence math-mode on; math-insert \split; tabular-feature append-column" Item "Split Environment|S" "command-sequence math-insert \split; tabular-feature append-column"
Separator Separator
Item "Delimiters...|r" "dialog-show mathdelimiter" Item "Delimiters...|r" "dialog-show mathdelimiter"
Item "Matrix...|x" "dialog-show mathmatrix" Item "Matrix...|x" "dialog-show mathmatrix"

View File

@ -368,7 +368,7 @@ Menuset
Item "Protected Hyphen|y" "specialchar-insert nobreakdash" Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
Item "Breakable Slash|a" "specialchar-insert slash" Item "Breakable Slash|a" "specialchar-insert slash"
Item "Menu Separator|M" "specialchar-insert menu-separator" 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 End
Menu "insert_formatting" Menu "insert_formatting"
@ -394,8 +394,9 @@ Menuset
End End
Menu "insert_math" Menu "insert_math"
# 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 "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 "Numbered Formula|N" "command-sequence math-mode on; math-mutate equation; math-number-toggle;" 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 "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 align Environment|a" "command-sequence math-mode on; math-mutate align;"
@ -404,12 +405,13 @@ Menuset
Item "AMS gather Environment|g" "command-sequence math-mode on; math-mutate gather;" 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;" Item "AMS multline Environment|m" "command-sequence math-mode on; math-mutate multline;"
Separator 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 "Array Environment|y" "math-matrix 2 2"
Item "Cases Environment|C" "command-sequence math-mode on; math-insert \cases" Item "Cases Environment|C" "math-insert \cases"
Item "Aligned Environment|l" "command-sequence math-mode on; math-insert \aligned; tabular-feature append-column" Item "Aligned Environment|l" "command-sequence math-insert \aligned; tabular-feature append-column"
Item "AlignedAt Environment|v" "command-sequence math-mode on; math-insert \alignedat; tabular-feature append-column" Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; tabular-feature append-column"
Item "Gathered Environment|h" "command-sequence math-mode on; math-insert \gathered" Item "Gathered Environment|h" "math-insert \gathered"
Item "Split Environment|S" "command-sequence math-mode on; math-insert \split; tabular-feature append-column" Item "Split Environment|S" "command-sequence math-insert \split; tabular-feature append-column"
Separator Separator
Item "Delimiters...|r" "dialog-show mathdelimiter" Item "Delimiters...|r" "dialog-show mathdelimiter"
Item "Matrix...|x" "dialog-show mathmatrix" Item "Matrix...|x" "dialog-show mathmatrix"

View File

@ -85,7 +85,7 @@ ToolbarSet
Item "Toggle noun" "font-noun" Item "Toggle noun" "font-noun"
Item "Apply last" "textstyle-apply" Item "Apply last" "textstyle-apply"
Separator Separator
Item "Insert math" "math-mode" Item "Insert math" "math-mode on"
Item "Insert graphics" "dialog-show-new-inset graphics" Item "Insert graphics" "dialog-show-new-inset graphics"
TableInsert "Insert table" TableInsert "Insert table"
Separator Separator

View File

@ -1618,6 +1618,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_MATH_MODE: case LFUN_MATH_MODE:
if (cmd.argument() == "on") if (cmd.argument() == "on")
// don't pass "on" as argument // don't pass "on" as argument
// (it would appear literally in the first cell)
mathDispatch(cur, FuncRequest(LFUN_MATH_MODE), false); mathDispatch(cur, FuncRequest(LFUN_MATH_MODE), false);
else else
mathDispatch(cur, cmd, false); mathDispatch(cur, cmd, false);

View File

@ -1270,6 +1270,12 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
break; 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: case LFUN_MATH_INSERT:
flag.setEnabled(currentMode() != TEXT_MODE); flag.setEnabled(currentMode() != TEXT_MODE);
break; break;

View File

@ -104,6 +104,8 @@ What's new
- Fix save of personal dictionary path to preferences. (bug 6688) - Fix save of personal dictionary path to preferences. (bug 6688)
- Fix unexpected behavior of some "insert math" menu/toolbar entries. (bug 6709)
* DOCUMENTATION AND LOCALIZATION * DOCUMENTATION AND LOCALIZATION