From: André Pönitz Date: Wed, 10 Jul 2002 15:23:36 +0000 (+0000) Subject: fix for #496 X-Git-Tag: 1.6.10~18914 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=55aa66a6e0ea2fa6ffbdcc22ff9157c94f2b7c21;p=features.git fix for #496 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4593 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 428a529713..8cc11c8f2c 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -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; } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 705c253711..3d306707bf 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -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") {