]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSubstack.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathSubstack.cpp
index 19021f2ce0c9138668e7062cbe8f62dc39c23e5e..059e02955149ba69177645ecc1977db4881da83a 100644 (file)
 
 #include <config.h>
 
-#include "LaTeXFeatures.h"
 #include "InsetMathSubstack.h"
+
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
-#include "support/std_ostream.h"
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/lstrings.h"
 
+#include <ostream>
+
+using namespace std;
 
 namespace lyx {
 
 using support::bformat;
 
-using std::string;
 
 InsetMathSubstack::InsetMathSubstack()
        : InsetMathGrid(1, 1)
@@ -40,7 +42,7 @@ Inset * InsetMathSubstack::clone() const
 }
 
 
-bool InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (mi.base.style == LM_ST_DISPLAY) {
                StyleChanger dummy(mi.base, LM_ST_TEXT);
@@ -48,10 +50,6 @@ bool InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
        } else {
                InsetMathGrid::metrics(mi, dim);
        }
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
 }
 
 
@@ -72,7 +70,7 @@ bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
                        flag.message(bformat(
                                from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
                                from_utf8(name)));
-                       flag.enabled(false);
+                       flag.setEnabled(false);
                        return true;
                }
                return InsetMathGrid::getStatus(cur, cmd, flag);
@@ -91,6 +89,7 @@ void InsetMathSubstack::infoize(odocstream & os) const
 
 void InsetMathSubstack::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\substack{";
        InsetMathGrid::write(os);
        os << "}\n";