]> git.lyx.org Git - features.git/commitdiff
Revert "Set buffer when expanding macro"
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 16 Nov 2019 10:59:15 +0000 (11:59 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 16 Nov 2019 11:04:09 +0000 (12:04 +0100)
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
src/mathed/InsetMathMacro.cpp
status.23x

index 156048947cd8393cc0ebf8795320b6cae53d498f..2287afb4b20ffb7f4efac38c222a2df0e5530a54 100644 (file)
@@ -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
index d354412edd15cd16507ae0961aaa34e909c77fec..5e72eecdc27850b4737e833593b420df9f9f4bdb 100644 (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);
        }
index 62d9787b23931b2e3fbc7a68a3342733611d8824..2b4347cf4111ab806b80d513e2eef54fb4dbb21d 100644 (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).