Fix math char stuff.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33940 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-03-30 00:18:08 +00:00
parent 8ae31ce8e1
commit 9e34cf8186
2 changed files with 9 additions and 13 deletions

View File

@ -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_) << " ";
}

View File

@ -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() << "</" << from_ascii(t.tag_) << '>';
return ms;
}