From: Jean-Marc Lasgouttes Date: Fri, 2 Dec 2016 10:13:47 +0000 (+0100) Subject: Reintroduce broken support for default macro arguments X-Git-Tag: 2.3.0alpha1~684 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=58e479527e101c649ce57ad8fbf6d5c4288d3d60;p=features.git Reintroduce broken support for default macro arguments This got forgotten in the math typesetting rewrite. Fixes bug #10508. --- diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index afc40a4910..f6791bbf76 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -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,