X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39e39d3944af7a7dd5958a25391b0e914a05e93c..1411f7eb1a86d2ec4c89340262be0405b77091d0:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b7143eaa85..4e3588f7e3 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1668,11 +1668,13 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes(); SetOwnForegroundColour( attr.colFg ); SetOwnBackgroundColour( attr.colBg ); - SetOwnFont( attr.font ); + if (!m_hasFont) + SetOwnFont( attr.font ); #else SetOwnForegroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); SetOwnBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT )); + if (!m_hasFont) + SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT )); #endif } @@ -2214,7 +2216,8 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent, wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes(); SetOwnForegroundColour( attr.colFg ); SetOwnBackgroundColour( attr.colBg ); - SetOwnFont( attr.font ); + if (!m_hasFont) + SetOwnFont( attr.font ); } wxListMainWindow::~wxListMainWindow() @@ -4318,9 +4321,11 @@ void wxListMainWindow::InsertItem( wxListItem &item ) wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual control") ); size_t count = GetItemCount(); - wxCHECK_RET( item.m_itemId >= 0 && (size_t)item.m_itemId <= count, - _T("invalid item index") ); + wxCHECK_RET( item.m_itemId >= 0, _T("invalid item index") ); + if (item.m_itemId > count) + item.m_itemId = count; + size_t id = item.m_itemId; m_dirty = true;