mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Get rid of superfluous conversions and else statement.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27062 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f67069ed4d
commit
62530e98e0
@ -32,12 +32,11 @@ InsetMathSpecialChar::InsetMathSpecialChar(docstring name)
|
|||||||
: name_(name), kerning_(0)
|
: name_(name), kerning_(0)
|
||||||
{
|
{
|
||||||
if (name.size() != 1) {
|
if (name.size() != 1) {
|
||||||
if (name == from_ascii("textasciicircum")
|
if (name == "textasciicircum" || name == "mathcircumflex")
|
||||||
|| name == from_ascii("mathcircumflex"))
|
|
||||||
char_ = '^';
|
char_ = '^';
|
||||||
else if (name == from_ascii("textasciitilde"))
|
else if (name == "textasciitilde")
|
||||||
char_ = '~';
|
char_ = '~';
|
||||||
else if (name == from_ascii("textbackslash"))
|
else if (name == "textbackslash")
|
||||||
char_ = '\\';
|
char_ = '\\';
|
||||||
else
|
else
|
||||||
LASSERT(false, /**/);
|
LASSERT(false, /**/);
|
||||||
|
@ -219,17 +219,15 @@ void initSymbols()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isSpecialChar(docstring name)
|
bool isSpecialChar(docstring const & name)
|
||||||
{
|
{
|
||||||
if (name.size() != 1) {
|
if (name.size() != 1)
|
||||||
string const s = to_ascii(name);
|
return name == "textasciicircum" || name == "mathcircumflex" ||
|
||||||
return s == "textasciicircum" || s == "mathcircumflex" ||
|
name == "textasciitilde" || name == "textbackslash";
|
||||||
s == "textasciitilde" || s == "textbackslash";
|
|
||||||
} else {
|
char_type const c = name.at(0);
|
||||||
char_type const c = name.at(0);
|
return c == '{' || c == '}' || c == '&' || c == '$' ||
|
||||||
return c == '{' || c == '}' || c == '&' || c == '$' ||
|
c == '#' || c == '%' || c == '_';
|
||||||
c == '#' || c == '%' || c == '_';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user