X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursorSlice.cpp;h=c4b1c72f80d803868a01b39e226e66cf1cba4841;hb=f7cfdc48a5c4ec4d9e52a39d37b76880583ec8ad;hp=3eb45e567fb2f694383ab189b7bd401d089c8a1c;hpb=260acacf1bd31159b1efb993c88b0b94ab187e65;p=lyx.git diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index 3eb45e567f..c4b1c72f80 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -3,10 +3,10 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Matthias Ettrich - * \author André Pönitz - * \author Jürgen Vigna + * \author André Pönitz + * \author Jürgen Vigna * * Full author contact details are available in file CREDITS. */ @@ -25,7 +25,7 @@ #include "mathed/InsetMath.h" #include "mathed/MathData.h" -#include +#include "support/lassert.h" #include @@ -42,7 +42,7 @@ CursorSlice::CursorSlice() CursorSlice::CursorSlice(Inset & p) : inset_(&p), idx_(0), pit_(0), pos_(0) { - BOOST_ASSERT(inset_); + LASSERT(inset_, /**/); } @@ -60,7 +60,7 @@ Paragraph & CursorSlice::paragraph() const pos_type CursorSlice::lastpos() const { - BOOST_ASSERT(inset_); + LASSERT(inset_, /**/); return inset_->asInsetMath() ? cell().size() : (text()->empty() ? 0 : paragraph().size()); } @@ -76,14 +76,14 @@ pit_type CursorSlice::lastpit() const CursorSlice::row_type CursorSlice::row() const { - BOOST_ASSERT(asInsetMath()); + LASSERT(asInsetMath(), /**/); return asInsetMath()->row(idx_); } CursorSlice::col_type CursorSlice::col() const { - BOOST_ASSERT(asInsetMath()); + LASSERT(asInsetMath(), /**/); return asInsetMath()->col(idx_); } @@ -108,7 +108,7 @@ void CursorSlice::forwardPos() // otherwise move on one cell //lyxerr << "... next idx" << endl; - BOOST_ASSERT(idx_ < nargs()); + LASSERT(idx_ < nargs(), /**/); ++idx_; pit_ = 0; @@ -118,7 +118,7 @@ void CursorSlice::forwardPos() void CursorSlice::forwardIdx() { - BOOST_ASSERT(idx_ < nargs()); + LASSERT(idx_ < nargs(), /**/); ++idx_; pit_ = 0; @@ -146,7 +146,7 @@ void CursorSlice::backwardPos() return; } - BOOST_ASSERT(false); + LASSERT(false, /**/); } @@ -164,7 +164,7 @@ bool CursorSlice::at_begin() const bool operator==(CursorSlice const & p, CursorSlice const & q) { - return &p.inset_ == &q.inset_ + return p.inset_ == q.inset_ && p.idx_ == q.idx_ && p.pit_ == q.pit_ && p.pos_ == q.pos_; @@ -173,7 +173,7 @@ bool operator==(CursorSlice const & p, CursorSlice const & q) bool operator!=(CursorSlice const & p, CursorSlice const & q) { - return &p.inset_ != &q.inset_ + return p.inset_ != q.inset_ || p.idx_ != q.idx_ || p.pit_ != q.pit_ || p.pos_ != q.pos_; @@ -182,10 +182,10 @@ bool operator!=(CursorSlice const & p, CursorSlice const & q) bool operator<(CursorSlice const & p, CursorSlice const & q) { - if (&p.inset_ != &q.inset_) { + if (p.inset_ != q.inset_) { LYXERR0("can't compare cursor and anchor in different insets\n" << "p: " << p << '\n' << "q: " << q); - BOOST_ASSERT(false); + LASSERT(false, /**/); } if (p.idx_ != q.idx_) return p.idx_ < q.idx_; @@ -210,13 +210,13 @@ bool operator<=(CursorSlice const & p, CursorSlice const & q) ostream & operator<<(ostream & os, CursorSlice const & item) { return os - << "inset: " << (void *)&item.inset_ + << "inset: " << (void *)item.inset_ // << " text: " << item.text() << " idx: " << item.idx_ << " par: " << item.pit_ << " pos: " << item.pos_ -// << " x: " << item.inset_.x() -// << " y: " << item.inset_.y() +// << " x: " << item.inset_->x() +// << " y: " << item.inset_->y() ; }