From eba2f14fa79b7078788d813d2d2c2dc3d481be13 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 13 Dec 2018 19:39:23 +0100 Subject: [PATCH] Fix display of single-char macro names Essentially, all characters are allowed in single-char macro names. Part of #11158. (cherry picked from commit 95bc273a597401f3ca9a43ed5d2d5db5626ae819) --- src/mathed/InsetMathMacro.cpp | 12 +++++++----- src/mathed/InsetMathMacroTemplate.cpp | 12 +++++++----- status.23x | 3 +++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index 3a8ec4de0a..668562899d 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -800,11 +800,13 @@ bool InsetMathMacro::validName() const return false;*/ // valid characters? - for (size_t i = 0; 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= 'a' && n[i] <= 'z') + && !(n[i] >= 'A' && n[i] <= 'Z') + && n[i] != '*') + return false; + } } return true; diff --git a/src/mathed/InsetMathMacroTemplate.cpp b/src/mathed/InsetMathMacroTemplate.cpp index 8435d4819b..2dc2b98b03 100644 --- a/src/mathed/InsetMathMacroTemplate.cpp +++ b/src/mathed/InsetMathMacroTemplate.cpp @@ -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; diff --git a/status.23x b/status.23x index a1fb4d94bd..f979769d97 100644 --- a/status.23x +++ b/status.23x @@ -58,6 +58,9 @@ What's new - Fix selection of unmarked RtL characters with Qt 5.11 (bug 11284). +- Fix on-screen display of macros whose name is a single non-letter symbol + (part of bug 11158). + * INTERNALS