X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fcursor_slice.C;h=eda679a2e95750fa10c79da8517003c57dd63ba3;hb=61133c4b5625993f600ffa7d209c3e2bc28d26f6;hp=b98aed8f25df35b131230be3f8201f9974426286;hpb=e22c5f4d97b53a5d2adcbf7bbc7ba2dd40ef40de;p=lyx.git diff --git a/src/cursor_slice.C b/src/cursor_slice.C index b98aed8f25..eda679a2e9 100644 --- a/src/cursor_slice.C +++ b/src/cursor_slice.C @@ -21,44 +21,38 @@ #include "mathed/math_inset.h" #include "mathed/math_data.h" -#include "insets/updatableinset.h" - - #include using std::endl; CursorSlice::CursorSlice() - : inset_(0), idx_(0), pit_(0), pos_(0), boundary_(false) + : inset_(0), idx_(0), pit_(0), pos_(0) {} CursorSlice::CursorSlice(InsetBase & p) - : inset_(&p), idx_(0), pit_(0), pos_(0), boundary_(false) + : inset_(&p), idx_(0), pit_(0), pos_(0) { BOOST_ASSERT(inset_); } -size_t CursorSlice::nargs() const +MathArray & CursorSlice::cell() const { - BOOST_ASSERT(inset_); - return inset_->nargs(); + return inset_->asMathInset()->cell(idx_); } -size_t CursorSlice::nrows() const +Paragraph & CursorSlice::paragraph() { - BOOST_ASSERT(inset_); - return inset_->nrows(); + return text()->getPar(pit_); } -size_t CursorSlice::ncols() const +Paragraph const & CursorSlice::paragraph() const { - BOOST_ASSERT(inset_); - return inset_->ncols(); + return text()->getPar(pit_); } @@ -83,56 +77,6 @@ CursorSlice::col_type CursorSlice::col() const } -MathInset * CursorSlice::asMathInset() const -{ - BOOST_ASSERT(inset_); - return inset_->asMathInset(); -} - - -UpdatableInset * CursorSlice::asUpdatableInset() const -{ - BOOST_ASSERT(inset_); - return inset_->asUpdatableInset(); -} - - -MathArray & CursorSlice::cell() const -{ - BOOST_ASSERT(asMathInset()); - return asMathInset()->cell(idx_); -} - - -LyXText * CursorSlice::text() -{ - BOOST_ASSERT(inset_); - return inset_->getText(idx_); -} - -LyXText const * CursorSlice::text() const -{ - BOOST_ASSERT(inset_); - return inset_->getText(idx_); -} - - -Paragraph & CursorSlice::paragraph() -{ - // access to the main lyx text must be handled in the cursor - BOOST_ASSERT(text()); - return text()->getPar(pit_); -} - - -Paragraph const & CursorSlice::paragraph() const -{ - // access to the main lyx text must be handled in the cursor - BOOST_ASSERT(text()); - return text()->getPar(pit_); -} - - bool operator==(CursorSlice const & p, CursorSlice const & q) { return &p.inset() == &q.inset()