]> git.lyx.org Git - lyx.git/commitdiff
fix for #496
authorAndré Pönitz <poenitz@gmx.net>
Wed, 10 Jul 2002 15:23:36 +0000 (15:23 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 10 Jul 2002 15:23:36 +0000 (15:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4593 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_inset.C
src/mathed/math_parser.C

index 428a5297137a7db2bf08699341339bffa682d5ed..8cc11c8f2c4665d949112b97399c8e753cbed2c7 100644 (file)
@@ -24,9 +24,9 @@
 #include "Lsstream.h"
 #include "math_inset.h"
 #include "math_scriptinset.h"
-#include "math_charinset.h"
 #include "math_mathmlstream.h"
 #include "math_cursor.h"
+#include "math_parser.h"
 #include "debug.h"
 
 #include "frontends/LyXView.h"
@@ -307,19 +307,17 @@ string const & MathInset::getType() const
 
 string asString(MathArray const & ar)
 {
-       string res;
-       for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it)
-               if ((*it)->getChar())
-                       res += (*it)->getChar();
-       return res;
+       std::ostringstream os;
+       WriteStream ws(os);
+       ws << ar;
+       return os.str();
 }
 
 
 MathArray asArray(string const & str)
 {
        MathArray ar;
-       for (string::const_iterator it = str.begin(); it != str.end(); ++it)
-               ar.push_back(MathAtom(new MathCharInset(*it)));
+       mathed_parse_cell(ar, str);
        return ar;
 }
 
index 705c253711fa7268b0da50da265da0abb7f5a723..3d306707bfe0c28ee74be3466d32f0f23a6b5503 100644 (file)
@@ -1001,8 +1001,11 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags,
                }
 
                else if (t.cs() == "label") {
-                       if (grid.asHullInset())
-                               grid.asHullInset()->label(cellrow, getArg('{', '}'));
+                       if (grid.asHullInset()) {
+                               MathArray ar;
+                               parse_into(ar, FLAG_ITEM, false);
+                               grid.asHullInset()->label(cellrow, asString(ar));
+                       }
                }
 
                else if (t.cs() == "choose" || t.cs() == "over" || t.cs() == "atop") {