From d1f7240a09844a821b256809b2dbe319e85745ff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 1 Nov 2007 00:09:13 +0000 Subject: [PATCH] also assert in generic GetSelection() if the control is in multiselection mode, for consistency with wxMSW and other controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/treectlg.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 67d13c69db..f57802cf70 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -112,7 +112,13 @@ public: // ---------- virtual wxTreeItemId GetRootItem() const { return m_anchor; } - virtual wxTreeItemId GetSelection() const { return m_current; } + virtual wxTreeItemId GetSelection() const + { + wxASSERT_MSG( !HasFlag(wxTR_MULTIPLE), + wxT("must use GetSelections() with this control") ); + + return m_current; + } virtual size_t GetSelections(wxArrayTreeItemIds&) const; virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; -- 2.50.0