From 151309b2e45b91ec0d9a89867a0fb4996fc42d3a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 18 Aug 2018 15:28:16 +0200 Subject: [PATCH] Improve wxDataViewModel::HasDefaultCompare() documentation Document that returning true from it means that Compare() can (and will) be called with -1 as the column index when the default sort order is being used. Closes #18190. --- interface/wx/dataview.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 6958ee7386..61aad27b36 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -153,7 +153,10 @@ public: @param item2 Second item to compare. @param column - The column holding the items to be compared. + The column holding the items to be compared. If the model class + overrides HasDefaultCompare() to return @true, this parameter will + be @c (unsigned)-1 when sorting items if no column is selected for + sorting them. @param ascending Indicates whether the sort is being performed in ascending or descending order. @@ -273,7 +276,14 @@ public: If any other order (e.g. by index or order of appearance) is required, then this should be used. + + Note that if this method is overridden to return @true, the + implementation of Compare() should be ready to accept @c (unsigned)-1 + as the value for the column index parameter. + See wxDataViewIndexListModel for a model which makes use of this. + + @see Compare() */ virtual bool HasDefaultCompare() const;