]> git.lyx.org Git - features.git/commitdiff
Properly fix #9616
authorEnrico Forestieri <forenr@lyx.org>
Mon, 15 Apr 2019 18:56:52 +0000 (20:56 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 25 Jun 2019 19:41:21 +0000 (21:41 +0200)
Now all symbols in the unicodesymbols file having a mathcommand
are not wrapped in a \text inset anymore.

(cherry picked from commit 506324ef9d6bf5a5a6da410c99318d9679468bf1)

src/mathed/MathFactory.cpp
src/mathed/MathFactory.h
src/mathed/MathParser.cpp
status.23x

index 2d65f78d497ce1b2f791ec604f11353346fd3cfc..d21af7795001f21f4200c7cadce24de1701ce5ee 100644 (file)
@@ -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
index 9837ca75e2e2284be9aab3e09911cd08cb82f3aa..b6fdb5044a34aea6e3b2073194d76ca22b74f254 100644 (file)
@@ -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<docstring, latexkeys> MathWordList;
 MathWordList const & mathedWordList();
 
index c5df946e6f549ccd62c18c666a5f42ea15bbd336..539b1a3f02faaaf4f109ffd07d098a1503442d32 100644 (file)
@@ -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)));
                                }
index 852830ad21d950498d8a43e806caf5090dbe0894..d98f333235866b5dca515cb5093fff3d8e2622f3 100644 (file)
@@ -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