]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathChar.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathChar.C
index 9307a721eef5ca4e48e7d27a0f4f0c53afe42647..18437ff6cff0b9f7044258df31e6728aeda4522a 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "InsetMathChar.h"
 #include "MathSupport.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 
 #include "debug.h"
 #include "dimension.h"
 
 #include "frontends/FontMetrics.h"
 
+
+namespace lyx {
+
 using std::auto_ptr;
 
 extern bool has_math_fonts;
 
 namespace {
 
-       bool isBinaryOp(char c)
+       bool isBinaryOp(char_type c)
        {
-               return lyx::support::contains("+-<>=/*", c);
+               return support::contains("+-<>=/*", static_cast<char>(c));
        }
 
 
-       bool slanted(char c)
+       bool slanted(char_type c)
        {
                return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
        }
@@ -42,7 +45,7 @@ namespace {
 }
 
 
-InsetMathChar::InsetMathChar(char c)
+InsetMathChar::InsetMathChar(char_type c)
        : char_(c)
 {}
 
@@ -129,29 +132,31 @@ void InsetMathChar::drawT(TextPainter & pain, int x, int y) const
 
 void InsetMathChar::write(WriteStream & os) const
 {
-       os << char_;
+       os.os().put(char_);
 }
 
 
 void InsetMathChar::normalize(NormalStream & os) const
 {
-       os << "[char " << char_ << " mathalpha]";
+       os << "[char ";
+       os.os().put(char_);
+       os << " mathalpha]";
 }
 
 
 void InsetMathChar::octave(OctaveStream & os) const
 {
-       os << char_;
+       os.os().put(char_);
 }
 
 
-void InsetMathChar::mathmlize(MathMLStream & ms) const
+void InsetMathChar::mathmlize(MathStream & ms) const
 {
        switch (char_) {
                case '<': ms << "&lt;"; break;
                case '>': ms << "&gt;"; break;
                case '&': ms << "&amp;"; break;
-               default: ms << char_; break;
+               default: ms.os().put(char_); break;
        }
 }
 
@@ -160,3 +165,6 @@ bool InsetMathChar::isRelOp() const
 {
        return char_ == '=' || char_ == '<' || char_ == '>';
 }
+
+
+} // namespace lyx