]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpecialChar.cpp
tex2lyx/text.cpp: fix typos
[lyx.git] / src / mathed / InsetMathSpecialChar.cpp
index 6157c7977a023fb949e28119c67e9090a1095b41..94d0514b9e9f9d5d1feae13c20be23434b772cd7 100644 (file)
@@ -21,6 +21,7 @@
 #include "TextPainter.h"
 
 #include "frontends/FontMetrics.h"
+#include "frontends/Painter.h"
 
 #include "support/lassert.h"
 
 namespace lyx {
 
 
-InsetMathSpecialChar::InsetMathSpecialChar(docstring name)
+InsetMathSpecialChar::InsetMathSpecialChar(docstring const & name)
        : name_(name), kerning_(0)
 {
        if (name.size() != 1) {
-               if (name == from_ascii("textasciicircum")
-                   || name == from_ascii("mathcircumflex"))
+               if (name == "textasciicircum" || name == "mathcircumflex")
                        char_ = '^';
-               else if (name == from_ascii("textasciitilde"))
+               else if (name == "textasciitilde")
                        char_ = '~';
-               else if (name == from_ascii("textbackslash"))
+               else if (name == "textbackslash")
                        char_ = '\\';
                else
                        LASSERT(false, /**/);
@@ -145,4 +145,17 @@ void InsetMathSpecialChar::mathmlize(MathStream & ms) const
 }
 
 
+void InsetMathSpecialChar::htmlize(HtmlStream & ms) const
+{
+       switch (char_) {
+       case '&':
+               ms << "&amp;";
+               break;
+       default:
+               ms.os().put(char_);
+               break;
+       }
+}
+
+
 } // namespace lyx