]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpecialChar.cpp
tex2lyx: support for \item with opt arg in itemize environment
[lyx.git] / src / mathed / InsetMathSpecialChar.cpp
index 6157c7977a023fb949e28119c67e9090a1095b41..32e4c2afbf85151df69c1249b93035a7deb44321 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, /**/);
+                       LASSERT(false, char_ = '?');
        } else
                char_ = name.at(0);
 }
@@ -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