]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathXYArrow.cpp
RefChanger
[lyx.git] / src / mathed / InsetMathXYArrow.cpp
index 62acb0a17420b0fdc12394c5a08ec90fae922b1e..19852e5de1a255d70f61100e6c16844c6f01b5b5 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include "frontends/Painter.h"
 #include "support/debug.h"
 
+using namespace std;
 
 namespace lyx {
 
 
-using std::max;
-
-
 InsetMathXYArrow::InsetMathXYArrow()
-       : InsetMathNest(2)
+       : InsetMathNest(2), up_(false), target_(0)
 {}
 
 
@@ -84,8 +82,8 @@ MathData const & InsetMathXYArrow::sourceCell() const
 bool InsetMathXYArrow::metrics(MetricsInfo & mi) const
 {
        InsetMathNest::metrics(mi);
-       mi_   = mi;
-       FontSetChanger dummy(mi.base, "textrm");
+       mi_ = mi;
+       Changer dummy = mi.base.changeFontSet(mi.base, "textrm");
 #if 0
        target_ = mi.inset ? mi.inset->asXYMatrixInset() : 0;
 
@@ -107,7 +105,7 @@ bool InsetMathXYArrow::metrics(MetricsInfo & mi) const
 void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const
 {
        metrics(mi_);
-       FontSetChanger dummy(pi.base, "textrm");
+       Changer dummy = pi.base.changeFontSet(pi.base, "textrm");
 
        if (editing()) {
 
@@ -142,10 +140,11 @@ void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathXYArrow::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\ar";
-       if (cell(0).size())
+       if (!cell(0).empty())
                os << '[' << cell(0) << ']';
-       if (cell(1).size())
+       if (!cell(1).empty())
                os << (up_ ? '^' : '_') << '{' << cell(1) << '}';
        os << " ";
 }
@@ -159,4 +158,15 @@ void InsetMathXYArrow::normalize(NormalStream & os) const
 }
 
 
+void InsetMathXYArrow::mathmlize(MathStream &) const
+{
+       throw MathExportException();
+}
+
+
+void InsetMathXYArrow::htmlize(HtmlStream &) const 
+{
+       throw MathExportException(); 
+}
+
 } // namespace lyx