propagate the RowFormatter change to the Row collection

This commit is contained in:
Aleksandar Fabijanic
2009-10-02 18:25:40 +00:00
parent 10bdb05987
commit e1d57cf0dc
2 changed files with 13 additions and 1 deletions

View File

@@ -93,7 +93,6 @@ public:
typedef RowIterator Iterator; typedef RowIterator Iterator;
using Statement::isNull; using Statement::isNull;
using Statement::setRowFormatter;
using Statement::subTotalRowCount; using Statement::subTotalRowCount;
static const std::size_t UNKNOWN_TOTAL_ROW_COUNT; static const std::size_t UNKNOWN_TOTAL_ROW_COUNT;
@@ -113,6 +112,9 @@ public:
~RecordSet(); ~RecordSet();
/// Destroys the RecordSet. /// Destroys the RecordSet.
void setRowFormatter(RowFormatter* pRowFormatter);
/// Assigns the row formatter to the statement and all recordset rows.
Statement& operator = (const Statement& stmt); Statement& operator = (const Statement& stmt);
/// Assignment operator. /// Assignment operator.

View File

@@ -309,6 +309,16 @@ bool RecordSet::moveLast()
} }
void RecordSet::setRowFormatter(RowFormatter* pRowFormatter)
{
pRowFormatter->setTotalRowCount(getTotalRowCount());
Statement::setRowFormatter(pRowFormatter);
RowMap::iterator it = _rowMap.begin();
RowMap::iterator end = _rowMap.end();
for (; it != end; ++it) it->second->setFormatter(getRowFormatter());
}
std::ostream& RecordSet::copyValues(std::ostream& os, std::size_t offset, std::size_t length) const std::ostream& RecordSet::copyValues(std::ostream& os, std::size_t offset, std::size_t length) const
{ {
RowIterator itBegin = *_pBegin + offset; RowIterator itBegin = *_pBegin + offset;