#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, /**/);
}
+void InsetMathSpecialChar::htmlize(HtmlStream & ms) const
+{
+ switch (char_) {
+ case '&':
+ ms << "&";
+ break;
+ default:
+ ms.os().put(char_);
+ break;
+ }
+}
+
+
} // namespace lyx