X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60d6c7fd37c9fbe3b3ebd1f440a1473abc3f8568..2a263bbbd7111248564e1c45ef6a28600b77acaf:/src/generic/treelist.cpp diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index a82a2a9237..18cb193d18 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -758,7 +758,12 @@ const wxString& wxTreeListModel::GetItemText(Node* item, unsigned col) const // empty string we can return reference to. wxCHECK_MSG( item, m_root->m_text, "Invalid item" ); - return col == 0 ? item->m_text : item->GetColumnText(col); + // Notice that asking for the text of a column of an item that doesn't have + // any column texts is not an error so we simply return an empty string in + // this case. + return col == 0 ? item->m_text + : item->HasColumnsTexts() ? item->GetColumnText(col) + : m_root->m_text; } void wxTreeListModel::SetItemText(Node* item, unsigned col, const wxString& text) @@ -1654,7 +1659,7 @@ wxWindow* wxTreeListCtrl::GetView() const // wxTreeListEvent implementation // ============================================================================ -wxIMPLEMENT_ABSTRACT_CLASS(wxTreeListEvent, wxNotifyEvent) +wxIMPLEMENT_DYNAMIC_CLASS(wxTreeListEvent, wxNotifyEvent) #define wxDEFINE_TREELIST_EVENT(name) \ wxDEFINE_EVENT(wxEVT_COMMAND_TREELIST_##name, wxTreeListEvent)