[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/source

Caolán McNamara caolanm at redhat.com
Tue May 31 13:18:23 UTC 2016


 vcl/source/window/toolbox.cxx |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

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

    Resolves: tdf#92695 protect both branches against missing ToolItem
    
    (cherry picked from commit ab0dc9524a36a394e97df9499bf1f5e4b94cfdca)
    (cherry picked from commit c845c7bf597caa11b1617ab71029c499819028bc)
    
    Related: tdf#92695 we already have ImplGetItem from mnHighItemId here
    
    no logic change intended
    
    (cherry picked from commit c380f0fc125f50ad8efca2ce032d3d2a67d78f0a)
    (cherry picked from commit df668868917d1dac11d49f1f650c43666fadea54)
    
    Change-Id: Ide54fddf7b217e65a405bd80853d5302a419f046
    a53a21db56c857e1274c60f846fc955fef9e3dfb
    Reviewed-on: https://gerrit.libreoffice.org/25711
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 140a473..30755ac 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -5019,20 +5019,19 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode )
         else
         {
             mnDownItemId = mnCurItemId = mnHighItemId;
-            ImplToolItem* pItem = ImplGetItem( mnHighItemId );
-            if ( pItem->mnBits & ToolBoxItemBits::AUTOCHECK )
+            if (pToolItem && (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();


More information about the Libreoffice-commits mailing list