diff --git a/src/mathed/InsetMathSpecialChar.cpp b/src/mathed/InsetMathSpecialChar.cpp index 6157c7977a..8282788110 100644 --- a/src/mathed/InsetMathSpecialChar.cpp +++ b/src/mathed/InsetMathSpecialChar.cpp @@ -32,12 +32,11 @@ InsetMathSpecialChar::InsetMathSpecialChar(docstring 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, /**/); diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 8791b719a5..50e3fb4cee 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -219,17 +219,15 @@ void initSymbols() } -bool isSpecialChar(docstring name) +bool isSpecialChar(docstring const & name) { - if (name.size() != 1) { - string const s = to_ascii(name); - return s == "textasciicircum" || s == "mathcircumflex" || - s == "textasciitilde" || s == "textbackslash"; - } else { - char_type const c = name.at(0); - return c == '{' || c == '}' || c == '&' || c == '$' || - c == '#' || c == '%' || c == '_'; - } + if (name.size() != 1) + return name == "textasciicircum" || name == "mathcircumflex" || + name == "textasciitilde" || name == "textbackslash"; + + char_type const c = name.at(0); + return c == '{' || c == '}' || c == '&' || c == '$' || + c == '#' || c == '%' || c == '_'; }