From 8d10d81198ae8eb7105e4281f63361182301d7eb Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 16 Apr 2014 00:06:29 -0400 Subject: [PATCH] Columns - Removed ColUDA::is_uda override, because it was wrong. Now in the base class a member variable is referenced. --- src/A3t.cpp | 7 ++++++- src/columns/ColUDA.cpp | 7 +------ src/columns/ColUDA.h | 1 - src/columns/Column.cpp | 16 ++++++++++------ src/columns/Column.h | 3 ++- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/A3t.cpp b/src/A3t.cpp index c99566e53..8923b3fa5 100644 --- a/src/A3t.cpp +++ b/src/A3t.cpp @@ -552,8 +552,13 @@ void A3t::findAttribute () (*i)->attribute ("name", canonical); (*i)->attribute ("value", value); - if (context.columns[canonical]->modifiable ()) + std::map ::const_iterator col; + col = context.columns.find (canonical); + if (col != context.columns.end () && + col->second->modifiable ()) + { (*i)->tag ("MODIFIABLE"); + } } else if (canonicalize (canonical, "uda", name)) diff --git a/src/columns/ColUDA.cpp b/src/columns/ColUDA.cpp index becd41b3d..ac2dc47b6 100644 --- a/src/columns/ColUDA.cpp +++ b/src/columns/ColUDA.cpp @@ -43,6 +43,7 @@ ColumnUDA::ColumnUDA () _type = "string"; _style = "default"; _label = ""; + _uda = true; _hyphenate = (_type == "string") ? true : false; @@ -56,12 +57,6 @@ ColumnUDA::~ColumnUDA () { } -//////////////////////////////////////////////////////////////////////////////// -bool ColumnUDA::is_uda () const -{ - return true; -} - //////////////////////////////////////////////////////////////////////////////// bool ColumnUDA::validate (std::string& value) { diff --git a/src/columns/ColUDA.h b/src/columns/ColUDA.h index 4ab454553..196e0e91b 100644 --- a/src/columns/ColUDA.h +++ b/src/columns/ColUDA.h @@ -39,7 +39,6 @@ public: ColumnUDA (); ~ColumnUDA (); - bool is_uda () const; bool validate (std::string&); void measure (Task&, unsigned int&, unsigned int&); void render (std::vector &, Task&, int, Color&); diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 535bbb8e3..59330ea61 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -209,6 +209,7 @@ Column::Column () , _label ("") , _report ("") , _modifiable (true) +, _uda (false) { } @@ -221,6 +222,7 @@ Column::Column (const Column& other) _label = other._label; _label = other._report; _modifiable = other._modifiable; + _uda = other._uda; } //////////////////////////////////////////////////////////////////////////////// @@ -234,6 +236,7 @@ Column& Column::operator= (const Column& other) _label = other._label; _report = other._report; _modifiable = other._modifiable; + _uda = other._uda; } return *this; @@ -242,12 +245,13 @@ Column& Column::operator= (const Column& other) //////////////////////////////////////////////////////////////////////////////// bool Column::operator== (const Column& other) const { - return _name == other._name && - _type == other._type && - _style == other._style && - _label == other._label && - _report == other._report && - _modifiable == other._modifiable; + return _name == other._name && + _type == other._type && + _style == other._style && + _label == other._label && + _report == other._report && + _modifiable == other._modifiable && + _uda == other._uda; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/Column.h b/src/columns/Column.h index 91e77e885..d4cd95e3c 100644 --- a/src/columns/Column.h +++ b/src/columns/Column.h @@ -50,7 +50,7 @@ public: std::string label () const { return _label; } std::string type () const { return _type; } bool modifiable () const { return _modifiable; } - bool is_uda () const { return false; } + bool is_uda () const { return _uda; } std::vector styles () const { return _styles; } std::vector examples () const { return _examples; } @@ -74,6 +74,7 @@ protected: std::string _label; std::string _report; bool _modifiable; + bool _uda; std::vector _styles; std::vector _examples; };