]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpecialChar.cpp
installer: further preparation
[lyx.git] / src / mathed / InsetMathSpecialChar.cpp
index 828278811065cea5c34bd935164630b9bdb0b0ca..32e4c2afbf85151df69c1249b93035a7deb44321 100644 (file)
@@ -21,6 +21,7 @@
 #include "TextPainter.h"
 
 #include "frontends/FontMetrics.h"
+#include "frontends/Painter.h"
 
 #include "support/lassert.h"
 
@@ -28,7 +29,7 @@
 namespace lyx {
 
 
-InsetMathSpecialChar::InsetMathSpecialChar(docstring name)
+InsetMathSpecialChar::InsetMathSpecialChar(docstring const & name)
        : name_(name), kerning_(0)
 {
        if (name.size() != 1) {
@@ -39,7 +40,7 @@ InsetMathSpecialChar::InsetMathSpecialChar(docstring name)
                else if (name == "textbackslash")
                        char_ = '\\';
                else
-                       LASSERT(false, /**/);
+                       LASSERT(false, char_ = '?');
        } else
                char_ = name.at(0);
 }
@@ -144,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