]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_xyarrowinset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_xyarrowinset.C
index 50e80a2bff5ebc7a306311f7229ea88782342516..bb16eb90dd83e914f37639eaeeee9e814b3034e0 100644 (file)
@@ -1,8 +1,16 @@
-#include <config.h>
+/**
+ * \file math_xyarrowinset.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.
+ */
 
+#include <config.h>
 
 #include "math_xyarrowinset.h"
-#include "math_xymatrixinset.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 #include "math_support.h"
@@ -18,9 +26,9 @@ MathXYArrowInset::MathXYArrowInset()
 {}
 
 
-InsetBase * MathXYArrowInset::clone() const
+std::auto_ptr<InsetBase> MathXYArrowInset::clone() const
 {
-       return new MathXYArrowInset(*this);
+       return std::auto_ptr<InsetBase>(new MathXYArrowInset(*this));
 }
 
 
@@ -52,7 +60,7 @@ MathArray const & MathXYArrowInset::targetCell() const
                       << "target: n: " << n << " out of range" << endl;
                n = 0;
        }
-  return p->cell(n);
+       return p->cell(n);
 #else
        static MathArray dummy;
        return dummy;
@@ -63,7 +71,7 @@ MathArray const & MathXYArrowInset::targetCell() const
 MathArray const & MathXYArrowInset::sourceCell() const
 {
 #if 0
-  return targetMatrix()->cell(mi_.idx);
+       return targetMatrix()->cell(mi_.idx);
 #else
        static MathArray dummy;
        return dummy;
@@ -109,18 +117,18 @@ void MathXYArrowInset::draw(PainterInfo & pi, int x, int y) const
                mathed_string_dim(pi.base.font, "target: ", lasc, ldes, lwid);
 
                cell(0).draw(pi, x + lwid, y);
-               drawStr(pi, pi.base.font, x + 3, y, "target");
+               pi.base.text(x + 3, y, "target");
                y += max(cell(0).descent(), ldes) + 5;
 
                y += max(cell(1).ascent(), lasc) + 5;
                cell(1).draw(pi, x + lwid, y);
-               drawStr(pi, pi.base.font, x + 3, y, "label");
+               pi.base.text(x + 3, y, "label");
 
 #endif
 
        } else {
 
-               drawStr(pi, font_, x, y, "X");
+               pi.pain.text(x, y, "X");
                MathArray const & s = sourceCell();
                MathArray const & t = targetCell();
                pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);