Columns: Attribute objects properly delegate to Column::setStyle to validate formats

This commit is contained in:
Paul Beckingham 2017-01-07 11:04:08 -05:00
parent e871976bb9
commit ebd6273c86
8 changed files with 8 additions and 8 deletions

View file

@ -58,7 +58,7 @@ ColumnDepends::ColumnDepends ()
// Note that you can not determine which gets called first.
void ColumnDepends::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_DEP) _label = _label.substr (0, context.config.get ("dependency.indicator").length ());
else if (_style == "count" && _label == STRING_COLUMN_LABEL_DEP) _label = STRING_COLUMN_LABEL_DEP_S;

View file

@ -41,7 +41,7 @@ ColumnEntry::ColumnEntry ()
// Note that you can not determine which gets called first.
void ColumnEntry::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "age" &&
_label == STRING_COLUMN_LABEL_ADDED)

View file

@ -50,7 +50,7 @@ ColumnRType::ColumnRType ()
// Note that you can not determine which gets called first.
void ColumnRType::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RTYPE)
_label = _label.substr (0, context.config.get ("rtype.indicator").length ());

View file

@ -57,7 +57,7 @@ ColumnRecur::ColumnRecur ()
// Note that you can not determine which gets called first.
void ColumnRecur::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RECUR)
_label = _label.substr (0, context.config.get ("recurrence.indicator").length ());

View file

@ -40,7 +40,7 @@ ColumnScheduled::ColumnScheduled ()
// Note that you can not determine which gets called first.
void ColumnScheduled::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "countdown" && _label == STRING_COLUMN_LABEL_SCHED)
_label = STRING_COLUMN_LABEL_COUNT;

View file

@ -47,7 +47,7 @@ ColumnStart::ColumnStart ()
// Note that you can not determine which gets called first.
void ColumnStart::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "active" && _label == STRING_COLUMN_LABEL_STARTED)
_label = STRING_COLUMN_LABEL_ACTIVE;

View file

@ -46,7 +46,7 @@ ColumnStatus::ColumnStatus ()
// Note that you can not determine which gets called first.
void ColumnStatus::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "short" && _label == STRING_COLUMN_LABEL_STATUS)
_label = STRING_COLUMN_LABEL_STAT;

View file

@ -59,7 +59,7 @@ ColumnTags::ColumnTags ()
// Note that you can not determine which gets called first.
void ColumnTags::setStyle (const std::string& value)
{
_style = value;
Column::setStyle (value);
if (_style == "indicator" &&
_label == STRING_COLUMN_LABEL_TAGS)