From: Jean-Marc Lasgouttes Date: Sun, 20 Oct 2019 10:54:59 +0000 (+0200) Subject: Set buffer when expanding macro X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=419c20bee1b1abcf4ebaa8d738999df1cb7109c6;p=features.git Set buffer when expanding macro This avoids a crash in InsetMathSplit which uses the buffer() value. Fixes bug #11686. --- diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index b5b0322a54..6e8ea5c30b 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -669,8 +669,9 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc, // than the one protected by UpdateLocker. docstring const & display = d->macro_->display(); docstring const latexname = from_ascii("\\") + macroName(); - if (d->macro_->expand(values, d->expanded_) - && !support::contains(display, latexname)) { + bool const ret = d->macro_->expand(values, d->expanded_); + d->expanded_.setBuffer(buffer()); + if (ret && !support::contains(display, latexname)) { if (utype == OutputUpdate && !d->expanded_.empty()) d->expanded_.updateMacros(cur, mc, utype, nesting); }