Lars Gullik Bjønnes wrote:

> Then someone have to test it promptly or this will not be in 1.4.0.

OK, here is an updated patch for testing (nothing had changed, I only moved
the ChangeLog entry). Any takers?


Georg
Index: src/ChangeLog
===================================================================
--- src/ChangeLog	(Revision 13280)
+++ src/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,7 @@
+2006-02-26  Georg Baum  <[EMAIL PROTECTED]>
+
+	* text3.C (mathDispatch): fix math inset creation from string (bug 2315)
+
 2006-02-28  Martin Vermeer  <[EMAIL PROTECTED]>
 
 	* cursor.C (niceInsert): fix (properly) insertion of
Index: src/text3.C
===================================================================
--- src/text3.C	(Revision 13280)
+++ src/text3.C	(Arbeitskopie)
@@ -158,16 +158,17 @@ namespace {
 			// create a macro if we see "\\newcommand"
 			// somewhere, and an ordinary formula
 			// otherwise
+			istringstream is(sel);
 			if (sel.find("\\newcommand") == string::npos
 			    && sel.find("\\def") == string::npos)
 			{
-				cur.insert(new MathHullInset("simple"));
-				cur.dispatch(FuncRequest(LFUN_RIGHT));
-				cur.dispatch(FuncRequest(LFUN_INSERT_MATH, sel));
-			} else {
-				istringstream is(sel);
+				MathHullInset * formula = new MathHullInset;
+				LyXLex lex(0, 0);
+				lex.setStream(is);
+				formula->read(cur.buffer(), lex);
+				cur.insert(formula);
+			} else
 				cur.insert(new MathMacroTemplate(is));
-			}
 		}
 		cur.message(N_("Math editor mode"));
 	}

Reply via email to