Fix display of single-char macro names

Essentially, all characters are allowed in single-char macro names.

Part of #11158.
This commit is contained in:
Enrico Forestieri 2018-12-13 19:39:23 +01:00
parent 358626b735
commit 95bc273a59
2 changed files with 14 additions and 10 deletions

View File

@ -800,11 +800,13 @@ bool InsetMathMacro::validName() const
return false;*/
// valid characters?
for (size_t i = 0; i<n.size(); ++i) {
if (!(n[i] >= 'a' && n[i] <= 'z')
&& !(n[i] >= 'A' && n[i] <= 'Z')
&& n[i] != '*')
return false;
if (n.size() > 1) {
for (size_t i = 0; i<n.size(); ++i) {
if (!(n[i] >= 'a' && n[i] <= 'z')
&& !(n[i] >= 'A' && n[i] <= 'Z')
&& n[i] != '*')
return false;
}
}
return true;

View File

@ -1292,11 +1292,13 @@ bool InsetMathMacroTemplate::validName() const
return false;*/
// valid characters?
for (size_t i = 0; i < n.size(); ++i) {
if (!(n[i] >= 'a' && n[i] <= 'z')
&& !(n[i] >= 'A' && n[i] <= 'Z')
&& n[i] != '*')
return false;
if (n.size() > 1) {
for (size_t i = 0; i < n.size(); ++i) {
if (!(n[i] >= 'a' && n[i] <= 'z')
&& !(n[i] >= 'A' && n[i] <= 'Z')
&& n[i] != '*')
return false;
}
}
return true;