Enhancement - Sorting

- Replaced the hand-written combsort with std::sort.
- Added exhaustive set of unit tests to cover the single and double
  column sort orders.
This commit is contained in:
Paul Beckingham 2010-07-21 15:30:37 -07:00
parent e34f278e1d
commit da9985058b
4 changed files with 319 additions and 238 deletions

View file

@ -369,15 +369,11 @@ Grid::Cell::operator std::string () const
switch (mType)
{
case CELL_BOOL: return mBool ? "true" : "false"; // TODO i18n
case CELL_CHAR: sprintf (s, "%c", mChar);
return std::string (s);
case CELL_INT: sprintf (s, "%d", mInt);
return std::string (s);
case CELL_FLOAT: sprintf (s, "%f", mFloat);
return std::string (s);
case CELL_DOUBLE: sprintf (s, "%f", mDouble);
return std::string (s);
case CELL_STRING: return mString;
case CELL_CHAR: sprintf (s, "%c", mChar); return std::string (s);
case CELL_INT: sprintf (s, "%d", mInt); return std::string (s);
case CELL_FLOAT: sprintf (s, "%f", mFloat); return std::string (s);
case CELL_DOUBLE: sprintf (s, "%f", mDouble); return std::string (s);
case CELL_STRING: return mString;
}
return std::string ("");