]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_xyarrowinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_xyarrowinset.C
index b0047d99ef30727b2bb2a2d9f3c6f81ea4898d1f..5ff8ef3437a01c0ccad5c65393a5aa6d06e3d9a1 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()
 {}
 
 
-MathInset * MathXYArrowInset::clone() const
+std::auto_ptr<InsetBase> MathXYArrowInset::clone() const
 {
-       return new MathXYArrowInset(*this);
+       return std::auto_ptr<InsetBase>(new MathXYArrowInset(*this));
 }
 
 
@@ -45,14 +53,14 @@ MathArray const & MathXYArrowInset::targetCell() const
                        case 'd': ++y; break;
                }
        }
-       //lyxerr << "target: x: " << x << " y: " << y << "\n";
+       //lyxerr << "target: x: " << x << " y: " << y << endl;
        MathInset::idx_type n = mi_.idx + p->ncols() * y + x;
        if (n >= p->nargs()) {
-               lyxerr << "source: n: " << mi_.idx << "\n";
-               lyxerr << "target: n: " << n << " out of range\n";
+               lyxerr << "source: n: " << mi_.idx << "\n"
+                      << "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;
@@ -71,11 +79,11 @@ MathArray const & MathXYArrowInset::sourceCell() const
 }
 
 
-void MathXYArrowInset::metrics(MathMetricsInfo & mi) const
+void MathXYArrowInset::metrics(MetricsInfo & mi) const
 {
        MathNestInset::metrics(mi);
        mi_   = mi;
-       MathFontSetChanger dummy(mi.base, "textrm");
+       FontSetChanger dummy(mi.base, "textrm");
 #if 0
        target_ = mi.inset ? mi.inset->asXYMatrixInset() : 0;
 
@@ -94,10 +102,10 @@ void MathXYArrowInset::metrics(MathMetricsInfo & mi) const
 }
 
 
-void MathXYArrowInset::draw(MathPainterInfo & pi, int x, int y) const
+void MathXYArrowInset::draw(PainterInfo & pi, int x, int y) const
 {
        metrics(mi_);
-       MathFontSetChanger dummy(pi.base, "textrm");
+       FontSetChanger dummy(pi.base, "textrm");
 
        if (editing()) {