]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_xyarrowinset.C
mathed uglyfication
[lyx.git] / src / mathed / math_xyarrowinset.C
index e9d9bcdf5c19fbb855d43aa34ba94bf138893d85..522d3e0d8c2e361ea7ef041b251f5b7c30dbbee9 100644 (file)
@@ -1,8 +1,14 @@
-#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.
+ */
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include <config.h>
 
 #include "math_xyarrowinset.h"
 #include "math_xymatrixinset.h"
@@ -21,9 +27,9 @@ MathXYArrowInset::MathXYArrowInset()
 {}
 
 
-MathInset * MathXYArrowInset::clone() const
+auto_ptr<InsetBase> MathXYArrowInset::clone() const
 {
-       return new MathXYArrowInset(*this);
+       return auto_ptr<InsetBase>(new MathXYArrowInset(*this));
 }
 
 
@@ -35,7 +41,7 @@ MathXYMatrixInset const * MathXYArrowInset::targetMatrix() const
 
 MathArray const & MathXYArrowInset::targetCell() const
 {
-#if 0  
+#if 0
        MathXYMatrixInset const * p = targetMatrix();
        int x = 0;
        int y = 0;
@@ -48,11 +54,11 @@ 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);
@@ -74,11 +80,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;
 
@@ -97,10 +103,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()) {
 
@@ -137,9 +143,9 @@ void MathXYArrowInset::write(WriteStream & os) const
 {
        os << "\\ar";
        if (cell(0).size())
-               os << "[" << cell(0) << "]";
+               os << '[' << cell(0) << ']';
        if (cell(1).size())
-               os << (up_ ? "^" : "_") << "{" << cell(1) << "}";
+               os << (up_ ? '^' : '_') << '{' << cell(1) << '}';
        os << " ";
 }
 
@@ -148,5 +154,5 @@ void MathXYArrowInset::normalize(NormalStream & os) const
 {
        os << "[xyarrow ";
        MathNestInset::normalize(os);
-       os << "]";
+       os << ']';
 }