[LyX/2.3.x] Revert "Set buffer when expanding macro"

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sat Nov 16 11:05:29 UTC 2019


commit 0310dcb19e884d1ce6b56feff74d3ea02334f283
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Sat Nov 16 11:59:15 2019 +0100

    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 1560489..2287afb 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 d354412..5e72eec 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 62d9787..2b4347c 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).
 
 


More information about the lyx-cvs mailing list