]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Workaround for memory bug when using wxRegConfig and calling
[wxWidgets.git] / src / msw / listbox.cpp
index df49c91cc6fb93438145134e397dea4baedf70e0..7b7fcc8d185b8fe8c6a9e848785383f043222126 100644 (file)
@@ -513,7 +513,7 @@ wxString wxListBox::GetString(int N) const
 
     // +1 for terminating NUL
     wxString result;
-    ListBox_GetText(GetHwnd(), N, wxStringBuffer(result, len + 1));
+    ListBox_GetText(GetHwnd(), N, (wxChar*)wxStringBuffer(result, len + 1));
 
     return result;
 }
@@ -616,7 +616,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
         return;
     TEXTMETRIC lpTextMetric;
 
-    if ( !s.IsEmpty() )
+    if ( !s.empty() )
     {
         int existingExtent = (int)SendMessage(GetHwnd(), LB_GETHORIZONTALEXTENT, 0, 0L);
         HDC dc = GetWindowDC(GetHwnd());
@@ -805,8 +805,9 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
     wxListBoxItem *pItem = (wxListBoxItem *)data;
 
     wxDCTemp dc((WXHDC)pStruct->hDC);
-    wxRect rect(wxPoint(pStruct->rcItem.left, pStruct->rcItem.top),
-                wxPoint(pStruct->rcItem.right, pStruct->rcItem.bottom));
+    wxPoint pt1(pStruct->rcItem.left, pStruct->rcItem.top);
+    wxPoint pt2(pStruct->rcItem.right, pStruct->rcItem.bottom);
+    wxRect rect(pt1, pt2);
 
     return pItem->OnDrawItem(dc, rect,
                              (wxOwnerDrawn::wxODAction)pStruct->itemAction,