]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_pos.C
fix #1073
[lyx.git] / src / mathed / math_pos.C
index 4c36ba1a0c9e2bc588dd665442b34f00703c3c69..3ed162d8b801c412cd8e800ed08a528d2178d27b 100644 (file)
@@ -1,15 +1,12 @@
-#include "config.h"
-
-#include <iostream>
 
+#include "config.h"
 #include "math_pos.h"
 #include "math_inset.h"
 #include "debug.h"
 #include "support/LAssert.h"
+#include "support/LOstream.h"
 
 
-using std::ostream;
-
 MathCursorPos::MathCursorPos()
        : par_(0), idx_(0), pos_(0)
 {}
@@ -37,35 +34,21 @@ MathArray & MathCursorPos::cell() const
 }
 
 
-MathXArray & MathCursorPos::xcell(MathArray::idx_type idx) const
-{
-       lyx::Assert(par_);
-       return par_->xcell(idx);
-}
-
-
-MathXArray & MathCursorPos::xcell() const
-{
-       lyx::Assert(par_);
-       return par_->xcell(idx_);
-}
-
-
-int MathCursorPos::xpos() const
+void MathCursorPos::getPos(int & x, int & y) const
 {
-       return xcell().xo() + xcell().pos2x(pos_);
+       par_->getPos(idx_, pos_, x, y);
 }
 
 
-int MathCursorPos::ypos() const
+void MathCursorPos::setPos(MathArray::pos_type pos)
 {
-       return xcell().yo();
+       pos_ = pos;
 }
 
 
-ostream & operator<<(ostream & os, MathCursorPos const & p)
+std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
 {
-       os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ")";
+       os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ')';
        return os;
 }
 
@@ -92,5 +75,3 @@ bool operator<(MathCursorPos const & p, MathCursorPos const & q)
                return p.idx_ < q.idx_;
        return p.pos_ < q.pos_;
 }
-
-