From: Enrico Forestieri Date: Mon, 15 Apr 2019 18:56:52 +0000 (+0200) Subject: Properly fix #9616 X-Git-Tag: 2.3.4~104 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7998616edb587d44938d377fec94a35547150c3b;p=features.git Properly fix #9616 Now all symbols in the unicodesymbols file having a mathcommand are not wrapped in a \text inset anymore. (cherry picked from commit 506324ef9d6bf5a5a6da410c99318d9679468bf1) --- diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 2d65f78d49..d21af77950 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -714,10 +714,4 @@ bool createInsetMath_fromDialogStr(docstring const & str, MathData & ar) } -bool isAsciiOrMathAlpha(char_type c) -{ - return isASCII(c) || Encodings::isMathAlpha(c); -} - - } // namespace lyx diff --git a/src/mathed/MathFactory.h b/src/mathed/MathFactory.h index 9837ca75e2..b6fdb5044a 100644 --- a/src/mathed/MathFactory.h +++ b/src/mathed/MathFactory.h @@ -33,11 +33,6 @@ MathAtom createInsetMath(char const * const, Buffer * buf); */ bool createInsetMath_fromDialogStr(docstring const &, MathData &); -/** Tells whether the argument is an ascii character or is marked as - * mathalpha in the unicodesymbols file. - */ -bool isAsciiOrMathAlpha(char_type); - typedef std::map MathWordList; MathWordList const & mathedWordList(); diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index c5df946e6f..539b1a3f02 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -1017,7 +1017,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, else if (t.cat() == catOther) { char_type c = t.character(); - if (isAsciiOrMathAlpha(c) + if (!Encodings::isUnicodeTextOnly(c) || mode_ & Parse::VERBATIM || !(mode_ & Parse::USETEXT) || mode == InsetMath::TEXT_MODE) { @@ -1026,7 +1026,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, MathAtom at = createInsetMath("text", buf); at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c))); while (nextToken().cat() == catOther - && !isAsciiOrMathAlpha(nextToken().character())) { + && Encodings::isUnicodeTextOnly(nextToken().character())) { c = getToken().character(); at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c))); } diff --git a/status.23x b/status.23x index 852830ad21..d98f333235 100644 --- a/status.23x +++ b/status.23x @@ -29,6 +29,8 @@ What's new The "Rows & Columns" optional submenu has been added to the math context menu. +Avoid using text mode for unicode symbols representable in math mode (bug 9616). + * DOCUMENTATION AND LOCALIZATION