]> git.lyx.org Git - lyx.git/commitdiff
fix #658
authorAndré Pönitz <poenitz@gmx.net>
Tue, 15 Oct 2002 08:41:35 +0000 (08:41 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 15 Oct 2002 08:41:35 +0000 (08:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5405 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_parser.C

index ff4447c2d895115bcadf5190f1bd62bcad829269..7c5d2d51cd45b09770fb5f810268c6bf1c76d7ae 100644 (file)
@@ -86,13 +86,13 @@ using std::atoi;
 
 namespace {
 
-MathInset::mode_type asMode(string const & str)
+MathInset::mode_type asMode(MathInset::mode_type oldmode, string const & str)
 {
        if (str == "mathmode")
                return MathInset::MATH_MODE;
        if (str == "textmode" || str == "forcetext")
                return MathInset::TEXT_MODE;
-       return MathInset::UNDECIDED_MODE;
+       return oldmode;
 }
 
 
@@ -1151,12 +1151,12 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        if (l) {
                                if (l->inset == "font") {
                                        cell->push_back(createMathInset(t.cs()));
-                                       parse(cell->back().nucleus()->cell(0), FLAG_ITEM, asMode(l->extra));
+                                       parse(cell->back().nucleus()->cell(0), FLAG_ITEM, asMode(mode, l->extra));
                                }
 
                                else if (l->inset == "oldfont") {
                                        cell->push_back(createMathInset(t.cs()));
-                                       parse(cell->back().nucleus()->cell(0), flags, asMode(l->extra));
+                                       parse(cell->back().nucleus()->cell(0), flags, asMode(mode, l->extra));
                                        return;
                                }
 
@@ -1179,7 +1179,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                else {
                                        MathAtom at = createMathInset(t.cs());
                                        for (MathInset::idx_type i = 0; i < at->nargs(); ++i)
-                                               parse(at.nucleus()->cell(i), FLAG_ITEM, asMode(l->extra));
+                                               parse(at.nucleus()->cell(i), FLAG_ITEM, asMode(mode, l->extra));
                                        cell->push_back(at);
                                }
                        }