]> git.lyx.org Git - lyx.git/commitdiff
* insetcollapsable.C (doDispatch): [LFUN_MOUSE_PRESS] reset selection
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Jan 2007 13:53:16 +0000 (13:53 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Jan 2007 13:53:16 +0000 (13:53 +0000)
when mouse is pressed on the inset button (bug 3060).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16501 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetcollapsable.C

index 98788b49e1b75822afc45d1f96e70473e4986303..75b9c195a1de21e9d9e0daef409eea032026bcc3 100644 (file)
@@ -321,8 +321,12 @@ void InsetCollapsable::doDispatch(LCursor & cur, FuncRequest & cmd)
        switch (cmd.action) {
        case LFUN_MOUSE_PRESS:
                if (cmd.button() == mouse_button::button1 && hitButton(cmd)) {
+                       // reset selection if necessary (see bug 3060)
+                       if (cur.selection())
+                               cur.bv().cursor().clearSelection();
+                       else
+                               cur.noUpdate();
                        cur.dispatched();
-                       cur.noUpdate();
                        break;
                }
                if (status() == Inlined)