MathStream: better order for the calls to tab() and cr().

Part of https://www.lyx.org/trac/attachment/ticket/12221/0006-amends-to-a579128c-a68e9793-a68e9793.patch by lynx.
This commit is contained in:
Thibaut Cuvelier 2021-12-05 19:15:06 +01:00
parent 115ff2fa3c
commit a81dd6518a

View File

@ -361,8 +361,8 @@ MathMLStream & operator<<(MathMLStream & ms, char_type c)
MathMLStream & operator<<(MathMLStream & ms, MTag const & t) MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
{ {
++ms.tab();
ms.cr(); ms.cr();
++ms.tab();
ms.os() << '<' << from_ascii(ms.namespacedTag(t.tag_)); ms.os() << '<' << from_ascii(ms.namespacedTag(t.tag_));
if (!t.attr_.empty()) if (!t.attr_.empty())
ms.os() << " " << from_ascii(t.attr_); ms.os() << " " << from_ascii(t.attr_);
@ -384,9 +384,9 @@ MathMLStream & operator<<(MathMLStream & ms, MTagInline const & t)
MathMLStream & operator<<(MathMLStream & ms, ETag const & t) MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
{ {
ms.cr();
if (ms.tab() > 0) if (ms.tab() > 0)
--ms.tab(); --ms.tab();
ms.cr();
ms.os() << "</" << from_ascii(ms.namespacedTag(t.tag_)) << ">"; ms.os() << "</" << from_ascii(ms.namespacedTag(t.tag_)) << ">";
return ms; return ms;
} }