Revert "Set buffer when expanding macro"

This patch is not ready yet. Moreover, change the assertion in
InsetMathGrid::colAlign to a simple test.

As a consequence, math split inset might show a bad alignment in some
situations.

This reverts commit d3fd915662.
This commit is contained in:
Jean-Marc Lasgouttes 2019-11-16 11:59:15 +01:00
parent aaf96b3025
commit 0310dcb19e
3 changed files with 8 additions and 10 deletions

View File

@ -1853,9 +1853,10 @@ char InsetMathGrid::colAlign(HullType type, col_type col) const
case hullMultline:
return 'c';
case hullGather:
LASSERT(isBufferValid(),
if (!isBufferValid()) {
LYXERR0("Buffer not set correctly. Please report!");
return 'c';);
return 'c';
}
if (buffer().params().is_math_indent)
return 'l';
else

View File

@ -669,9 +669,8 @@ 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();
bool const ret = d->macro_->expand(values, d->expanded_);
d->expanded_.setBuffer(buffer());
if (ret && !support::contains(display, latexname)) {
if (d->macro_->expand(values, d->expanded_)
&& !support::contains(display, latexname)) {
if (utype == OutputUpdate && !d->expanded_.empty())
d->expanded_.updateMacros(cur, mc, utype, nesting);
}

View File

@ -153,11 +153,9 @@ What's new
- Fix bad caret position when row scrolls horizontally (bug 11603).
- Fix crash when inserting some macros (bug 11686).
- Fix crash when inserting some insets in math split insets (bug 11686).
- Avoid future crashes with math split insets by adding an extra test.
- Properly remember cursor posoiton when many files have been opened
- Properly remember cursor position when many files have been opened
(bug 10310).