Fix MathML output of wide characters.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32699 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-12-31 17:31:13 +00:00
parent a1316dbea3
commit 13b88d6166
3 changed files with 37 additions and 28 deletions

View File

@ -175,10 +175,10 @@ void InsetMathChar::mathmlize(MathStream & ms) const
}
char const * type =
(isalpha(char_) || Encodings::isMathAlpha(char_))
(isalpha(char_) || Encodings::isMathAlpha(char_))
? "mi" : "mo";
// we don't use MTag and ETag because we do not want the spacing
ms << "<" << type << ">" << char(char_) << "</" << type << ">";
ms << "<" << type << ">" << char_type(char_) << "</" << type << ">";
}

View File

@ -250,6 +250,32 @@ MathStream::MathStream(odocstream & os)
{}
void MathStream::cr()
{
os() << '\n';
for (int i = 0; i < tab(); ++i)
os() << ' ';
}
void MathStream::defer(docstring const & s)
{
deferred_ << s;
}
void MathStream::defer(string const & s)
{
deferred_ << from_utf8(s);
}
docstring MathStream::deferred() const
{
return deferred_.str();
}
MathStream & operator<<(MathStream & ms, MathAtom const & at)
{
at->mathmlize(ms);
@ -278,6 +304,13 @@ MathStream & operator<<(MathStream & ms, char c)
}
MathStream & operator<<(MathStream & ms, char_type c)
{
ms.os() << c;
return ms;
}
MathStream & operator<<(MathStream & ms, MTag const & t)
{
++ms.tab();
@ -297,32 +330,6 @@ MathStream & operator<<(MathStream & ms, ETag const & t)
}
void MathStream::cr()
{
os() << '\n';
for (int i = 0; i < tab(); ++i)
os() << ' ';
}
void MathStream::defer(docstring const & s)
{
deferred_ << s;
}
void MathStream::defer(string const & s)
{
deferred_ << from_utf8(s);
}
docstring MathStream::deferred() const
{
return deferred_.str();
}
MathStream & operator<<(MathStream & ms, docstring const & s)
{
ms.os() << s;

View File

@ -286,6 +286,8 @@ MathStream & operator<<(MathStream &, char const *);
///
MathStream & operator<<(MathStream &, char);
///
MathStream & operator<<(MathStream &, char_type);
///
MathStream & operator<<(MathStream &, MTag const &);
///
MathStream & operator<<(MathStream &, ETag const &);