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
This commit is contained in:
Rene Gollent 2009-01-11 01:40:05 +00:00
parent f861e599f5
commit 6d344473e6
1 changed files with 1 additions and 1 deletions

View File

@ -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()) {