diff options
| author | randomdan <randomdan@localhost> | 2011-02-19 02:02:08 +0000 | 
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2011-02-19 02:02:08 +0000 | 
| commit | 6d6043bf5525c8b2d7d13fb1f14684651f44c862 (patch) | |
| tree | 58af16b06c1c58ef773f0d46b66516dd54a01e9c | |
| parent | Fix behaviour of stream rows with blank rows (diff) | |
| download | project2-6d6043bf5525c8b2d7d13fb1f14684651f44c862.tar.bz2 project2-6d6043bf5525c8b2d7d13fb1f14684651f44c862.tar.xz project2-6d6043bf5525c8b2d7d13fb1f14684651f44c862.zip  | |
Pass null values to presenters, it's up to them what to do with them
| -rw-r--r-- | project2/rowView.cpp | 8 | ||||
| -rw-r--r-- | project2/xmlPresenter.cpp | 8 | 
2 files changed, 8 insertions, 8 deletions
diff --git a/project2/rowView.cpp b/project2/rowView.cpp index be1800c..864580a 100644 --- a/project2/rowView.cpp +++ b/project2/rowView.cpp @@ -40,16 +40,12 @@ RowView::rowReady() const  	if (viewColumns.empty()) {  		unsigned int cols = source->columnCount();  		for (unsigned int c = 0; c < cols; c += 1) { -			if (!source->isNull(c)) { -				presenter->addField(source->getColumnName(c), source->getCurrentValue(c)); -			} +			presenter->addField(source->getColumnName(c), source->getCurrentValue(c));  		}  	}  	else {  		BOOST_FOREACH(const Columns::value_type & col, viewColumns) { -			if (!source->isNull(col.first)) { -				presenter->addField(col.first, col.second); -			} +			presenter->addField(col.first, col.second);  		}  	}  	executeChildren(); diff --git a/project2/xmlPresenter.cpp b/project2/xmlPresenter.cpp index 68368ec..a8db552 100644 --- a/project2/xmlPresenter.cpp +++ b/project2/xmlPresenter.cpp @@ -47,13 +47,17 @@ XmlPresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) cons  void  XmlPresenter::addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const  { -	nodeStack.back()->set_attribute(name, value, ns); +	if (!boost::get<Null>(&value)) { +		nodeStack.back()->set_attribute(name, value, ns); +	}  }  void  XmlPresenter::setText(const VariableType & value) const  { -	nodeStack.back()->set_child_text(value); +	if (!boost::get<Null>(&value)) { +		nodeStack.back()->set_child_text(value); +	}  }  void  | 
