X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathTabular.cpp;h=e4123a565509cd6dd0b96875a42084a0e102104d;hb=e709a6626e731b460a98ea34d762a776de90b54c;hp=083b0e5ef52d99b4d6bd59886ed5f0ed53edea4a;hpb=ff4460603e3888948b46f0ab5bfa69a862d538ad;p=lyx.git diff --git a/src/mathed/InsetMathTabular.cpp b/src/mathed/InsetMathTabular.cpp index 083b0e5ef5..e4123a5655 100644 --- a/src/mathed/InsetMathTabular.cpp +++ b/src/mathed/InsetMathTabular.cpp @@ -16,6 +16,8 @@ #include "MathStream.h" #include "MathStream.h" +#include "MetricsInfo.h" + #include "support/lstrings.h" #include @@ -43,24 +45,15 @@ Inset * InsetMathTabular::clone() const void InsetMathTabular::metrics(MetricsInfo & mi, Dimension & dim) const { - FontSetChanger dummy(mi.base, "textnormal"); + Changer dummy = mi.base.changeFontSet("textnormal"); InsetMathGrid::metrics(mi, dim); - dim.wid += 6; -} - - -Dimension const InsetMathTabular::dimension(BufferView const & bv) const -{ - Dimension dim = InsetMathGrid::dimension(bv); - dim.wid += 6; - return dim; } void InsetMathTabular::draw(PainterInfo & pi, int x, int y) const { - FontSetChanger dummy(pi.base, "textnormal"); - InsetMathGrid::drawWithMargin(pi, x, y, 4, 2); + Changer dummy = pi.base.changeFontSet("textnormal"); + InsetMathGrid::draw(pi, x, y); } @@ -71,6 +64,7 @@ void InsetMathTabular::write(WriteStream & os) const if (os.fragile()) os << "\\protect"; os << "\\begin{" << name_ << '}'; + bool open = os.startOuterRow(); char const v = verticalAlignment(); if (v == 't' || v == 'b') @@ -82,6 +76,8 @@ void InsetMathTabular::write(WriteStream & os) const if (os.fragile()) os << "\\protect"; os << "\\end{" << name_ << '}'; + if (open) + os.startOuterRow(); // adding a \n here is bad if the tabular is the last item // in an \eqnarray... }