]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Convert cursorX() and computeRowMetrics() to the new scheme
[lyx.git] / src / Cursor.cpp
index d43196516365a45b60924b6d1b1bbe470ab6535a..7dff9328b42f17ab17282a0acc5b7463e60e8eb1 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)
@@ -635,7 +619,6 @@ bool Cursor::posVisRight(bool skip_inset)
        Cursor new_cur = *this; // where we will move to
        pos_type left_pos; // position visually left of current cursor
        pos_type right_pos; // position visually right of current cursor
-       bool new_pos_is_RTL; // is new position we're moving to RTL?
 
        getSurroundingPos(left_pos, right_pos);
 
@@ -679,7 +662,7 @@ bool Cursor::posVisRight(bool skip_inset)
                // we're currently to the left of 'right_pos'). In
                // order to move to the right, it depends whether or
                // not the character at 'right_pos' is RTL.
-               new_pos_is_RTL = paragraph().getFontSettings(
+               bool const new_pos_is_RTL = paragraph().getFontSettings(
                        buffer()->params(), right_pos).isVisibleRightToLeft();
                // If the character at 'right_pos' *is* LTR, then in
                // order to move to the right of it, we need to be
@@ -735,7 +718,6 @@ bool Cursor::posVisLeft(bool skip_inset)
        Cursor new_cur = *this; // where we will move to
        pos_type left_pos; // position visually left of current cursor
        pos_type right_pos; // position visually right of current cursor
-       bool new_pos_is_RTL; // is new position we're moving to RTL?
 
        getSurroundingPos(left_pos, right_pos);
 
@@ -779,7 +761,7 @@ bool Cursor::posVisLeft(bool skip_inset)
                // currently to the right of 'left_pos'). In order to
                // move to the left, it depends whether or not the
                // character at 'left_pos' is RTL.
-               new_pos_is_RTL = paragraph().getFontSettings(
+               bool const new_pos_is_RTL = paragraph().getFontSettings(
                        buffer()->params(), left_pos).isVisibleRightToLeft();
                // If the character at 'left_pos' *is* RTL, then in
                // order to move to the left of it, we need to be
@@ -1219,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())