From 6a3ff009dbe73dcbac11204fd9dda8a2b010511d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 27 Aug 2011 10:45:59 +0000 Subject: [PATCH] Issue the math space dialog (not the text one) when in math (bug 7746). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39536 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ui/stdmenus.inc | 2 +- src/insets/InsetCommand.cpp | 5 +++++ src/mathed/InsetMathNest.cpp | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 699573bb02..309ed1a628 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -395,7 +395,7 @@ Menuset Item "Interword Space|w" "space-insert normal" Item "Visible Space|i" "space-insert visible" Item "Thin Space|T" "space-insert thin" - Item "Horizontal Space...|o" "dialog-show-new-inset space" + Item "Horizontal Space...|o" "command-alternatives dialog-show-new-inset space;dialog-show-new-inset mathspace" Item "Horizontal Line...|L" "dialog-show-new-inset line" Item "Vertical Space...|V" "dialog-show-new-inset vspace" Submenu "Phantom|m" "insert_phantom" diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index fd86d03989..92eb1a84fc 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -332,6 +332,11 @@ bool decodeInsetParam(string const & name, string & data, data = InsetGraphics::params2string(p, buffer); break; } + case MATH_SPACE_CODE: { + InsetSpaceParams p(true); + data = InsetSpace::params2string(p); + break; + } case NOTE_CODE: { InsetNoteParams p; data = InsetNote::params2string(p); diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 9dd01cca0c..0ec27507a4 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1390,6 +1390,14 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, break; } + case LFUN_DIALOG_SHOW_NEW_INSET: { + docstring const & name = cmd.argument(); + if (name == "space") + flag.setEnabled(false); + break; + } + + case LFUN_MATH_DELIM: case LFUN_MATH_BIGDELIM: // Don't do this with multi-cell selections