X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_pos.C;h=b4d53521dbc943bb5bff9f84f5e1db93fd5107ec;hb=d359dd8fca52c4f0100f7cf4bf636113c5c4e49f;hp=889f13782a73ce563b4b94cc9b1430f0f88fe2f4;hpb=fe31e337c13c4db657a267c7a9cf9869a10db696;p=lyx.git diff --git a/src/mathed/math_pos.C b/src/mathed/math_pos.C index 889f13782a..b4d53521db 100644 --- a/src/mathed/math_pos.C +++ b/src/mathed/math_pos.C @@ -8,48 +8,46 @@ #include "support/LAssert.h" +using std::ostream; + MathCursorPos::MathCursorPos() : par_(0), idx_(0), pos_(0) {} -MathCursorPos::MathCursorPos(MathAtom & t) - : par_(&t), idx_(0), pos_(0) +MathCursorPos::MathCursorPos(MathInset * p) + : par_(p), idx_(0), pos_(0) { lyx::Assert(par_); - lyx::Assert(par_->nucleus()); } + MathArray & MathCursorPos::cell(MathArray::idx_type idx) const { lyx::Assert(par_); - lyx::Assert(par_->nucleus()); - return par_->nucleus()->cell(idx); + return par_->cell(idx); } MathArray & MathCursorPos::cell() const { lyx::Assert(par_); - lyx::Assert(par_->nucleus()); - return par_->nucleus()->cell(idx_); + return par_->cell(idx_); } MathXArray & MathCursorPos::xcell(MathArray::idx_type idx) const { lyx::Assert(par_); - lyx::Assert(par_->nucleus()); - return par_->nucleus()->xcell(idx); + return par_->xcell(idx); } MathXArray & MathCursorPos::xcell() const { lyx::Assert(par_); - lyx::Assert(par_->nucleus()); - return par_->nucleus()->xcell(idx_); + return par_->xcell(idx_); } @@ -65,7 +63,7 @@ int MathCursorPos::ypos() const } -std::ostream & operator<<(std::ostream & os, MathCursorPos const & p) +ostream & operator<<(ostream & os, MathCursorPos const & p) { os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ")"; return os; @@ -94,5 +92,3 @@ bool operator<(MathCursorPos const & p, MathCursorPos const & q) return p.idx_ < q.idx_; return p.pos_ < q.pos_; } - -