Code Cleanup

- 'uft8_length' and 'utf8_text_length' now return unsigned ints.
This commit is contained in:
Scott Kostyshak
2013-01-07 03:32:30 -05:00
committed by Paul Beckingham
parent 4ca5c85054
commit 3583e2ff58
4 changed files with 19 additions and 15 deletions

View File

@@ -122,15 +122,17 @@ std::string ViewText::render ()
for (unsigned int col = 0; col < _columns.size (); ++col)
{
// Headers factor in to width calculations.
int global_min = utf8_length (_columns[col]->label ());
int global_ideal = global_min;
unsigned int global_min = utf8_length (_columns[col]->label ());
unsigned int global_ideal = global_min;
for (unsigned int row = 0; row < _data.size (); ++row)
{
// Determine minimum and ideal width for this column.
int min;
int ideal;
_columns[col]->measure (_data[row][col], min, ideal);
int min_;
int ideal_;
_columns[col]->measure (_data[row][col], min_, ideal_);
unsigned int min = min_;
unsigned int ideal = ideal_;
if (min > global_min) global_min = min;
if (ideal > global_ideal) global_ideal = ideal;