Set buffer when expanding macro

This avoids a crash in InsetMathSplit which uses the buffer() value.

Fixes bug #11686.

(cherry picked from commit 19abf29ea0)
This commit is contained in:
Jean-Marc Lasgouttes 2019-10-20 12:54:59 +02:00
parent 54acc050f6
commit d3fd915662
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}

View File

@ -150,6 +150,8 @@ What's new
- Fix bad caret position when row scrolls horizontally (bug 11603).
- Fix crash when inserting some macros (bug 11686).
* INTERNALS