diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index 1f9356f8f2..990d35e9d2 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -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"); } } diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index a9edae08c0..40bb7d3bfb 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -469,7 +469,7 @@ private: /// MathMLStream & ms_; /// - bool old_text_level_; + int old_text_level_; };