#include "mathed/InsetMath.h"
#include "mathed/MathData.h"
-#include <boost/assert.hpp>
+#include "support/lassert.h"
#include <ostream>
CursorSlice::CursorSlice(Inset & p)
: inset_(&p), idx_(0), pit_(0), pos_(0)
{
- BOOST_ASSERT(inset_);
+ LASSERT(inset_, /**/);
}
pos_type CursorSlice::lastpos() const
{
- BOOST_ASSERT(inset_);
+ LASSERT(inset_, /**/);
return inset_->asInsetMath() ? cell().size()
: (text()->empty() ? 0 : paragraph().size());
}
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_);
}
// otherwise move on one cell
//lyxerr << "... next idx" << endl;
- BOOST_ASSERT(idx_ < nargs());
+ LASSERT(idx_ < nargs(), /**/);
++idx_;
pit_ = 0;
void CursorSlice::forwardIdx()
{
- BOOST_ASSERT(idx_ < nargs());
+ LASSERT(idx_ < nargs(), /**/);
++idx_;
pit_ = 0;
return;
}
- BOOST_ASSERT(false);
+ LASSERT(false, /**/);
}
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_;
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_;
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_;
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()
;
}