]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Make document_language non-mutable
[lyx.git] / src / Cursor.cpp
index 964b593f231138fe62b0e3eacaa791ad9c843475..fe03a31095b83b840d79c3560e768ebbdf0ea84b 100644 (file)
@@ -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);