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. // Note that you can not determine which gets called first.
void ColumnDepends::setStyle (const std::string& value) 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 ()); 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; 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. // Note that you can not determine which gets called first.
void ColumnEntry::setStyle (const std::string& value) void ColumnEntry::setStyle (const std::string& value)
{ {
_style = value; Column::setStyle (value);
if (_style == "age" && if (_style == "age" &&
_label == STRING_COLUMN_LABEL_ADDED) _label == STRING_COLUMN_LABEL_ADDED)

View File

@@ -50,7 +50,7 @@ ColumnRType::ColumnRType ()
// Note that you can not determine which gets called first. // Note that you can not determine which gets called first.
void ColumnRType::setStyle (const std::string& value) void ColumnRType::setStyle (const std::string& value)
{ {
_style = value; Column::setStyle (value);
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RTYPE) if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RTYPE)
_label = _label.substr (0, context.config.get ("rtype.indicator").length ()); _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. // Note that you can not determine which gets called first.
void ColumnRecur::setStyle (const std::string& value) void ColumnRecur::setStyle (const std::string& value)
{ {
_style = value; Column::setStyle (value);
if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RECUR) if (_style == "indicator" && _label == STRING_COLUMN_LABEL_RECUR)
_label = _label.substr (0, context.config.get ("recurrence.indicator").length ()); _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. // Note that you can not determine which gets called first.
void ColumnScheduled::setStyle (const std::string& value) void ColumnScheduled::setStyle (const std::string& value)
{ {
_style = value; Column::setStyle (value);
if (_style == "countdown" && _label == STRING_COLUMN_LABEL_SCHED) if (_style == "countdown" && _label == STRING_COLUMN_LABEL_SCHED)
_label = STRING_COLUMN_LABEL_COUNT; _label = STRING_COLUMN_LABEL_COUNT;

View File

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

View File

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

View File

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