CursorSlice::CursorSlice()
- : inset_(0), idx_(0), par_(0), pos_(0), boundary_(false)
+ : inset_(0), idx_(0), pit_(0), pos_(0), boundary_(false)
{}
CursorSlice::CursorSlice(InsetBase & p)
- : inset_(&p), idx_(0), par_(0), pos_(0), boundary_(false)
+ : inset_(&p), idx_(0), pit_(0), pos_(0), boundary_(false)
{
BOOST_ASSERT(inset_);
}
}
-CursorSlice::idx_type CursorSlice::idx() const
-{
- return idx_;
-}
-
-
-CursorSlice::idx_type & CursorSlice::idx()
-{
- return idx_;
-}
-
-
-CursorSlice::par_type CursorSlice::par() const
-{
- return par_;
-}
-
-
-CursorSlice::par_type & CursorSlice::par()
-{
- return par_;
-}
-
-
-CursorSlice::pos_type CursorSlice::pos() const
-{
- return pos_;
-}
-
-
-CursorSlice::pos_type & CursorSlice::pos()
-{
- return pos_;
-}
-
-
CursorSlice::pos_type CursorSlice::lastpos() const
{
BOOST_ASSERT(inset_);
}
-bool CursorSlice::boundary() const
-{
- return boundary_;
-}
-
-
-bool & CursorSlice::boundary()
-{
- return boundary_;
-}
-
-
CursorSlice::row_type CursorSlice::row() const
{
BOOST_ASSERT(asMathInset());
{
// access to the main lyx text must be handled in the cursor
BOOST_ASSERT(text());
- return *text()->getPar(par_);
+ return text()->getPar(pit_);
}
{
// access to the main lyx text must be handled in the cursor
BOOST_ASSERT(text());
- return *text()->getPar(par_);
+ return text()->getPar(pit_);
}
{
return &p.inset() == &q.inset()
&& p.idx() == q.idx()
- && p.par() == q.par()
+ && p.pit() == q.pit()
&& p.pos() == q.pos();
}
{
return &p.inset() != &q.inset()
|| p.idx() != q.idx()
- || p.par() != q.par()
+ || p.pit() != q.pit()
|| p.pos() != q.pos();
}
if (&p.inset() != &q.inset()) {
lyxerr << "can't compare cursor and anchor in different insets\n"
<< "p: " << p << '\n' << "q: " << q << endl;
- return true;
+ BOOST_ASSERT(false);
}
if (p.idx() != q.idx())
return p.idx() < q.idx();
- if (p.par() != q.par())
- return p.par() < q.par();
+ if (p.pit() != q.pit())
+ return p.pit() < q.pit();
return p.pos() < q.pos();
}
}
+bool operator<=(CursorSlice const & p, CursorSlice const & q)
+{
+ return !(q < p);
+}
+
+
std::ostream & operator<<(std::ostream & os, CursorSlice const & item)
{
return os
<< "inset: " << &item.inset()
// << " text: " << item.text()
<< " idx: " << item.idx()
- << " par: " << item.par()
+ << " par: " << item.pit()
<< " pos: " << item.pos()
// << " x: " << item.inset().x()
// << " y: " << item.inset().y()