]> git.lyx.org Git - features.git/commitdiff
Fix another instance of missing buffer in math. This is needed when
authorEnrico Forestieri <forenr@lyx.org>
Sun, 15 Nov 2009 01:03:03 +0000 (01:03 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 15 Nov 2009 01:03:03 +0000 (01:03 +0000)
pasting a macro inside another math inset (such as \text or \hat). In
this case the buffer would not be set and getMacro() cannot be called,
such that an "internal" macro would still shadow an user defined one.
This kind of fix is now easy after Abdel's overhaul.

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

src/Cursor.cpp

index b652c035ef66901bde3a892ebf8b4e121b637717..2a6d4e6420688226b4b3fe8b8f6644570c0ab230 100644 (file)
@@ -1301,7 +1301,7 @@ void Cursor::insert(Inset * inset0)
 
 void Cursor::niceInsert(docstring const & t, Parse::flags f)
 {
-       MathData ar;
+       MathData ar(buffer());
        asArray(t, ar, f);
        if (ar.size() == 1)
                niceInsert(ar[0]);
@@ -1322,7 +1322,7 @@ void Cursor::niceInsert(MathAtom const & t)
                // push the clone, not the original
                pushBackward(*nextInset());
                // We may not use niceInsert here (recursion)
-               MathData ar;
+               MathData ar(buffer());
                asArray(safe, ar);
                insert(ar);
        }
@@ -1473,7 +1473,7 @@ bool Cursor::macroModeClose()
                return false;
        InsetMathUnknown * p = activeMacro();
        p->finalize();
-       MathData selection;
+       MathData selection(buffer());
        asArray(p->selection(), selection);
        docstring const s = p->name();
        --pos();