]> git.lyx.org Git - lyx.git/blobdiff - src/cursor_slice.C
fix crash after removing a table row (again due to uncorrected cursor
[lyx.git] / src / cursor_slice.C
index 3cf9cdffa9bf1b1c0150946004217dc9c5d10575..f891844e196547906fa8ac0d54d414290325c0ab 100644 (file)
@@ -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(par_);
 }
 
 
@@ -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(par_);
 }
 
 
@@ -198,7 +150,7 @@ 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();
@@ -214,6 +166,12 @@ 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