From 9e34cf818604ce7d1f479c15cd45871c2e191ad9 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 30 Mar 2010 00:18:08 +0000 Subject: [PATCH] Fix math char stuff. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33940 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathChar.cpp | 17 +++++++++-------- src/mathed/MathStream.cpp | 5 ----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index f11ef5e5d3..532d8496fa 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -211,9 +211,9 @@ void InsetMathChar::htmlize(HtmlStream & ms) const default: break; } - bool have_entity = entity.empty(); + bool have_entity = !entity.empty(); - if (ms.inText() || have_entity) { + if (ms.inText()) { if (have_entity) ms << from_ascii(entity); else @@ -221,16 +221,17 @@ void InsetMathChar::htmlize(HtmlStream & ms) const return; } - if (!entity.empty()) { + if (have_entity) { ms << ' ' << from_ascii(entity) << ' '; return; } - char const * space = - (isalpha(char_) || Encodings::isMathAlpha(char_)) - ? "" : " "; - // we don't use MTag and ETag because we do not want the spacing - ms << space << char_type(char_) << space; + if (isalpha(char_) || Encodings::isMathAlpha(char_)) + // we don't use MTag and ETag because we do not want the spacing + ms << MTag("i") << char_type(char_) << ETag("i"); + else + // an operator, so give some space + ms << " " << char_type(char_) << " "; } diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index bcd7160bc0..25bb288a50 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -409,8 +409,6 @@ HtmlStream & operator<<(HtmlStream & ms, char_type c) HtmlStream & operator<<(HtmlStream & ms, MTag const & t) { - ++ms.tab(); - ms.os() << "\n"; ms.os() << '<' << from_ascii(t.tag_); if (!t.attr_.empty()) ms.os() << " " << from_ascii(t.attr_); @@ -421,9 +419,6 @@ HtmlStream & operator<<(HtmlStream & ms, MTag const & t) HtmlStream & operator<<(HtmlStream & ms, ETag const & t) { - ms.os() << "\n"; - if (ms.tab() > 0) - --ms.tab(); ms.os() << "'; return ms; } -- 2.39.5