From 4dd31ff527b70ef0228f773475a0a58b6072456a Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 24 Jul 2006 14:07:50 +0000 Subject: [PATCH] Warning fix. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/odcombo.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index b6c8c7e843..4d39e83afa 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -242,7 +242,7 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode } else if (unicode>0) { - keychar = unicode; + keychar = unicode; } if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) @@ -279,12 +279,12 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode // now search through the values to see if this is found int found = -1; - unsigned int length=m_partialCompletionString.Length(); + unsigned int length=m_partialCompletionString.length(); int i; for (i=0; i=length) && (! m_partialCompletionString.CmpNoCase(item.Left(length)))) + if (( item.length() >= length) && (! m_partialCompletionString.CmpNoCase(item.Left(length)))) { found=i; break; @@ -1044,10 +1044,12 @@ void wxOwnerDrawnComboBox::OnDrawBackground(wxDC& dc, const wxRect& rect, int it if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) || (flags & wxODCB_PAINTING_CONTROL) ) { - DrawFocusBackground(dc, - rect, - (flags&wxODCB_PAINTING_CONTROL?0:wxCONTROL_ISSUBMENU) | - wxCONTROL_SELECTED); + int focusFlag = wxCONTROL_SELECTED; + + if ( flags & wxODCB_PAINTING_CONTROL != wxODCB_PAINTING_CONTROL ) + focusFlag |= wxCONTROL_ISSUBMENU; + + DrawFocusBackground(dc, rect, focusFlag ); } //else: do nothing for the normal items } -- 2.45.2