- Integrated new longestWord helper function.
This commit is contained in:
Paul Beckingham
2011-05-05 19:55:00 -04:00
parent 1d0ad3838b
commit 9268e552d8
2 changed files with 6 additions and 31 deletions

View File

@@ -60,17 +60,8 @@ void ColumnProject::measure (Task& task, int& minimum, int& maximum)
else if (_style != "default")
throw std::string ("Unrecognized column format '") + _type + "." + _style + "'";
minimum = 0;
minimum = longestWord (project);
maximum = project.length ();
Nibbler nibbler (project);
std::string word;
while (nibbler.getUntilWS (word))
{
nibbler.skipWS ();
if (word.length () > minimum)
minimum = word.length ();
}
}
////////////////////////////////////////////////////////////////////////////////