From 70f1070b6f74172b85cc9b8c5276f85a8371fb95 Mon Sep 17 00:00:00 2001 From: Janus Date: Sun, 15 Jul 2018 09:24:46 +0200 Subject: [PATCH] BColumnListView: BSizeColumn sort with big files works as expected - Use off_t to compute the difference - Fixes #14279 Change-Id: I253f16bb75501904ff59ac603a4680c66cfec33f --- src/kits/interface/ColumnTypes.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/ColumnTypes.cpp b/src/kits/interface/ColumnTypes.cpp index 8e61228e2e..c06149a3cc 100644 --- a/src/kits/interface/ColumnTypes.cpp +++ b/src/kits/interface/ColumnTypes.cpp @@ -474,7 +474,12 @@ BSizeColumn::DrawField(BField* _field, BRect rect, BView* parent) int 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; }