]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid flags that may clash with alignment flags
authorJulian Smart <julian@anthemion.co.uk>
Tue, 23 May 2006 20:33:17 +0000 (20:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 23 May 2006 20:33:17 +0000 (20:33 +0000)
Don't try to set the string selection if not found

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/univ/button.cpp
src/univ/combobox.cpp

index f41f45b6e6d7648149bbcce0e479927cbe7cd56f..995a3becaafc756434046b75cfed3584b6a4846f 100644 (file)
@@ -78,9 +78,7 @@ bool wxButton::Create(wxWindow *parent,
         label = wxGetStockLabel(id);
 
     long ctrl_style = style & ~wxBU_ALIGN_MASK;
-
-    wxASSERT_MSG( (ctrl_style & wxALIGN_MASK) == 0,
-                  _T("Some style conflicts with align flags") );
+    ctrl_style = ctrl_style & ~wxALIGN_MASK;
 
     if((style & wxBU_RIGHT) == wxBU_RIGHT)
         ctrl_style |= wxALIGN_RIGHT;
index b9b03b00c30de251da08b03efa7a242c92b9049a..8647a82611455383deeb4e03b30ac034924e0ab1 100644 (file)
@@ -130,7 +130,7 @@ wxString wxComboListBox::GetStringValue() const
 
 void wxComboListBox::SetStringValue(const wxString& value)
 {
-    if ( !value.empty() )
+    if ( !value.empty() && (FindString(value) != wxNOT_FOUND) )
         wxListBox::SetStringSelection(value);
     else
         wxListBox::SetSelection(-1);