]> git.lyx.org Git - features.git/commitdiff
Fix display of gather in lefteqn mode
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Oct 2018 14:05:46 +0000 (16:05 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Oct 2018 14:09:54 +0000 (16:09 +0200)
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
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathSplit.cpp

index c696c2260b9a9b5c4bb389ccc176c6d276df8dac..5a4830cb39b29022da48abcb14412310744c19d4 100644 (file)
@@ -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:
index af3f4c14031492b87016a40195fb3a8b7065e771..f93dc822148da2ae367b762b851bfcd1fa0a8a50 100644 (file)
@@ -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);
 
index 61d078abe0d77c51588cd64ff70e3080f5f1459a..582685e4f968a512b383a13958194b16811e05c8 100644 (file)
@@ -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;
        }
index c260e2e51eb053f159209df4c633494e1ce00e44..200a0bc3c9fd3a23e0a6f7efe5142dd8af65385e 100644 (file)
@@ -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);
 }