#endif
#include "math_gridinset.h"
+#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "lyxfont.h"
#include "Painter.h"
}
+MathInset * MathGridInset::clone() const
+{
+ return new MathGridInset(*this);
+}
+
+
MathInset::idx_type MathGridInset::index(row_type row, col_type col) const
{
return col + ncols() * row;
{
string eol;
- if (rowinfo_[row].crskip_.value() != 0)
+ if (!rowinfo_[row].crskip_.zero())
eol += "[" + rowinfo_[row].crskip_.asLatexString() + "]";
// make sure an upcoming '[' does not break anything
}
-bool MathGridInset::idxUp(idx_type & /*idx*/, pos_type & /*pos*/) const
+bool MathGridInset::idxUp(idx_type & idx) const
{
- return false;
-/*
if (idx < ncols())
return false;
- int x = cellXOffset(idx) + xcell(idx).pos2x(pos);
idx -= ncols();
- pos = xcell(idx).x2pos(x - cellXOffset(idx));
return true;
-*/
}
-bool MathGridInset::idxDown(idx_type & /*idx*/, pos_type & /*pos*/) const
+bool MathGridInset::idxDown(idx_type & idx) const
{
- return false;
-/*
if (idx >= ncols() * (nrows() - 1))
return false;
- int x = cellXOffset(idx) + xcell(idx).pos2x(pos);
idx += ncols();
- pos = xcell(idx).x2pos(x - cellXOffset(idx));
return true;
-*/
}
idx = (nrows() - 1) * ncols();
break;
default:
- idx = (nrows() / 2) * ncols();
+ idx = ((nrows() - 1) / 2) * ncols();
}
pos = 0;
return true;
idx = nargs() - 1;
break;
default:
- idx = (nrows() / 2 + 1) * ncols() - 1;
+ idx = ((nrows() - 1) / 2 + 1) * ncols() - 1;
}
pos = cell(idx).size();
return true;