]> git.lyx.org Git - lyx.git/commitdiff
Fixup b29b3eb1: 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>
Wed, 24 Jul 2024 16:17:13 +0000 (18:17 +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.

(cherry picked from commit a268fe096a58a7818554a7da4da85896bb289c81)

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 0cf10f0061e94e24e70fd1ed7c1f394447641577..ffa14a7b599383db02b62dd36720d53fb0a15567 100644 (file)
@@ -469,7 +469,7 @@ private:
        ///
        MathMLStream & ms_;
        ///
-       bool old_text_level_;
+       int old_text_level_;
 };