#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "support/gettext.h"
+#include "support/gettext.h"
#include "support/lstrings.h"
#include <sstream>
}
+int InsetMathAMSArray::rowsep() const
+{
+ return small() ? 0 : InsetMathGrid::rowsep();
+}
+
+
+int InsetMathAMSArray::colsep() const
+{
+ return small() ? InsetMathGrid::colsep() / 2 : InsetMathGrid::colsep();
+}
+
+
+int InsetMathAMSArray::border() const
+{
+ return small() ? 0 : InsetMathGrid::border();
+}
+
+
void InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const
{
- ArrayChanger dummy(mi.base);
+ Changer dummy2 = mi.base.changeEnsureMath();
+ Changer dummy = mi.base.changeArray(small());
InsetMathGrid::metrics(mi, dim);
- dim.wid += 14;
}
void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const
{
- Dimension const dim = dimension(*pi.base.bv);
- int const yy = y - dim.ascent();
- // Drawing the deco after an ArrayChanger does not work
- mathed_draw_deco(pi, x + 1, yy, 5, dim.height(), from_ascii(name_left()));
- mathed_draw_deco(pi, x + dim.width() - 8, yy, 5, dim.height(), from_ascii(name_right()));
- ArrayChanger dummy(pi.base);
- InsetMathGrid::drawWithMargin(pi, x, y, 6, 8);
+ Changer dummy2 = pi.base.changeEnsureMath();
+ if (name_ != "smallmatrix") {
+ Dimension const dim = dimension(*pi.base.bv);
+ int const yy = y - dim.ascent();
+ // Drawing the deco after changeStyle does not work
+ mathed_draw_deco(pi, x + 1, yy, 5, dim.height(), from_ascii(name_left()));
+ mathed_draw_deco(pi, x + dim.width() - 8, yy, 5, dim.height(), from_ascii(name_right()));
+ }
+ Changer dummy = pi.base.changeArray(small());
+ InsetMathGrid::draw(pi, x, y);
}
FuncStatus & flag) const
{
switch (cmd.action()) {
- case LFUN_INSET_MODIFY: {
- istringstream is(to_utf8(cmd.argument()));
- string s;
- is >> s;
- if (s != "tabular")
- break;
- is >> s;
+ case LFUN_TABULAR_FEATURE: {
+ string s = cmd.getArg(0);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
}
-void InsetMathAMSArray::write(WriteStream & os) const
+void InsetMathAMSArray::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\begin{" << name_ << '}';
+ bool open = os.startOuterRow();
InsetMathGrid::write(os);
os << "\\end{" << name_ << '}';
+ if (open)
+ os.startOuterRow();
}