mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 14:15:32 +00:00
Don't parse multicolumn if the grid does not support it
Fixes #10466 and visual/compilation bugs with InsetMathSplit, InsetMathDiagram, InsetMathHull, InsetMathSubstack and InsetMathXYMatrix.
This commit is contained in:
parent
e7654d9aa2
commit
1c84d0ca82
@ -58,6 +58,8 @@ public:
|
||||
int leftMargin() const { return 6; } //override
|
||||
///
|
||||
int rightMargin() const { return 8; } //override
|
||||
///
|
||||
bool handlesMulticolumn() const { return true; } //override
|
||||
|
||||
private:
|
||||
virtual Inset * clone() const;
|
||||
|
@ -53,6 +53,8 @@ public:
|
||||
int leftMargin() const { return 4; } //override
|
||||
///
|
||||
int rightMargin() const { return 2; } //override
|
||||
///
|
||||
bool handlesMulticolumn() const { return true; } //override
|
||||
|
||||
private:
|
||||
virtual Inset * clone() const;
|
||||
|
@ -56,6 +56,8 @@ public:
|
||||
int leftMargin() const { return 8; } //override
|
||||
///
|
||||
int rightMargin() const { return 0; } //override
|
||||
/// see e.g. https://tex.stackexchange.com/a/133283/87201
|
||||
bool handlesMulticolumn() const { return true; } //override
|
||||
|
||||
private:
|
||||
virtual Inset * clone() const;
|
||||
|
@ -211,6 +211,8 @@ public:
|
||||
virtual int vlinesep() const;
|
||||
///
|
||||
virtual int border() const;
|
||||
///
|
||||
virtual bool handlesMulticolumn() const { return false; }
|
||||
|
||||
///
|
||||
void write(WriteStream & os) const;
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "InsetMathChar.h"
|
||||
#include "InsetMathColor.h"
|
||||
#include "InsetMathFrac.h"
|
||||
#include "InsetMathGrid.h"
|
||||
#include "InsetMathNest.h"
|
||||
#include "InsetMathScript.h"
|
||||
#include "MathExtern.h"
|
||||
|
@ -47,6 +47,8 @@ public:
|
||||
void octave(OctaveStream &) const;
|
||||
///
|
||||
InsetCode lyxCode() const { return MATH_MATRIX_CODE; }
|
||||
///
|
||||
bool handlesMulticolumn() const { return true; } //override
|
||||
|
||||
private:
|
||||
virtual Inset * clone() const;
|
||||
|
@ -48,11 +48,6 @@ Inset * InsetMathSplit::clone() const
|
||||
}
|
||||
|
||||
|
||||
// FIXME: InsetMathGrid should be changed to let the real column alignment be
|
||||
// given by a virtual method like displayColAlign, because the values produced
|
||||
// by defaultColAlign can be invalidated by lfuns such as add-column. I suspect
|
||||
// that for the moment the values produced by defaultColAlign are not used,
|
||||
// notably because alignment is not implemented in the LyXHTML output.
|
||||
char InsetMathSplit::defaultColAlign(col_type col)
|
||||
{
|
||||
if (name_ == "gathered")
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
int leftMargin() const { return 4; } //override
|
||||
///
|
||||
int rightMargin() const { return 2; } //override
|
||||
///
|
||||
bool handlesMulticolumn() const { return true; } //override
|
||||
|
||||
private:
|
||||
Inset * clone() const;
|
||||
|
@ -1363,7 +1363,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|
||||
}
|
||||
}
|
||||
|
||||
else if (t.cs() == "multicolumn") {
|
||||
else if (t.cs() == "multicolumn" && grid.handlesMulticolumn()) {
|
||||
// if the columns are specified numerically,
|
||||
// extract column count and insert dummy cells,
|
||||
// otherwise parse it as an user macro
|
||||
|
Loading…
Reference in New Issue
Block a user