]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSplit.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathSplit.cpp
index 287073bc45e61d1a4e2558b0e82a399324df5bee..93799d88371a3bdf92dea8e8d576b7bda12d1ff1 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.
  */
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 
 #include "support/lstrings.h"
 
 #include <ostream>
 
+using namespace std;
 
 namespace lyx {
 
 using support::bformat;
 
-using std::string;
-
 
 InsetMathSplit::InsetMathSplit(docstring const & name, char valign)
        : InsetMathGrid(1, 1, valign, docstring()), name_(name)
@@ -75,7 +74,7 @@ bool InsetMathSplit::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);
@@ -88,11 +87,12 @@ bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetMathSplit::write(WriteStream & ws) const
 {
+       MathEnsurer ensurer(ws);
        if (ws.fragile())
                ws << "\\protect";
        ws << "\\begin{" << name_ << '}';
-       if (name_ != "split" && valign() != 'c')
-               ws << '[' << valign() << ']';
+       if (name_ != "split" && verticalAlignment() != 'c')
+               ws << '[' << verticalAlignment() << ']';
        if (name_ == "alignedat")
                ws << '{' << static_cast<unsigned int>((ncols() + 1)/2) << '}';
        InsetMathGrid::write(ws);