summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-31 10:07:10 +0100
committerMichael Stahl <mstahl@redhat.com>2016-05-31 13:17:43 +0000
commitf2e34339c8d91aeddb3dcc458a2a959caef36aec (patch)
tree65c00020d9b2a6c3c3f41bfe2e73354be2f1cdf5
parenttdf#96516 do not increment position counter when an entry is removed (diff)
downloadcore-f2e34339c8d91aeddb3dcc458a2a959caef36aec.tar.gz
core-f2e34339c8d91aeddb3dcc458a2a959caef36aec.zip
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@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--vcl/source/window/toolbox.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 140a47317e81..30755ac78fdf 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();