- Fixed bug #1063, so that numeric UDA fields are now sortable (thanks to Max
  Muller).
This commit is contained in:
Paul Beckingham
2013-01-19 15:45:58 -05:00
parent 7e3ee1b284
commit e180dce1bc
3 changed files with 82 additions and 2 deletions

View File

@@ -30,6 +30,7 @@
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <Context.h>
#include <Duration.h>
#include <Task.h>
@@ -231,8 +232,8 @@ static bool sort_compare (int left, int right)
std::string type = column->type ();
if (type == "numeric")
{
left_real = (*global_data)[left].urgency ();
right_real = (*global_data)[right].urgency ();
const float left_real = strtof (((*global_data)[left].get_ref (field)).c_str (), NULL);
const float right_real = strtof (((*global_data)[right].get_ref (field)).c_str (), NULL);
if (left_real == right_real)
continue;