]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathAMSArray.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathAMSArray.cpp
index 1e7d20c206e1bcaf9feb073d4ed763e2b32f3c55..1b343decbdbae6605d391e620d59bac629bb7201 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/lstrings.h"
 
@@ -88,14 +88,6 @@ void InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const
 }
 
 
-Dimension const InsetMathAMSArray::dimension(BufferView const & bv) const
-{
-       Dimension dim = InsetMathGrid::dimension(bv);
-       dim.wid += 14;
-       return dim;
-}
-
-
 void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const
 {
        Dimension const dim = dimension(*pi.base.bv);
@@ -117,7 +109,7 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
                if (s == "add-vline-left" || s == "add-vline-right") {
                        flag.message(bformat(
                                from_utf8(N_("Can't add vertical grid lines in '%1$s'")),       name_));
-                       flag.enabled(false);
+                       flag.setEnabled(false);
                        return true;
                }
                return InsetMathGrid::getStatus(cur, cmd, flag);
@@ -130,6 +122,7 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetMathAMSArray::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\begin{" << name_ << '}';
        InsetMathGrid::write(os);
        os << "\\end{" << name_ << '}';
@@ -154,7 +147,12 @@ void InsetMathAMSArray::normalize(NormalStream & os) const
 
 void InsetMathAMSArray::validate(LaTeXFeatures & features) const
 {
-       features.require("amsmath");
+       if (name_ == "CD")
+               // amscd is independent of amsmath although it is part of
+               // the amsmath bundle
+               features.require("amscd");
+       else
+               features.require("amsmath");
        InsetMathGrid::validate(features);
 }