]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_charinset.C
write \mathrm{x}\mathrm{y} as \mathrm{xy} again
[features.git] / src / mathed / math_charinset.C
index 3d1557c402446a3a992223ecbf5972587b5c2c59..89c3378a783825e587fcec70345a392fb9037a62 100644 (file)
 #include "debug.h"
 
 
-namespace {
-
-char const * math_font_name[] = {
-       "mathrm",
-       "mathcal",
-       "mathbf",
-       "mathbb",
-       "mathsf",
-       "mathtt",
-       "mathit",
-       "textrm"
-};
-
-}
-
-
 MathCharInset::MathCharInset(char c)
        : char_(c), code_(nativeCode(c))
 {
@@ -84,8 +68,6 @@ void MathCharInset::metrics(MathMetricsInfo const & mi) const
 
 void MathCharInset::draw(Painter & pain, int x, int y) const
 { 
-       xo(x);
-       yo(y);
        //lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
        drawChar(pain, code_, mi_, x, y, char_);
 }
@@ -93,14 +75,14 @@ void MathCharInset::draw(Painter & pain, int x, int y) const
 
 void MathCharInset::writeHeader(std::ostream & os) const
 {
-       if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM) 
-               os << '\\' << math_font_name[code_ - LM_TC_RM] << '{';
+       if (math_font_name(code_))
+               os << '\\' << math_font_name(code_) << '{';
 }
 
 
 void MathCharInset::writeTrailer(std::ostream & os) const
 {
-       if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM)
+       if (math_font_name(code_))
                os << '}';
 }
 
@@ -121,7 +103,7 @@ void MathCharInset::write(MathWriteInfo & os) const
 
 void MathCharInset::writeNormal(std::ostream & os) const
 {
-       os << char_;
+       os << "[char " << char_ << " " << "mathalpha" << "]";
 }