From 6d6043bf5525c8b2d7d13fb1f14684651f44c862 Mon Sep 17 00:00:00 2001 From: randomdan Date: Sat, 19 Feb 2011 02:02:08 +0000 Subject: Pass null values to presenters, it's up to them what to do with them --- project2/rowView.cpp | 8 ++------ 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(&value)) { + nodeStack.back()->set_attribute(name, value, ns); + } } void XmlPresenter::setText(const VariableType & value) const { - nodeStack.back()->set_child_text(value); + if (!boost::get(&value)) { + nodeStack.back()->set_child_text(value); + } } void -- cgit v1.2.3