BColumnListView: BSizeColumn sort with big files works as expected
- Use off_t to compute the difference - Fixes #14279 Change-Id: I253f16bb75501904ff59ac603a4680c66cfec33f
This commit is contained in:
parent
27dcc63210
commit
70f1070b6f
@ -474,7 +474,12 @@ BSizeColumn::DrawField(BField* _field, BRect rect, BView* parent)
|
|||||||
int
|
int
|
||||||
BSizeColumn::CompareFields(BField* field1, BField* field2)
|
BSizeColumn::CompareFields(BField* field1, BField* field2)
|
||||||
{
|
{
|
||||||
return ((BSizeField*)field1)->Size() - ((BSizeField*)field2)->Size();
|
off_t diff = ((BSizeField*)field1)->Size() - ((BSizeField*)field2)->Size();
|
||||||
|
if (diff > 0)
|
||||||
|
return 1;
|
||||||
|
if (diff < 0)
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user