]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Fix assert in generic wxListCtrl icon view when using images.
[wxWidgets.git] / src / generic / listctrl.cpp
index 9faacbc8c84514d2cfc87f3edaa229a38d072b17..5d4767f939cb1c75381d8fcd2cffaae1ffa8fa4c 100644 (file)
@@ -4027,14 +4027,14 @@ void wxListMainWindow::InsertItem( wxListItem &item )
     wxListLineData *line = new wxListLineData(this);
 
     line->SetItem( item.m_col, item );
-    if ((item.m_mask & wxLIST_MASK_IMAGE) && item.GetImage() != -1)
+    if ( item.m_mask & wxLIST_MASK_IMAGE )
     {
         // Reset the buffered height if it's not big enough for the new image.
-        if (m_small_image_list)
+        int image = item.GetImage();
+        if ( m_small_image_list && image != -1 && InReportView() )
         {
             int imageWidth, imageHeight;
-            m_small_image_list->GetSize(item.GetImage(),
-                                        imageWidth, imageHeight);
+            m_small_image_list->GetSize(image, imageWidth, imageHeight);
 
             if ( imageHeight > m_lineHeight )
                 m_lineHeight = 0;