]> git.lyx.org Git - features.git/commitdiff
remove selection_possible (fix a problem with selections not stucking inside tables)
authorAlfredo Braunstein <abraunst@lyx.org>
Mon, 6 Dec 2004 13:03:38 +0000 (13:03 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Mon, 6 Dec 2004 13:03:38 +0000 (13:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9347 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxfunc.C
src/text3.C

index 42b946086b33468d40a29e06cee8fe1f47b727ea..0d5886c9818542e2a2b2aff2619928e89de6a68e 100644 (file)
@@ -1,4 +1,9 @@
 
+2004-12-06  Alfredo Braunstein  <abraunst@lyx.org>
+
+       * lyxfunc.C: 
+       * text3.C: remove selection_possible global flag
+
 2004-12-06  Alfredo Braunstein  <abraunst@lyx.org>
 
        * text2.C (getSelectionSpan): remove
index 1e08a9708f362a4ad68899a65171e1b711518554..defb342f1bc95ca1edc1f8d55bf09371840176a9 100644 (file)
@@ -134,7 +134,6 @@ namespace biblio = lyx::biblio;
 
 extern BufferList bufferlist;
 extern LyXServer * lyxserver;
-extern bool selection_possible;
 
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
@@ -615,7 +614,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
        // we have not done anything wrong yet.
        errorstat = false;
        dispatch_buffer.erase();
-       selection_possible = false;
 
        bool update = true;
 
index 5f37f7de5b21d9e6c091cb5fb5455a17f0d5bdff..bc341780e3201e93567f173ea76ddc6e12a774fa 100644 (file)
@@ -83,10 +83,6 @@ using std::vector;
 
 extern string current_layout;
 
-// the selection possible is needed, that only motion events are
-// used, where the button press event was on the drawing area too
-bool selection_possible = false;
-
 
 namespace {
 
@@ -1084,7 +1080,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_MOUSE_TRIPLE:
                if (cmd.button() == mouse_button::button1) {
-                       selection_possible = true;
                        cursorHome(cur);
                        cur.resetAnchor();
                        cursorEnd(cur);
@@ -1095,7 +1090,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_MOUSE_DOUBLE:
                if (cmd.button() == mouse_button::button1) {
-                       selection_possible = true;
                        selectWord(cur, lyx::WHOLE_WORD_STRICT);
                        bv->haveSelection(cur.selection());
                }
@@ -1106,7 +1100,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                // Right click on a footnote flag opens float menu
                if (cmd.button() == mouse_button::button3) {
                        cur.clearSelection();
-                       selection_possible = false;
                        break;
                }
 
@@ -1120,8 +1113,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                        paste_internally = true;
                }
 
-               selection_possible = true;
-
                // Clear the selection
                cur.clearSelection();
 
@@ -1137,10 +1128,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                // Set cursor here.
                bv->cursor() = cur;
 
-               // Don't allow selection after a big jump.
-               //if (bv->fitCursor())
-               //      selection_possible = false;
-
                // Insert primary selection with middle mouse
                // if there is a local selection in the current buffer,
                // insert this
@@ -1149,7 +1136,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                                bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
                        else
                                bv->owner()->dispatch(FuncRequest(LFUN_PASTESELECTION, "paragraph"));
-                       selection_possible = false;
                }
 
                break;
@@ -1159,14 +1145,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                // 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();
@@ -1205,8 +1183,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_MOUSE_RELEASE: {
-               selection_possible = false;
-
                if (cmd.button() == mouse_button::button2)
                        break;