Make paste in ensuremath work as in simple math hulls

The ensuremath math inset derives from InsetMathNest, so that only the
first cell of a grid gets pasted. This patch makes it a fixed 1x1 grid
inset so that pasting works as in normal simple math hulls, i.e., all
cells are pasted, one after the other.

Fixes #11617.
This commit is contained in:
Enrico Forestieri 2021-01-06 02:07:25 +01:00
parent c13d16704c
commit d85710d32e
2 changed files with 20 additions and 3 deletions

View File

@ -26,7 +26,7 @@
namespace lyx {
InsetMathEnsureMath::InsetMathEnsureMath(Buffer * buf)
: InsetMathNest(buf, 1)
: InsetMathGrid(buf, 1, 1)
{}

View File

@ -13,14 +13,14 @@
#ifndef MATH_ENSUREMATHINSET_H
#define MATH_ENSUREMATHINSET_H
#include "InsetMathNest.h"
#include "InsetMathGrid.h"
namespace lyx {
/// Inset for ensuring math mode
class InsetMathEnsureMath : public InsetMathNest {
class InsetMathEnsureMath : public InsetMathGrid {
public:
explicit InsetMathEnsureMath(Buffer * buf);
///
@ -34,6 +34,23 @@ public:
///
void drawT(TextPainter & pi, int x, int y) const override;
///
void addRow(row_type row) override {}
///
void delRow(row_type row) override {}
///
void swapRow(row_type row) override {}
///
void addCol(col_type col) override {}
///
void delCol(col_type col) override {}
///
docstring eolString(row_type row, bool fragile, bool latex,
bool last_eoln) const override
{ return docstring(); }
///
docstring eocString(col_type col, col_type lastcol) const override
{ return docstring(); }
///
void write(TeXMathStream & os) const override;
///
void mathmlize(MathMLStream &) const override;