From: Enrico Forestieri Date: Sun, 15 Nov 2009 01:03:03 +0000 (+0000) Subject: Fix another instance of missing buffer in math. This is needed when X-Git-Tag: 2.0.0~5136 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3f3bedd0d9832ebd8c70ea0144387eadaaf5ab6f;p=features.git Fix another instance of missing buffer in math. This is needed when 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 --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index b652c035ef..2a6d4e6420 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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();