commit fa24a9bf974f456b046b71c3ed2f25c0d35dc490
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Wed Sep 23 15:29:23 2026 +0200

    Amend fe30c9e9: fix embarassing mistakes
    
    When removing useless assignments, do not remove the function call
    when it has side effects.
---
 src/mathed/MathFactory.cpp | 1 +
 src/mathed/MathParser.cpp  | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index 8e3d6117e6..3c06f7dbc5 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -855,6 +855,7 @@ bool createInsetMath_fromDialogStr(docstring const & str, 
MathData & md)
        // An example str:
        // "ref LatexCommand ref\nreference \"sec:Title\"\n\\end_inset\n\n";
        docstring name;
+       split(str, name, ' ');
 
        if (name == "ref") {
                InsetCommandParams icp(REF_CODE);
diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index 0adfb81150..f95ea5cd24 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -1085,8 +1085,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 
                        // read parameters
                        int nargs = 0;
-                       while (good() && nextToken().cat() != catBegin)
+                       while (good() && nextToken().cat() != catBegin) {
+                               getToken();
                                ++nargs;
+                       }
                        nargs /= 2;
 
                        // read definition
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to