]> git.lyx.org Git - lyx.git/commitdiff
Fixup 216a6fb3: fix broken xml syntax
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Jul 2024 13:04:49 +0000 (15:04 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Jul 2024 17:52:12 +0000 (19:52 +0200)
This commit addresses two issues:

1/ the embarassing one: the member SetMode::old_text_level_ was
   declared as bool instead of int. This means that is was definitely
   not a proper backup variable!

2/ a robustness issue: replace two consecutive test for isTest() by a
   boolean veriable that is used twice. This makes sure that <mrow>
   cannot be output without the corresponding </mrow>.

Part of bug #13069.

src/mathed/MathExtern.cpp
src/mathed/MathStream.h

index 1f9356f8f241bdaf97de18bbf4f619b4e31f6749..990d35e9d2be8bc3343e44181f35a318c1a9852f 100644 (file)
@@ -1646,11 +1646,13 @@ void mathmlize(MathData const & dat, MathMLStream & ms)
        } else if (ar.size() == 1) {
                ms << ar.front();
        } else {
-               if (!ms.inText())
+               // protect against the value changing in the second test.
+               bool const intext = ms.inText();
+               if (!intext)
                        ms << MTag("mrow");
                for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it)
                        (*it)->mathmlize(ms);
-               if (!ms.inText())
+               if (!intext)
                        ms << ETag("mrow");
        }
 }
index a9edae08c06cc5019f23a46ed8368044f3e70bfc..40bb7d3bfb41c7faa748d58f6eee4a03cfd063c8 100644 (file)
@@ -469,7 +469,7 @@ private:
        ///
        MathMLStream & ms_;
        ///
-       bool old_text_level_;
+       int old_text_level_;
 };