From c0f482800af7951308adeaee5072527dd6d5fe5f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 May 2006 20:04:28 +0000 Subject: [PATCH] fix OpenWatcom warning (patch from Jaakko Salli) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/odcombo.h | 4 ++-- src/generic/odcombo.cpp | 25 ++++--------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/include/wx/odcombo.h b/include/wx/odcombo.h index a53e4d587d..ed7d5d8b70 100644 --- a/include/wx/odcombo.h +++ b/include/wx/odcombo.h @@ -208,7 +208,7 @@ public: bool Create(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, + const wxString& value, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -260,7 +260,7 @@ public: virtual int FindString(const wxString& s) const; virtual void Select(int n); virtual int GetSelection() const; - void SetSelection(int n) { Select(n); } + virtual void SetSelection(int n) { Select(n); } wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index eb126c330f..fcd94b3011 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -56,8 +56,6 @@ END_EVENT_TABLE() void wxVListBoxComboPopup::Init() -/* : wxVListBox(), - wxComboPopup(combo)*/ { m_widestWidth = 0; m_avgCharWidth = 0; @@ -132,11 +130,6 @@ void wxVListBoxComboPopup::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) co wxCoord wxVListBoxComboPopup::OnMeasureItem(size_t WXUNUSED(n)) const { - /* - int itemHeight = m_combo->OnMeasureListItem(n); - if ( itemHeight < 0 ) - itemHeight = m_itemHeight; - */ return m_itemHeight; } @@ -234,16 +227,6 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate ) { value-=10; } - /* - else if ( keycode == WXK_END ) - { - value = itemCount-1; - } - else if ( keycode == WXK_HOME ) - { - value = 0; - } - */ else return false; @@ -700,7 +683,7 @@ void wxOwnerDrawnComboBox::Clear() void wxOwnerDrawnComboBox::Delete(unsigned int n) { - wxCHECK_RET( (n >= 0) && (n < GetCount()), _T("invalid index in wxOwnerDrawnComboBox::Delete") ); + wxCHECK_RET( n < GetCount(), _T("invalid index in wxOwnerDrawnComboBox::Delete") ); if ( GetSelection() == (int) n ) SetValue(wxEmptyString); @@ -716,13 +699,13 @@ unsigned int wxOwnerDrawnComboBox::GetCount() const wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const { - wxCHECK_MSG( (n >= 0) && (n < GetCount()), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") ); + wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") ); return m_popupInterface->GetString(n); } void wxOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s) { - wxCHECK_RET( (n >= 0) && (n < GetCount()), _T("invalid index in wxOwnerDrawnComboBox::SetString") ); + wxCHECK_RET( n < GetCount(), _T("invalid index in wxOwnerDrawnComboBox::SetString") ); m_popupInterface->SetString(n,s); } @@ -768,7 +751,7 @@ int wxOwnerDrawnComboBox::DoAppend(const wxString& item) int wxOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos) { wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); + wxCHECK_MSG(pos<=GetCount(), -1, wxT("invalid index")); EnsurePopupControl(); m_popupInterface->Insert(item,pos); -- 2.45.2