]> git.lyx.org Git - features.git/commitdiff
allow insertion of protected space in maths
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 22 Apr 2002 22:31:49 +0000 (22:31 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 22 Apr 2002 22:31:49 +0000 (22:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4042 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxfunc.C
src/mathed/ChangeLog
src/mathed/formulabase.C

index d000c7111e3d67c8d503e01aa3edf4bb950e2825..4df15618212b1bd2f9849a9f4de9542bf774f314 100644 (file)
@@ -1,5 +1,7 @@
 2002-04-22  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
+       * lyxfunc.C (getStatus): LFUN_PROTECTED_SPACE is allowed in maths
+
        * paragraph_pimpl.C (simpleTeXSpecialChars): remove bogus
        ensuremath around textordmasculine, textordfeminine and
        textdegree.
index 97b33f7f8c97baee90b9177b0f7d2e15f4f61161..e71a977d1db6b0d9d3221eea704a0aca003be7d8 100644 (file)
@@ -661,9 +661,13 @@ FuncStatus LyXFunc::getStatus(kb_action action,
        case LFUN_MENU_SEPARATOR:
        case LFUN_LDOTS:
        case LFUN_END_OF_SENTENCE:
-       case LFUN_PROTECTEDSPACE:
                code = Inset::SPECIALCHAR_CODE;
                break;
+       case LFUN_PROTECTEDSPACE:
+               // slight hack: we know this is allowed in math mode
+               if (!mathcursor)
+                       code = Inset::SPECIALCHAR_CODE;
+               break;
        default:
                break;
        }
index d704a9c9966697dd142dc41a51b499d0fbeaa4e8..1581e4f4b0dc528b5d9bc51e581edce9dc1fa6e4 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-22  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * formulabase.C (localDispatch): merge the cases for
+       LFUN_PROTECTEDSPACE and LFUN_MATH_SPACE, since they were identical.
+
 2002-04-16  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * formulabase.C (localDispatch): handle arguments of
index 8836dc62f5a32cde6ecd24a9c6fbf5ebf2025ae3..4d2152f455eb8d321f4151a72bfafb6a1e321efe 100644 (file)
@@ -602,14 +602,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                }
                break;
 
-       case LFUN_MATH_SPACE:
-       {
-               bv->lockedInsetStoreUndo(Undo::EDIT);
-               mathcursor->insert(MathAtom(new MathSpaceInset(1)));
-               updateLocal(bv, true);
-               break;
-       }
-
        case LFUN_SUPERSCRIPT:
        case LFUN_SUBSCRIPT:
        {
@@ -637,7 +629,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        }
 
        case LFUN_PROTECTEDSPACE:
-               //lyxerr << " called LFUN_PROTECTEDSPACE\n";
+       case LFUN_MATH_SPACE:
                bv->lockedInsetStoreUndo(Undo::EDIT);
                mathcursor->insert(MathAtom(new MathSpaceInset(1)));
                updateLocal(bv, true);