[Libreoffice-commits] core.git: 3 commits - vcl/inc vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Tue May 31 09:27:24 UTC 2016


 vcl/inc/unx/gtk/gtksalmenu.hxx |    2 +-
 vcl/source/window/toolbox.cxx  |   15 +++++++--------
 vcl/unx/gtk/gtksalmenu.cxx     |    6 +++---
 3 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit ab0dc9524a36a394e97df9499bf1f5e4b94cfdca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 10:11:01 2016 +0100

    Resolves: tdf#92695 protect both branches against missing ToolItem
    
    Change-Id: Ide54fddf7b217e65a405bd80853d5302a419f046

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 8a89ff2..903ea8c 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4986,7 +4986,7 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode )
         else
         {
             mnDownItemId = mnCurItemId = mnHighItemId;
-            if ( pToolItem->mnBits & ToolBoxItemBits::AUTOCHECK )
+            if (pToolItem && (pToolItem->mnBits & ToolBoxItemBits::AUTOCHECK))
             {
                 if ( pToolItem->mnBits & ToolBoxItemBits::RADIOCHECK )
                 {
commit c380f0fc125f50ad8efca2ce032d3d2a67d78f0a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 10:07:10 2016 +0100

    Related: tdf#92695 we already have ImplGetItem from mnHighItemId here
    
    no logic change intended
    
    Change-Id: Ia53a21db56c857e1274c60f846fc955fef9e3dfb

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index d725275..8a89ff2 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4986,20 +4986,19 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode )
         else
         {
             mnDownItemId = mnCurItemId = mnHighItemId;
-            ImplToolItem* pItem = ImplGetItem( mnHighItemId );
-            if ( pItem->mnBits & ToolBoxItemBits::AUTOCHECK )
+            if ( pToolItem->mnBits & ToolBoxItemBits::AUTOCHECK )
             {
-                if ( pItem->mnBits & ToolBoxItemBits::RADIOCHECK )
+                if ( pToolItem->mnBits & ToolBoxItemBits::RADIOCHECK )
                 {
-                    if ( pItem->meState != TRISTATE_TRUE )
-                        SetItemState( pItem->mnId, TRISTATE_TRUE );
+                    if ( pToolItem->meState != TRISTATE_TRUE )
+                        SetItemState( pToolItem->mnId, TRISTATE_TRUE );
                 }
                 else
                 {
-                    if ( pItem->meState != TRISTATE_TRUE )
-                        pItem->meState = TRISTATE_TRUE;
+                    if ( pToolItem->meState != TRISTATE_TRUE )
+                        pToolItem->meState = TRISTATE_TRUE;
                     else
-                        pItem->meState = TRISTATE_FALSE;
+                        pToolItem->meState = TRISTATE_FALSE;
                 }
             }
             mnMouseModifier = aKeyCode.GetModifier();
commit ba4e50c856e5279c05b90297660b396868a6d815
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 10:00:38 2016 +0100

    Related: tdf#92695 gtk3 only activate/deactive submenus, not the toplevel
    
    Change-Id: I5ce7ae39e7db62551733a005f3163ebfbb027af6

diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 1a5cd0a..31622fa 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -111,7 +111,7 @@ public:
     bool                        PrepUpdate();
     virtual void                Update() override;  // Update this menu only.
     // Update full menu hierarchy from this menu.
-    void                        UpdateFull () { ActivateAllSubmenus(mpVCLMenu); }
+    void                        UpdateFull () { ActivateAllSubmenus(mpVCLMenu); Update(); }
     GtkSalMenu*                 GetTopLevel();
     void                        SetNeedsUpdate();
 
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 03b9b70..6a8d52a 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -991,16 +991,16 @@ void GtkSalMenu::DispatchCommand(const gchar *pCommand)
 
 void GtkSalMenu::ActivateAllSubmenus(Menu* pMenuBar)
 {
-    pMenuBar->HandleMenuActivateEvent(mpVCLMenu);
     for (GtkSalMenuItem* pSalItem : maItems)
     {
         if ( pSalItem->mpSubMenu != nullptr )
         {
+            pMenuBar->HandleMenuActivateEvent(pSalItem->mpSubMenu->GetMenu());
             pSalItem->mpSubMenu->ActivateAllSubmenus(pMenuBar);
+            pSalItem->mpSubMenu->Update();
+            pMenuBar->HandleMenuDeActivateEvent(pSalItem->mpSubMenu->GetMenu());
         }
     }
-    Update();
-    pMenuBar->HandleMenuDeActivateEvent(mpVCLMenu);
 }
 
 void GtkSalMenu::Activate(const gchar* pCommand)


More information about the Libreoffice-commits mailing list