don't use invalid image list index (closes #10472)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@60479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2951,9 +2951,13 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
|
|||||||
|
|
||||||
if ( m_imageListNormal )
|
if ( m_imageListNormal )
|
||||||
{
|
{
|
||||||
int image_w, image_h;
|
int image = ((wxGenericTreeItem*) item.m_pItem)->GetCurrentImage();
|
||||||
m_imageListNormal->GetSize( 0, image_w, image_h );
|
if ( image != NO_IMAGE )
|
||||||
rect.width += image_w + MARGIN_BETWEEN_IMAGE_AND_TEXT;
|
{
|
||||||
|
int image_w, image_h;
|
||||||
|
m_imageListNormal->GetSize( image, image_w, image_h );
|
||||||
|
rect.width += image_w + MARGIN_BETWEEN_IMAGE_AND_TEXT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // the entire line
|
else // the entire line
|
||||||
|
Reference in New Issue
Block a user