diff options
Diffstat (limited to 'project2/iterate.cpp')
-rw-r--r-- | project2/iterate.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/project2/iterate.cpp b/project2/iterate.cpp index b06d7e1..569bb3d 100644 --- a/project2/iterate.cpp +++ b/project2/iterate.cpp @@ -12,7 +12,7 @@ Iterate::Iterate(const xmlpp::Element * p) : localErrorHandling(p->get_attribute_value("errorHandling") == "local") { LoaderBase loader(ApplicationEngine::getCurrent()->env()->getXmlNamespace(), true); - loader.supportedStorers.insert(Storer::into(&subNOEs)); + loader.supportedStorers.insert(new NOEErrorStorer(&normNOEs, &errorNOEs)); loader.collectAll(p, true, IgnoreUnsupported); } @@ -56,21 +56,19 @@ Iterate::execute() const void Iterate::executeChildren(bool errs) const { - BOOST_FOREACH(const SubNOEs::value_type & sq, subNOEs.get<bySOOrder>()) { - if (sq->isErrorHandler == errs) { - if (dynamic_cast<const RowProcessor *>(sq.get())) { + BOOST_FOREACH(const SubNOEs::value_type & sq, (errs ? errorNOEs : normNOEs).get<bySOOrder>()) { + if (dynamic_cast<const RowProcessor *>(sq.get())) { + sq->execute(); + } + else { + RowSet::beginRow(NULL); + try { sq->execute(); + RowSet::endRow(NULL); } - else { - RowSet::beginRow(NULL); - try { - sq->execute(); - RowSet::endRow(NULL); - } - catch (...) { - RowSet::endRow(NULL); - throw; - } + catch (...) { + RowSet::endRow(NULL); + throw; } } } |