diff --git a/ChangeLog b/ChangeLog index b908f8965..d71aec6c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,7 +30,7 @@ - TW-1430 Slashes in project names don't work (thanks to Richard Boß). - TW-1432 start/stop can be issued on completed tasks (thanks to Renato Alves). - TW-1440 "task import" from STDIN (thanks to Renato Alves). -- TW-1448 Add possibility to modify newest task (thansk to Jens Erat). +- TW-1448 Add possibility to modify newest task (thanks to Jens Erat). - TW-1452 The uuid: filter does not work (thanks to Tomas Babej). - TW-1454 Redundant dependency should not stop modification (thanks to Tomas Babej). @@ -143,6 +143,7 @@ - TW-1671 task add: segfault with foo-bar:1 (thanks to Daniel Shahaf). - TW-1675 project.not:something doesn't exclude project:something.subprojects (thanks to Ander). +- TW-1678 segfault in ~ViewTask() (thanks to Daniel Shahaf). - TW-1684 make no-date > has-date for all date attributes (thanks to David Patrick). - TW-1687 task add due:som appears to be interpreted as 'someday' (thanks to diff --git a/src/columns/ColDue.cpp b/src/columns/ColDue.cpp index d719a3025..c5a4207b4 100644 --- a/src/columns/ColDue.cpp +++ b/src/columns/ColDue.cpp @@ -52,7 +52,7 @@ ColumnDue::~ColumnDue () // Note that you can not determine which gets called first. void ColumnDue::setStyle (const std::string& value) { - _style = value; + Column::setStyle (value); if (_style == "countdown" && _label == STRING_COLUMN_LABEL_DUE) _label = STRING_COLUMN_LABEL_COUNT; diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 393a0ce7c..577164279 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -247,6 +247,16 @@ void Column::renderHeader ( } } +//////////////////////////////////////////////////////////////////////////////// +void Column::setStyle (const std::string& style) +{ + if (style != "default" && + std::find (_styles.begin (), _styles.end (), style) == _styles.end ()) + throw format (STRING_COLUMN_BAD_FORMAT, _name, style); + + _style = style; +} + //////////////////////////////////////////////////////////////////////////////// bool Column::validate (std::string& input) { diff --git a/src/columns/Column.h b/src/columns/Column.h index 12c1e0c18..14dda203e 100644 --- a/src/columns/Column.h +++ b/src/columns/Column.h @@ -53,7 +53,7 @@ public: std::vector styles () const { return _styles; } std::vector examples () const { return _examples; } - virtual void setStyle (const std::string& value) { _style = value; } + virtual void setStyle (const std::string&); virtual void setLabel (const std::string& value) { _label = value; } virtual void setReport (const std::string& value) { _report = value; }