From 342388a456b22cc7c1a25ef68017b66f178ba3c9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Feb 2018 20:19:14 +0100 Subject: [PATCH] Use wxCHECK_MSG() instead of wxLogError in wxDataViewTreeStore This is a check for a programming error and should never be shown to the user, so assert that the items being compared in wxDataViewTreeStore are under the same parent instead of using wxLogError. --- src/common/datavcmn.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 117dec03e3..c8d82f4131 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -2770,16 +2770,11 @@ int wxDataViewTreeStore::Compare( const wxDataViewItem &item1, const wxDataViewI if (!node1 || !node2) return 0; - wxDataViewTreeStoreContainerNode* parent1 = + wxDataViewTreeStoreContainerNode* const parent = (wxDataViewTreeStoreContainerNode*) node1->GetParent(); - wxDataViewTreeStoreContainerNode* parent2 = - (wxDataViewTreeStoreContainerNode*) node2->GetParent(); - if (parent1 != parent2) - { - wxLogError( wxT("Comparing items with different parent.") ); - return 0; - } + wxCHECK_MSG( node2->GetParent() == parent, 0 + wxS("Comparing items with different parent.") ); if (node1->IsContainer() && !node2->IsContainer()) return -1;