]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Corrected wrong use of delete in region code.
[wxWidgets.git] / src / msw / listbox.cpp
index 6d1f05a55615149acb49198fcf6ecb19590a3a88..e6103c20255bc575c69fbaa94eae54d29b7fafa7 100644 (file)
@@ -516,12 +516,15 @@ wxListBox::DoInsertItems(const wxArrayString& items, int pos)
         int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);
 
 #if wxUSE_OWNER_DRAWN
         int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);
 
 #if wxUSE_OWNER_DRAWN
-        wxOwnerDrawn *pNewItem = CreateItem(idx);
-        pNewItem->SetName(items[i]);
-        pNewItem->SetFont(GetFont());
-        m_aItems.Insert(pNewItem, idx);
+        if ( m_windowStyle & wxLB_OWNERDRAW )
+        {
+            wxOwnerDrawn *pNewItem = CreateItem(idx);
+            pNewItem->SetName(items[i]);
+            pNewItem->SetFont(GetFont());
+            m_aItems.Insert(pNewItem, idx);
 
 
-        ListBox_SetItemData(GetHwnd(), idx, pNewItem);
+            ListBox_SetItemData(GetHwnd(), idx, pNewItem);
+        }
 #endif // wxUSE_OWNER_DRAWN
     }
 
 #endif // wxUSE_OWNER_DRAWN
     }