X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FDocIterator.cpp;h=7c1924cb4586a95d5fc1edab17b9f1b71a06689d;hb=b4e609bd691b326756e802bb16524bb837b5a10e;hp=0f4bc10fac73a0e1fda35d8f4dcc9e044bfd2a9f;hpb=b5d6caac4149cc72cd5a734ffc8e9da1382bc9ee;p=features.git diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp index 0f4bc10fac..7c1924cb45 100644 --- a/src/DocIterator.cpp +++ b/src/DocIterator.cpp @@ -44,23 +44,6 @@ using namespace lyx::support; namespace lyx { -DocIterator::DocIterator() - : boundary_(false), inset_(nullptr), buffer_(nullptr) -{} - - -// We could be able to get rid of this if only every BufferView were -// associated to a buffer on construction. -DocIterator::DocIterator(Buffer * buf) - : boundary_(false), inset_(nullptr), buffer_(buf) -{} - - -DocIterator::DocIterator(Buffer * buf, Inset * inset) - : boundary_(false), inset_(inset), buffer_(buf) -{} - - DocIterator doc_iterator_begin(const Buffer * buf0, const Inset * inset0) { Buffer * buf = const_cast(buf0); @@ -271,7 +254,7 @@ pos_type DocIterator::lastpos() const } -DocIterator::idx_type DocIterator::lastidx() const +idx_type DocIterator::lastidx() const { return top().lastidx(); } @@ -298,13 +281,13 @@ size_t DocIterator::nrows() const } -DocIterator::row_type DocIterator::row() const +row_type DocIterator::row() const { return top().row(); } -DocIterator::col_type DocIterator::col() const +col_type DocIterator::col() const { return top().col(); } @@ -500,6 +483,18 @@ void DocIterator::backwardPos() } +void DocIterator::backwardPosIgnoreCollapsed() +{ + backwardPos(); + if (inTexted()) { + Inset const * ins = realInset(); + if (ins && !ins->editable()) { + pop_back(); // move out of collapsed inset + } + } +} + + #if 0 // works, but currently not needed void DocIterator::backwardInset() @@ -711,7 +706,7 @@ void DocIterator::append(vector const & x) } -void DocIterator::append(DocIterator::idx_type idx, pos_type pos) +void DocIterator::append(idx_type idx, pos_type pos) { slices_.push_back(CursorSlice()); top().idx() = idx;