From 7cb0284a3ffa469c4c99184725f5a3e0b4056508 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 4 Oct 2018 16:05:46 +0200 Subject: [PATCH] Fix display of gather in lefteqn mode The column is flushed when the display of equations is flushed. Not sure what to do with RtL languages. Fixes bug 11324. --- src/mathed/InsetMathGrid.cpp | 8 ++++++-- src/mathed/InsetMathGrid.h | 7 +++++-- src/mathed/InsetMathHull.cpp | 4 ++-- src/mathed/InsetMathSplit.cpp | 5 +++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index c696c2260b..5a4830cb39 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1843,15 +1843,19 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, // static -char InsetMathGrid::colAlign(HullType type, col_type col) +char InsetMathGrid::colAlign(HullType type, col_type col, BufferParams const & bp) { switch (type) { case hullEqnArray: return "rcl"[col % 3]; case hullMultline: - case hullGather: return 'c'; + case hullGather: + if (!bp.is_math_indent) + return 'c'; + else + return 'l'; case hullAlign: case hullAlignAt: diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index af3f4c1403..f93dc82214 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -18,6 +18,8 @@ namespace lyx { +class BufferParams; + /** Gridded math inset base class. * This is the base to all grid-like editable math objects @@ -267,8 +269,9 @@ protected: // The following two functions are used in InsetMathHull and // InsetMathSplit. - /// The value of a fixed col align for a certain hull type - static char colAlign(HullType type, col_type col); + /// The value of a fixed col align for a certain hull type (can + /// depend on the "indent math" setting). + static char colAlign(HullType type, col_type col, BufferParams const &); /// The value of a fixed col spacing for a certain hull type static int colSpace(HullType type, col_type col); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 61d078abe0..582685e4f9 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -430,7 +430,7 @@ InsetMath::mode_type InsetMathHull::currentMode() const // alignment is not implemented in the LyXHTML output. char InsetMathHull::defaultColAlign(col_type col) { - return colAlign(type_, col); + return colAlign(type_, col, buffer().params()); } @@ -452,7 +452,7 @@ char InsetMathHull::displayColAlign(idx_type idx) const case hullXAlignAt: case hullXXAlignAt: case hullFlAlign: - return colAlign(type_, col(idx)); + return colAlign(type_, col(idx), buffer().params()); default: break; } diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index c260e2e51e..200a0bc3c9 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -16,6 +16,7 @@ #include "MathStream.h" #include "MathSupport.h" +#include "Buffer.h" #include "FuncRequest.h" #include "FuncStatus.h" #include "support/gettext.h" @@ -61,7 +62,7 @@ char InsetMathSplit::defaultColAlign(col_type col) || name_ == "aligned" || name_ == "align" || name_ == "alignedat") - return colAlign(hullAlign, col); + return colAlign(hullAlign, col, buffer().params()); return 'l'; } @@ -78,7 +79,7 @@ char InsetMathSplit::displayColAlign(idx_type idx) const || name_ == "aligned" || name_ == "align" || name_ == "alignedat") - return colAlign(hullAlign, col(idx)); + return colAlign(hullAlign, col(idx), buffer().params()); return InsetMathGrid::displayColAlign(idx); } -- 2.39.2