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.

(cherry picked from commit 7cb0284a3ffa469c4c99184725f5a3e0b4056508)
This commit is contained in:
Jean-Marc Lasgouttes 2018-10-04 16:05:46 +02:00
parent 7dd5d6371f
commit e8d96cb9b1
5 changed files with 19 additions and 8 deletions

View 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:

View 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);

View 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;
}

View 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);
}

View 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