]> git.lyx.org Git - features.git/commitdiff
Fix bug #2872: reference in math to label with "underscore"...
authorEnrico Forestieri <forenr@lyx.org>
Thu, 4 Feb 2010 10:32:58 +0000 (10:32 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 4 Feb 2010 10:32:58 +0000 (10:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33324 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathParser.cpp

index c57221a362644d9d3eb8f39871a821d1793009b8..77ba3bf485d7ca523e912fff10981d88c63ea93e 100644 (file)
@@ -58,6 +58,7 @@ following hack as starting point to write some macros:
 #include "InsetMathSpace.h"
 #include "InsetMathSplit.h"
 #include "InsetMathSqrt.h"
+#include "InsetMathString.h"
 #include "InsetMathTabular.h"
 #include "MathMacroTemplate.h"
 #include "MathFactory.h"
@@ -1395,8 +1396,14 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                else if (t.cs() == "ref" || t.cs() == "eqref" || t.cs() == "prettyref"
                          || t.cs() == "pageref" || t.cs() == "vpageref" || t.cs() == "vref") {
                        cell->push_back(MathAtom(new InsetMathRef(buf, t.cs())));
-                       parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode);
-                       parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+                       docstring const opt = parse_verbatim_option();
+                       docstring const ref = parse_verbatim_item();
+                       if (!opt.empty()) {
+                               cell->back().nucleus()->cell(1).push_back(
+                                       MathAtom(new InsetMathString(opt)));
+                       }
+                       cell->back().nucleus()->cell(0).push_back(
+                                       MathAtom(new InsetMathString(ref)));
                }
 
                else if (t.cs() == "left") {