]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathAMSArray.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathAMSArray.cpp
index 16ddb91f3c6c450d464d036aa249918a7518d86e..9bcff0c41ffdd742b613262f4d969aecfdf9ce51 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -122,11 +122,10 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetMathAMSArray::write(WriteStream & os) const
 {
-       bool brace = ensureMath(os);
+       MathEnsurer ensurer(os);
        os << "\\begin{" << name_ << '}';
        InsetMathGrid::write(os);
        os << "\\end{" << name_ << '}';
-       os.pendingBrace(brace);
 }
 
 
@@ -148,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);
 }