]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_xymatrixinset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_xymatrixinset.C
index 9606bfc8a2ad975b454e491261a81b071e40a5ef..581dab36eecdf38db12fe2ea1b2c94f0adc7eb14 100644 (file)
@@ -1,31 +1,51 @@
-#include <config.h>
+/**
+ * \file math_xymatrixinset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include <config.h>
 
 #include "math_xymatrixinset.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
+#include "LaTeXFeatures.h"
+#include "support/std_ostream.h"
+
 
 MathXYMatrixInset::MathXYMatrixInset()
        : MathGridInset(1, 1)
 {}
 
 
-MathInset * MathXYMatrixInset::clone() const
+std::auto_ptr<InsetBase> MathXYMatrixInset::doClone() const
+{
+       return std::auto_ptr<InsetBase>(new MathXYMatrixInset(*this));
+}
+
+
+int MathXYMatrixInset::colsep() const
 {
-       return new MathXYMatrixInset(*this);
+       return 40;
 }
 
 
-void MathXYMatrixInset::metrics(MathMetricsInfo const & st) const
+int MathXYMatrixInset::rowsep() const
 {
-       MathMetricsInfo mi = st;
-       if (mi.style == LM_ST_DISPLAY)
-               mi.style = LM_ST_TEXT;
-       MathGridInset::metrics(mi);
+       return 40;
+}
+
+
+void MathXYMatrixInset::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       if (mi.base.style == LM_ST_DISPLAY)
+               mi.base.style = LM_ST_TEXT;
+       MathGridInset::metrics(mi, dim);
 }
 
 
@@ -37,17 +57,24 @@ void MathXYMatrixInset::write(WriteStream & os) const
 }
 
 
+void MathXYMatrixInset::infoize(std::ostream & os) const
+{
+       os << "xymatrix ";
+       MathGridInset::infoize(os);
+}
+
+
 void MathXYMatrixInset::normalize(NormalStream & os) const
 {
        os << "[xymatrix ";
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
-void MathXYMatrixInset::maplize(MapleStream & os) const
+void MathXYMatrixInset::maple(MapleStream & os) const
 {
        os << "xymatrix(";
-       MathGridInset::maplize(os);
-       os << ")";
+       MathGridInset::maple(os);
+       os << ')';
 }