summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-20 20:11:24 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-20 20:13:32 +0900
commite5b0a647c4002d987e3c5c4e43ff0041c2a4d9e5 (patch)
tree2cd88a3366a35611a1e0a0c6f6825e0b7c463db6
parent7cf1206e1e0872d8525f6012d0017917a4840783 (diff)
tdf#91404 check if the item position is valid
Change-Id: I963cf83d32bb976095274be913806de19bdf7a86
-rw-r--r--vcl/source/window/toolbox.cxx9
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()