]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
More understandable symbolic constants in generic wxDVC's DoJob class.
[wxWidgets.git] / src / generic / listctrl.cpp
index 0c877f3b0ccd3c100d538c9054000e6f317014d5..09354910b6d046f46a13eb0cc50d23b67e21fcf3 100644 (file)
@@ -4027,6 +4027,19 @@ 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)
+    {
+        // Reset the buffered height if it's not big enough for the new image.
+        if (m_small_image_list)
+        {
+            int imageWidth, imageHeight;
+            m_small_image_list->GetSize(item.GetImage(),
+                                        imageWidth, imageHeight);
+
+            if ( imageHeight > m_lineHeight )
+                m_lineHeight = 0;
+        }
+    }
 
     m_lines.Insert( line, id );
 
@@ -4853,7 +4866,9 @@ long wxGenericListCtrl::InsertItem( long index, const wxString &label, int image
     wxListItem info;
     info.m_text = label;
     info.m_image = imageIndex;
-    info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE;
+    info.m_mask = wxLIST_MASK_TEXT;
+    if (imageIndex > -1)
+        info.m_mask |= wxLIST_MASK_IMAGE;
     info.m_itemId = index;
     return InsertItem( info );
 }