diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 79a9facb90..92610cada4 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1246,9 +1246,13 @@ wxTreeItemId wxGenericTreeCtrl::InsertItem(const wxTreeItemId& parentId, return AddRoot(text, image, selImage, data); } - int index = parent->GetChildren().Index((wxGenericTreeItem*) idPrevious.m_pItem); - wxASSERT_MSG( index != wxNOT_FOUND, - wxT("previous item in wxGenericTreeCtrl::InsertItem() is not a sibling") ); + int index = -1; + if (idPrevious.IsOk()) + { + index = parent->GetChildren().Index((wxGenericTreeItem*) idPrevious.m_pItem); + wxASSERT_MSG( index != wxNOT_FOUND, + wxT("previous item in wxGenericTreeCtrl::InsertItem() is not a sibling") ); + } return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data); } diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 736b8a1332..5af43d6f27 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1594,7 +1594,9 @@ void wxWindowDC::Clear() void wxWindowDC::SetFont( const wxFont &font ) { - wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") ); + // It is common practice to set the font to wxNullFont, so + // don't consider it to be an error + // wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") ); m_font = font; #ifdef __WXGTK20__ diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index bfa26d0b92..a655706aa5 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -929,14 +929,14 @@ void wxTextCtrl::Redo() bool wxTextCtrl::CanUndo() const { // TODO - wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") ); + //wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") ); return FALSE; } bool wxTextCtrl::CanRedo() const { // TODO - wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") ); + //wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") ); return FALSE; } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 736b8a1332..5af43d6f27 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1594,7 +1594,9 @@ void wxWindowDC::Clear() void wxWindowDC::SetFont( const wxFont &font ) { - wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") ); + // It is common practice to set the font to wxNullFont, so + // don't consider it to be an error + // wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") ); m_font = font; #ifdef __WXGTK20__ diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index bfa26d0b92..a655706aa5 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -929,14 +929,14 @@ void wxTextCtrl::Redo() bool wxTextCtrl::CanUndo() const { // TODO - wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") ); + //wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") ); return FALSE; } bool wxTextCtrl::CanRedo() const { // TODO - wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") ); + //wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") ); return FALSE; }