]> git.lyx.org Git - lyx.git/blobdiff - src/cursor_slice.C
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / cursor_slice.C
index 3cf9cdffa9bf1b1c0150946004217dc9c5d10575..59e544736641527e4a129fd010c535eb697bb04b 100644 (file)
@@ -30,12 +30,12 @@ using std::endl;
 
 
 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_);
 }
@@ -62,42 +62,6 @@ size_t CursorSlice::ncols() const
 }
 
 
-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_);
@@ -105,18 +69,6 @@ CursorSlice::pos_type CursorSlice::lastpos() const
 }
 
 
-bool CursorSlice::boundary() const
-{
-       return boundary_;
-}
-
-
-bool & CursorSlice::boundary()
-{
-       return boundary_;
-}
-
-
 CursorSlice::row_type CursorSlice::row() const
 {
        BOOST_ASSERT(asMathInset());
@@ -163,7 +115,7 @@ Paragraph & CursorSlice::paragraph()
 {
        // access to the main lyx text must be handled in the cursor
        BOOST_ASSERT(text());
-       return *text()->getPar(par_);
+       return text()->getPar(pit_);
 }
 
 
@@ -171,7 +123,7 @@ Paragraph const & CursorSlice::paragraph() const
 {
        // access to the main lyx text must be handled in the cursor
        BOOST_ASSERT(text());
-       return *text()->getPar(par_);
+       return text()->getPar(pit_);
 }
 
 
@@ -179,7 +131,7 @@ bool operator==(CursorSlice const & p, CursorSlice const & q)
 {
        return &p.inset() == &q.inset()
               && p.idx() == q.idx()
-              && p.par() == q.par()
+              && p.pit() == q.pit()
               && p.pos() == q.pos();
 }
 
@@ -188,7 +140,7 @@ bool operator!=(CursorSlice const & p, CursorSlice const & q)
 {
        return &p.inset() != &q.inset()
               || p.idx() != q.idx()
-              || p.par() != q.par()
+              || p.pit() != q.pit()
               || p.pos() != q.pos();
 }
 
@@ -198,12 +150,12 @@ bool operator<(CursorSlice const & p, CursorSlice const & q)
        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();
 }
 
@@ -214,13 +166,19 @@ bool operator>(CursorSlice const & p, CursorSlice const & q)
 }
 
 
+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()