diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-20 20:11:24 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-23 15:30:28 +0900 |
commit | f7a40e1470431d8978d4ca96e7651af9b0609df3 (patch) | |
tree | 5b2c20c3dd7e1fe1004ceb2d2572c2550b3a44f0 | |
parent | 7f49a466e85b5f5866e6af28d84ed06697e49d20 (diff) |
tdf#91404 check if the item position is valid
Change-Id: I963cf83d32bb976095274be913806de19bdf7a86
-rw-r--r-- | vcl/source/window/toolbox.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 76051f8eabbc..09d5403ad63a 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2980,7 +2980,7 @@ void ToolBox::ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, sal_uInt16 nHighlight, bool bPaint, bool bLayout) { - if( nPos >= mpData->m_aItems.size() ) + if (nPos >= mpData->m_aItems.size()) return; // execute pending paint requests @@ -4055,8 +4055,11 @@ void ToolBox::Tracking( const TrackingEvent& rTEvt ) void ToolBox::InvalidateItem(sal_uInt16 nPosition) { - ImplToolItem* pItem = &mpData->m_aItems[nPosition]; - Invalidate(pItem->maRect); + if (nPosition < mpData->m_aItems.size()) + { + ImplToolItem* pItem = &mpData->m_aItems[nPosition]; + Invalidate(pItem->maRect); + } } void ToolBox::InvalidateMenuButton() |