From: Enrico Forestieri Date: Thu, 5 Jun 2014 21:46:18 +0000 (+0200) Subject: Fix bug #9151 (Wrong reverse search for images and tables). X-Git-Tag: 2.2.0alpha1~1861 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=44e09b223e0efad3346180ea13f9dfc8d3a58a49;p=features.git Fix bug #9151 (Wrong reverse search for images and tables). If the reverse position corresponds to an inset, its paragraph id does not follow the main text numbering. Typically, an inset has only a few paragraph, so that we would jump near the beginning of the document. In this way we at least jump at the beginning of the inset. --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index ba0df6ef5f..afc29be278 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2295,7 +2295,12 @@ void BufferView::setCursorFromRow(int row) DocIterator const dit = buffer_.getParFromID(tmpid); if (dit == doc_iterator_end(&buffer_)) posvalid = false; - else { + else if (dit.depth() > 1) { + // We are an inset. + setCursor(dit); + recenter(); + return; + } else { newpit = dit.pit(); // now have to check pos. newpos = tmppos;