Fixed core dump for when there is no image list on the TreeCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-06-21 20:53:15 +00:00
parent bea74fbbeb
commit d3a9f4afd9

View File

@@ -313,11 +313,13 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
if ((point.x >= m_x) && (point.x <= m_x+m_width))
{
int image_w,image_h;
int image_w = -1;
int image_h;
// assuming every image (normal and selected ) has the same size !
if (theTree->m_imageListNormal)
theTree->m_imageListNormal->GetSize(m_image, image_w, image_h);
if (point.x<=m_x+image_w+1)
if ((image_w != -1) && (point.x <= m_x + image_w + 1))
flags|=wxTREE_HITTEST_ONITEMICON;
else
flags|=wxTREE_HITTEST_ONITEMLABEL;