]> git.lyx.org Git - features.git/commitdiff
Reintroduce broken support for default macro arguments
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 2 Dec 2016 10:13:47 +0000 (11:13 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 2 Dec 2016 10:18:51 +0000 (11:18 +0100)
This got forgotten in the math typesetting rewrite.

Fixes bug #10508.

src/mathed/MathMacro.cpp

index afc40a4910e9764df40ada1a4dae062c9baa4744..f6791bbf7638869e66b98ba5bc6e97a96dd684ba 100644 (file)
@@ -81,7 +81,13 @@ public:
                mrow.push_back(e_beg);
 
                mathMacro_->macro()->unlock();
-               bool has_contents = mathMacro_->cell(idx_).addToMathRow(mrow, mi);
+               bool has_contents;
+               // handle default macro arguments
+               if (!mathMacro_->editMetrics(mi.base.bv)
+                       && mathMacro_->cell(idx_).empty())
+                       has_contents = def_.addToMathRow(mrow, mi);
+               else
+                       has_contents = mathMacro_->cell(idx_).addToMathRow(mrow, mi);
                mathMacro_->macro()->lock();
 
                // if there was no contents, and the contents is editable,