From 6d344473e6d28536ac64c2f080cd37e5dbab8954 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 11 Jan 2009 01:40:05 +0000 Subject: [PATCH] Fixed broken ternary logic in GenericAttributeText::Compare() that would result in the wrong value being returned when one or both attributes being compared were undefined. A symptom of this was the crash reported in ticket #2760. Leaving that ticket open for now though as returning the wrong value to the sort shouldn't have caused a crash regardless. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28871 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/WidgetAttributeText.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/tracker/WidgetAttributeText.cpp b/src/kits/tracker/WidgetAttributeText.cpp index 74c2b90aa8..bfa6993d72 100644 --- a/src/kits/tracker/WidgetAttributeText.cpp +++ b/src/kits/tracker/WidgetAttributeText.cpp @@ -1469,7 +1469,7 @@ GenericAttributeText::Compare(WidgetAttributeText &attr, BPoseView *) // Sort undefined values last, regardless of the other value: if (fValueIsDefined == false || compareTo->fValueIsDefined == false) { return fValueIsDefined < compareTo->fValueIsDefined ? - (fValueIsDefined == compareTo->fValueIsDefined ? 0 : -1) : 1; + 1 : (fValueIsDefined == compareTo->fValueIsDefined ? 0 : -1); } switch (fColumn->AttrType()) {