Columns: Removed redundant format checking

This commit is contained in:
Paul Beckingham 2017-01-07 11:10:03 -05:00
parent ebd6273c86
commit 09562c8fac
17 changed files with 0 additions and 57 deletions

View file

@ -102,8 +102,6 @@ void ColumnDepends::measure (Task& task, unsigned int& minimum, unsigned int& ma
minimum = length;
}
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -153,9 +153,6 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int
minimum = 4;
maximum = utf8_width (description) + 1 + 1 + format (task.annotation_count).length () + 1;
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -55,10 +55,6 @@ void ColumnID::measure (Task& task, unsigned int& minimum, unsigned int& maximum
else length = 1 + (int) log10 ((double) task.id); // Slow
minimum = maximum = length;
if (_style != "default" &&
_style != "number")
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -46,13 +46,7 @@ void ColumnIMask::measure (Task& task, unsigned int& minimum, unsigned int& maxi
{
minimum = maximum = 0;
if (task.has (_name))
{
minimum = maximum = task.get (_name).length ();
if (_style != "default" &&
_style != "number")
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -46,13 +46,7 @@ void ColumnLast::measure (Task& task, unsigned int& minimum, unsigned int& maxim
{
minimum = maximum = 0;
if (task.has (_name))
{
minimum = maximum = task.get (_name).length ();
if (_style != "default" &&
_style != "number")
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -46,12 +46,7 @@ void ColumnMask::measure (Task& task, unsigned int& minimum, unsigned int& maxim
{
minimum = maximum = 0;
if (task.has (_name))
{
minimum = maximum = task.get (_name).length ();
if (_style != "default")
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -49,8 +49,6 @@ void ColumnParent::measure (Task& task, unsigned int& minimum, unsigned int& max
{
if (_style == "default" || _style == "long") minimum = maximum = 36;
else if (_style == "short") minimum = maximum = 8;
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -73,10 +73,6 @@ void ColumnProject::measure (Task& task, unsigned int& minimum, unsigned int& ma
{
project = indentProject (project, " ", '.');
}
else if (_style != "default" &&
_style != "full" &&
_style != "indented")
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
minimum = longestWord (project);
maximum = utf8_width (project);

View file

@ -67,8 +67,6 @@ void ColumnRType::measure (Task& task, unsigned int& minimum, unsigned int& maxi
minimum = maximum = task.get (_name).length ();
else if (_style == "indicator")
minimum = maximum = 1;
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -79,8 +79,6 @@ void ColumnRecur::measure (Task& task, unsigned int& minimum, unsigned int& maxi
{
minimum = maximum = utf8_width (context.config.get ("recurrence.indicator"));
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -74,8 +74,6 @@ void ColumnStatus::measure (Task& task, unsigned int& minimum, unsigned int& max
}
else if (_style == "short")
minimum = maximum = 1;
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -108,8 +108,6 @@ void ColumnTags::measure (Task& task, unsigned int& minimum, unsigned int& maxim
else
minimum = maximum = utf8_width (tags);
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -49,8 +49,6 @@ void ColumnTemplate::measure (Task& task, unsigned int& minimum, unsigned int& m
{
if (_style == "default" || _style == "long") minimum = maximum = 36;
else if (_style == "short") minimum = maximum = 8;
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -130,8 +130,6 @@ void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& m
if (date > now)
minimum = maximum = Duration (date - now).formatVague ().length ();
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -91,8 +91,6 @@ void ColumnUDAString::measure (Task& task, unsigned int& minimum, unsigned int&
minimum = maximum = utf8_width (indicator);
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
@ -174,8 +172,6 @@ void ColumnUDANumeric::measure (Task& task, unsigned int& minimum, unsigned int&
minimum = maximum = utf8_width (indicator);
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
@ -266,8 +262,6 @@ void ColumnUDADate::measure (Task& task, unsigned int& minimum, unsigned int& ma
minimum = maximum = utf8_width (indicator);
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}
@ -363,8 +357,6 @@ void ColumnUDADuration::measure (Task& task, unsigned int& minimum, unsigned int
else
minimum = maximum = 0;
}
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
}

View file

@ -48,8 +48,6 @@ void ColumnUUID::measure (Task&, unsigned int& minimum, unsigned int& maximum)
if (_style == "default" || _style == "long") minimum = maximum = 36;
else if (_style == "short") minimum = maximum = 8;
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -49,9 +49,6 @@ void ColumnUrgency::measure (Task& task, unsigned int& minimum, unsigned int& ma
else if (_style == "integer")
minimum = maximum = format ((int)task.urgency ()).length ();
else
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
}
////////////////////////////////////////////////////////////////////////////////