From 0310dcb19e884d1ce6b56feff74d3ea02334f283 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sat, 16 Nov 2019 11:59:15 +0100 Subject: [PATCH] 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 d3fd91566249b722dbc553b921283f2507ce5e17. --- src/mathed/InsetMathGrid.cpp | 7 ++++--- src/mathed/InsetMathMacro.cpp | 5 ++--- status.23x | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 156048947c..2287afb4b2 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1853,9 +1853,10 @@ char InsetMathGrid::colAlign(HullType type, col_type col) const case hullMultline: return 'c'; case hullGather: - LASSERT(isBufferValid(), - LYXERR0("Buffer not set correctly. Please report!"); - return 'c';); + if (!isBufferValid()) { + LYXERR0("Buffer not set correctly. Please report!"); + return 'c'; + } if (buffer().params().is_math_indent) return 'l'; else diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index d354412edd..5e72eecdc2 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -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); } diff --git a/status.23x b/status.23x index 62d9787b23..2b4347cf41 100644 --- a/status.23x +++ b/status.23x @@ -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). -- 2.39.5