X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.cpp;h=fe03a31095b83b840d79c3560e768ebbdf0ea84b;hb=f7be88ce4c2bbc10c4691e614a54fca427a2e8fb;hp=964b593f231138fe62b0e3eacaa791ad9c843475;hpb=065db6806771190d12d37d64c4c86f9c5ebaf225;p=lyx.git diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 964b593f23..fe03a31095 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -65,22 +65,6 @@ namespace lyx { namespace { -bool positionable(DocIterator const & cursor, DocIterator const & anchor) -{ - // avoid deeper nested insets when selecting - if (cursor.depth() > anchor.depth()) - return false; - - // anchor might be deeper, should have same path then - for (size_t i = 0; i < cursor.depth(); ++i) - if (&cursor[i].inset() != &anchor[i].inset()) - return false; - - // position should be ok. - return true; -} - - // Find position closest to (x, y) in cell given by iter. // Used only in mathed DocIterator bruteFind2(Cursor const & c, int x, int y) @@ -1217,8 +1201,6 @@ DocIterator Cursor::selectionEnd() const void Cursor::setSelection() { setSelection(true); - // A selection with no contents is not a selection - // FIXME: doesnt look ok if (idx() == normalAnchor().idx() && pit() == normalAnchor().pit() && pos() == normalAnchor().pos()) @@ -2108,9 +2090,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded) Row const & real_next_row = tm.parMetrics(pit()).rows()[next_row]; bool bound = false; - pos_type const col = tm.getColumnNearX(pit(), real_next_row, - xo, bound); - top().pos() = real_next_row.pos() + col; + top().pos() = tm.getPosNearX(real_next_row, xo, bound); boundary(bound); updateNeeded |= bv().checkDepm(*this, old);