]> git.lyx.org Git - features.git/commitdiff
inset-sel patch
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 16:28:13 +0000 (16:28 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 16:28:13 +0000 (16:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3132 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog

index 628522e85597f20b8d6a3b8c151b9f218f0c064c..1fb1f9c5a66751d22e1455a97ba69923ae205bf7 100644 (file)
@@ -776,7 +776,21 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
                // Inset like error, notes and figures
                selection_possible = false;
 
+               // if we reach this point with a selection, it
+               // must mean we are currently selecting.
+               // But we don't want to open the inset
+               // because that is annoying for the user. 
+               // So just pretend we didn't hit it.
+               // this is OK because a "kosher" ButtonRelease
+               // will follow a ButtonPress that clears
+               // the selection.
+               // Note this also fixes selection drawing
+               // problems if we end up opening an inset
+               if (bv_->getLyXText()->selection.set())
+                       return;
                // CHECK fix this proper in 0.13
+               // well, maybe 13.0 !!!!!!!!!
 
                // Following a ref shouldn't issue
                // a push on the undo-stack
@@ -810,6 +824,7 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
 
 #ifdef WITH_WARNINGS
 #warning variable c is set but never used. What is it good for?? (JMarc)
+#warning isnt this code dead ?? "open a float" ??? (jbl)
 #endif
        // check whether we want to open a float
        if (bv_->text) {
index d07fb1c5aedac955d165e9cca07ec3862b23d9eb..28bc7a25348daed9a60cf958feeaf9c9b4290db3 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-01  John Levon  <moz@compsoc.man.ac.uk>
+
+       * BufferView_pimpl.C: refuse to open an inset when
+       there's a selection.
+
 2001-11-30  Juergen Vigna  <jug@sad.it>
 
        * tabular.C (LyXTabular): add a same_id to set the same id's in the