]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
Change to use preffered calling of Boost.Function
[lyx.git] / src / text3.C
index 4b69a2b0106a5930ea578bd6f241903dec718d95..869cda8b7bfcb87817bcd63cd30bea3fa6716976 100644 (file)
@@ -1060,43 +1060,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                }
                break;
 
-       case LFUN_MOUSE_MOTION: {
-               // Only use motion with button 1
-               //if (cmd.button() != mouse_button::button1)
-               //      return false;
-               // We want to use only motion events for which
-               // the button press event was on the drawing area too.
-               if (!selection_possible) {
-                       lyxerr[Debug::ACTION] << "BufferView::Pimpl::"
-                               "dispatch: no selection possible\n";
-                       lyxerr << "BufferView::Pimpl::dispatch: no selection possible\n";
-                       break;
-               }
-
-               // ignore motions deeper nested than the real anchor
-               LCursor & bvcur = cur.bv().cursor();
-               if (bvcur.selection() && bvcur.anchor_.size() < cur.size())
-                       break;
-
-               CursorSlice old = cur.top();
-               setCursorFromCoordinates(cur, cmd.x, cmd.y);
-
-               // This is to allow jumping over large insets
-               // FIXME: shouldn't be top-text-specific
-               if (isMainText() && cur.top() == old) {
-                       if (cmd.y - bv->top_y() >= bv->workHeight())
-                               cursorDown(cur);
-                       else if (cmd.y - bv->top_y() < 0)
-                               cursorUp(cur);
-               }
-
-               // don't set anchor_
-               bv->cursor().setCursor(cur);
-               bv->cursor().selection() = true;
-               lyxerr << "MOTION: " << bv->cursor() << endl;
-               break;
-       }
-
        // Single-click on work area
        case LFUN_MOUSE_PRESS: {
                // Right click on a footnote flag opens float menu
@@ -1151,6 +1114,42 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                break;
        }
 
+       case LFUN_MOUSE_MOTION: {
+               // Only use motion with button 1
+               //if (cmd.button() != mouse_button::button1)
+               //      return false;
+               // We want to use only motion events for which
+               // the button press event was on the drawing area too.
+               if (!selection_possible) {
+                       lyxerr[Debug::ACTION] << "BufferView::Pimpl::"
+                               "dispatch: no selection possible\n";
+                       lyxerr << "BufferView::Pimpl::dispatch: no selection possible\n";
+                       break;
+               }
+
+               // ignore motions deeper nested than the real anchor
+               LCursor & bvcur = cur.bv().cursor();
+               if (bvcur.anchor_.hasPart(cur)) {
+                       CursorSlice old = cur.top();
+                       setCursorFromCoordinates(cur, cmd.x, cmd.y);
+
+                       // This is to allow jumping over large insets
+                       // FIXME: shouldn't be top-text-specific
+                       if (isMainText() && cur.top() == old) {
+                               if (cmd.y - bv->top_y() >= bv->workHeight())
+                                       cursorDown(cur);
+                               else if (cmd.y - bv->top_y() < 0)
+                                       cursorUp(cur);
+                       }
+
+                       // don't set anchor_
+                       bv->cursor().setCursor(cur);
+                       bv->cursor().selection() = true;
+                       lyxerr << "MOTION: " << bv->cursor() << endl;
+               }
+               break;
+       }
+
        case LFUN_MOUSE_RELEASE: {
                selection_possible = false;