[PATCH libreoffice-4-0] Fix template manager item selection behaviour with mouse.

Bosdonnat Cedric (via Code Review) gerrit at gerrit.libreoffice.org
Wed Mar 27 05:12:26 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3090

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/90/3090/1

Fix template manager item selection behaviour with mouse.

Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
(cherry picked from commit 28d5ced7f9982257d263ffc3e550bd479a9542f8)
---
M sfx2/source/control/thumbnailview.cxx
1 file changed, 14 insertions(+), 9 deletions(-)



diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b3b1251..8b2840d 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -609,15 +609,22 @@
         {
             if ( rMEvt.GetClicks() == 1 )
             {
-                if (pItem->isSelected() && rMEvt.IsMod1())
-                    pItem->setSelection(false);
+                if (rMEvt.IsMod1())
+                {
+                    //Keep selected item group state and just invert current desired one state
+                    pItem->setSelection(!pItem->isSelected());
+                }
                 else
                 {
-                    if (!pItem->isSelected() && !rMEvt.IsMod1())
-                        deselectItems( );
-
+                    //If we got a group of selected items deselect the rest and only keep the desired one
+                    //mark items as not selected to not fire unnecessary change state events.
+                    pItem->setSelection(false);
+                    deselectItems();
                     pItem->setSelection(true);
+                }
 
+                if (pItem->isSelected())
+                {
                     bool bClickOnTitle = pItem->getTextArea().IsInside(rMEvt.GetPosPixel());
                     pItem->setEditTitle(bClickOnTitle);
                 }
@@ -626,13 +633,11 @@
                     DrawItem(pItem);
 
                 maItemStateHdl.Call(pItem);
+
+                //fire accessible event??
             }
             else if ( rMEvt.GetClicks() == 2 )
             {
-                // The mouse button down event 1 click right before is pointless
-                pItem->setSelection(false);
-                maItemStateHdl.Call(pItem);
-
                 Rectangle aRect(pItem->getDrawArea());
 
                 if (aRect.IsInside(rMEvt.GetPosPixel()))

-- 
To view, visit https://gerrit.libreoffice.org/3090
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf63454973b4044443eea1cc583fce3a78c5594d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
Gerrit-Reviewer: Rafael Dominguez <venccsralph at gmail.com>



More information about the LibreOffice mailing list