* Changed the sorting order back to how it was done previously to r22113.
* This fixes bug #1915. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24396 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -61,6 +61,9 @@ All rights reserved.
|
|||||||
#include "WidgetAttributeText.h"
|
#include "WidgetAttributeText.h"
|
||||||
|
|
||||||
|
|
||||||
|
const int32 kGenericReadBufferSize = 1024;
|
||||||
|
|
||||||
|
|
||||||
template <class View>
|
template <class View>
|
||||||
float
|
float
|
||||||
TruncStringBase(BString *result, const char *str, int32 length,
|
TruncStringBase(BString *result, const char *str, int32 length,
|
||||||
@@ -663,7 +666,7 @@ ScalarAttributeText::Compare(WidgetAttributeText &attr, BPoseView *)
|
|||||||
if (fValueDirty)
|
if (fValueDirty)
|
||||||
fValue = ReadValue();
|
fValue = ReadValue();
|
||||||
|
|
||||||
return fValue <= compareTo->Value() ? (fValue == compareTo->Value() ? 0 : -1) : 1 ;
|
return fValue >= compareTo->Value() ? (fValue == compareTo->Value() ? 0 : -1) : 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -695,7 +698,8 @@ PathAttributeText::ReadValue(BString *result)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
OriginalPathAttributeText::OriginalPathAttributeText(const Model *model, const BColumn *column)
|
OriginalPathAttributeText::OriginalPathAttributeText(const Model *model,
|
||||||
|
const BColumn *column)
|
||||||
: StringAttributeText(model, column)
|
: StringAttributeText(model, column)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -823,8 +827,8 @@ NameAttributeText::FitValue(BString *result, const BPoseView *view)
|
|||||||
if (fValueDirty)
|
if (fValueDirty)
|
||||||
ReadValue(&fFullValueText);
|
ReadValue(&fFullValueText);
|
||||||
fOldWidth = fColumn->Width();
|
fOldWidth = fColumn->Width();
|
||||||
fTruncatedWidth = TruncString(result, fFullValueText.String(), fFullValueText.Length(),
|
fTruncatedWidth = TruncString(result, fFullValueText.String(),
|
||||||
view, fOldWidth, B_TRUNCATE_END);
|
fFullValueText.Length(), view, fOldWidth, B_TRUNCATE_END);
|
||||||
fDirty = false;
|
fDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1115,9 +1119,9 @@ ModificationTimeAttributeText::ReadValue()
|
|||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
const int32 kGenericReadBufferSize = 1024;
|
|
||||||
|
|
||||||
GenericAttributeText::GenericAttributeText(const Model *model, const BColumn *column)
|
GenericAttributeText::GenericAttributeText(const Model *model,
|
||||||
|
const BColumn *column)
|
||||||
: WidgetAttributeText(model, column),
|
: WidgetAttributeText(model, column),
|
||||||
fValueDirty(true)
|
fValueDirty(true)
|
||||||
{
|
{
|
||||||
@@ -1445,52 +1449,52 @@ GenericAttributeText::Compare(WidgetAttributeText &attr, BPoseView *)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case B_FLOAT_TYPE:
|
case B_FLOAT_TYPE:
|
||||||
return fValue.floatt <= compareTo->fValue.floatt ?
|
return fValue.floatt >= compareTo->fValue.floatt ?
|
||||||
(fValue.floatt == compareTo->fValue.floatt ? 0 : -1) : 1;
|
(fValue.floatt == compareTo->fValue.floatt ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_DOUBLE_TYPE:
|
case B_DOUBLE_TYPE:
|
||||||
return fValue.doublet <= compareTo->fValue.doublet ?
|
return fValue.doublet >= compareTo->fValue.doublet ?
|
||||||
(fValue.doublet == compareTo->fValue.doublet ? 0 : -1) : 1;
|
(fValue.doublet == compareTo->fValue.doublet ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_BOOL_TYPE:
|
case B_BOOL_TYPE:
|
||||||
return fValue.boolt <= compareTo->fValue.boolt ?
|
return fValue.boolt >= compareTo->fValue.boolt ?
|
||||||
(fValue.boolt == compareTo->fValue.boolt ? 0 : -1) : 1;
|
(fValue.boolt == compareTo->fValue.boolt ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_UINT8_TYPE:
|
case B_UINT8_TYPE:
|
||||||
return fValue.uint8t <= compareTo->fValue.uint8t ?
|
return fValue.uint8t >= compareTo->fValue.uint8t ?
|
||||||
(fValue.uint8t == compareTo->fValue.uint8t ? 0 : -1) : 1;
|
(fValue.uint8t == compareTo->fValue.uint8t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_INT8_TYPE:
|
case B_INT8_TYPE:
|
||||||
return fValue.int8t <= compareTo->fValue.int8t ?
|
return fValue.int8t >= compareTo->fValue.int8t ?
|
||||||
(fValue.int8t == compareTo->fValue.int8t ? 0 : -1) : 1;
|
(fValue.int8t == compareTo->fValue.int8t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_UINT16_TYPE:
|
case B_UINT16_TYPE:
|
||||||
return fValue.uint16t <= compareTo->fValue.uint16t ?
|
return fValue.uint16t >= compareTo->fValue.uint16t ?
|
||||||
(fValue.uint16t == compareTo->fValue.uint16t ? 0 : -1) : 1;
|
(fValue.uint16t == compareTo->fValue.uint16t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_INT16_TYPE:
|
case B_INT16_TYPE:
|
||||||
return fValue.int16t <= compareTo->fValue.int16t ?
|
return fValue.int16t >= compareTo->fValue.int16t ?
|
||||||
(fValue.int16t == compareTo->fValue.int16t ? 0 : -1) : 1;
|
(fValue.int16t == compareTo->fValue.int16t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_UINT32_TYPE:
|
case B_UINT32_TYPE:
|
||||||
return fValue.uint32t <= compareTo->fValue.uint32t ?
|
return fValue.uint32t >= compareTo->fValue.uint32t ?
|
||||||
(fValue.uint32t == compareTo->fValue.uint32t ? 0 : -1) : 1;
|
(fValue.uint32t == compareTo->fValue.uint32t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_TIME_TYPE:
|
case B_TIME_TYPE:
|
||||||
// time_t typedef'd to a long, i.e. a int32
|
// time_t typedef'd to a long, i.e. a int32
|
||||||
case B_INT32_TYPE:
|
case B_INT32_TYPE:
|
||||||
return fValue.int32t <= compareTo->fValue.int32t ?
|
return fValue.int32t >= compareTo->fValue.int32t ?
|
||||||
(fValue.int32t == compareTo->fValue.int32t ? 0 : -1) : 1;
|
(fValue.int32t == compareTo->fValue.int32t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_OFF_T_TYPE:
|
case B_OFF_T_TYPE:
|
||||||
// off_t typedef'd to a long long, i.e. a int64
|
// off_t typedef'd to a long long, i.e. a int64
|
||||||
case B_INT64_TYPE:
|
case B_INT64_TYPE:
|
||||||
return fValue.int64t <= compareTo->fValue.int64t ?
|
return fValue.int64t >= compareTo->fValue.int64t ?
|
||||||
(fValue.int64t == compareTo->fValue.int64t ? 0 : -1) : 1;
|
(fValue.int64t == compareTo->fValue.int64t ? 0 : -1) : 1;
|
||||||
|
|
||||||
case B_UINT64_TYPE:
|
case B_UINT64_TYPE:
|
||||||
default:
|
default:
|
||||||
return fValue.uint64t <= compareTo->fValue.uint64t ?
|
return fValue.uint64t >= compareTo->fValue.uint64t ?
|
||||||
(fValue.uint64t == compareTo->fValue.uint64t ? 0 : -1) : 1;
|
(fValue.uint64t == compareTo->fValue.uint64t ? 0 : -1) : 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user