]> git.lyx.org Git - lyx.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>
Mon, 7 Jan 2019 10:41:35 +0000 (11:41 +0100)
The column is flushed when the display of equations is flushed.

Not sure what to do with RtL languages.

Fixes bug 11324.

(cherry picked from commit 7cb0284a3ffa469c4c99184725f5a3e0b4056508)

src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathSplit.cpp
status.23x

index f0152854e5626b7bd168d335aa41de05b947b894..f9625429c4932421748611dfc6a43ad6458e164b 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 9cd22eae510c06521adeba49fa54d1738b9a08e5..2e48453601a02d557863d46c1dbf551e78584464 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 0f7e9a85df7fbd1b39362121b8f326772999a8f9..2c2cd413c1513fdeb0f5dd7c46ae7d2f68a699eb 100644 (file)
@@ -446,7 +446,7 @@ bool InsetMathHull::idxLast(Cursor & cur) 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());
 }
 
 
@@ -468,7 +468,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);
 }
 
index 1bc9f278bfe676aa966833645d7b5f86c1df3263..83beca4cd4d351f89ada1c8fb3b6b033f9b0e35e 100644 (file)
@@ -128,6 +128,9 @@ What's new
 
 - Repair (de)activation of plural, capitalize, etc, for refstyle.
 
+- Fix display of gather environment in leqno mode (bug 11324).
+
+
 
 * INTERNALS