]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/pickerbase.cpp
fix memory leak in wxScreenDC, fixes #13249
[wxWidgets.git] / src / common / pickerbase.cpp
index 81583028ac5592110f1163592ef9b367c8068d24..ce17ad7da88493e00b2b2e359092f94b67421030 100644 (file)
@@ -126,10 +126,10 @@ void wxPickerBase::PostCreation()
     // For aesthetic reasons, make sure the picker is at least as high as the
     // associated text control and is always at least square.
     const wxSize pickerBestSize(m_picker->GetBestSize());
     // For aesthetic reasons, make sure the picker is at least as high as the
     // associated text control and is always at least square.
     const wxSize pickerBestSize(m_picker->GetBestSize());
-    const wxSize textBestSize(m_text->GetBestSize());
+    const wxSize textBestSize( HasTextCtrl() ? m_text->GetBestSize() : wxSize());
     wxSize pickerMinSize;
     pickerMinSize.y = wxMax(pickerBestSize.y, textBestSize.y);
     wxSize pickerMinSize;
     pickerMinSize.y = wxMax(pickerBestSize.y, textBestSize.y);
-    pickerMinSize.x = wxMax(pickerMinSize.x, pickerMinSize.y);
+    pickerMinSize.x = wxMax(pickerBestSize.x, pickerMinSize.y);
     if ( pickerMinSize != pickerBestSize )
         m_picker->SetMinSize(pickerMinSize);
 
     if ( pickerMinSize != pickerBestSize )
         m_picker->SetMinSize(pickerMinSize);