]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_tabularinset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_tabularinset.C
index 571b1bc30b6dfc2141b0f455672f8717325fccd5..eb4fe3e8eb374f89410bdba729e5c3cef20c2911 100644 (file)
@@ -15,6 +15,9 @@
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
+#include "support/lstrings.h"
+#include "support/std_ostream.h"
+
 #include <iterator>
 
 
@@ -39,23 +42,25 @@ MathTabularInset::MathTabularInset(string const & name, char valign,
 {}
 
 
-auto_ptr<InsetBase> MathTabularInset::clone() const
+auto_ptr<InsetBase> MathTabularInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathTabularInset(*this));
 }
 
 
-void MathTabularInset::metrics(MetricsInfo & mi, Dimension & /*dim*/) const
+void MathTabularInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        FontSetChanger dummy(mi.base, "textnormal");
-       return MathGridInset::metrics(mi);
+       MathGridInset::metrics(mi, dim);
+       dim.wid += 6;
+       dim_ = dim;
 }
 
 
 void MathTabularInset::draw(PainterInfo & pi, int x, int y) const
 {
        FontSetChanger dummy(pi.base, "textnormal");
-       MathGridInset::draw(pi, x, y);
+       MathGridInset::drawWithMargin(pi, x, y, 4, 2);
 }
 
 
@@ -79,6 +84,14 @@ void MathTabularInset::write(WriteStream & os) const
 }
 
 
+void MathTabularInset::infoize(std::ostream & os) const
+{
+       string name = name_;
+       name[0] = lyx::support::uppercase(name[0]);
+       os << name << ' ';
+}
+
+
 void MathTabularInset::normalize(NormalStream & os) const
 {
        os << '[' << name_ << ' ';