fixed GH #1236: Remove Poco::Data::Row::checkEmpty() as it prevents Row from being used with all NULL rows

This commit is contained in:
Guenter Obiltschnig
2016-04-11 10:38:33 +02:00
parent d82b6b3975
commit ed23f24639
3 changed files with 0 additions and 36 deletions

View File

@@ -109,28 +109,10 @@ std::size_t Row::getPosition(const std::string& name)
}
void Row::checkEmpty(std::size_t pos, const Poco::Dynamic::Var& val)
{
bool empty = true;
SortMap::const_iterator it = _pSortMap->begin();
SortMap::const_iterator end = _pSortMap->end();
for (std::size_t cnt = 0; it != end; ++it, ++cnt)
{
if (cnt != pos)
empty = empty && _values[it->get<0>()].isEmpty();
}
if (empty && val.isEmpty())
throw IllegalStateException("All values are empty.");
}
void Row::addSortField(std::size_t pos)
{
poco_assert (pos <= _values.size());
checkEmpty(std::numeric_limits<std::size_t>::max(), _values[pos]);
SortMap::iterator it = _pSortMap->begin();
SortMap::iterator end = _pSortMap->end();
for (; it != end; ++it)
@@ -177,8 +159,6 @@ void Row::addSortField(const std::string& name)
void Row::removeSortField(std::size_t pos)
{
checkEmpty(pos, Poco::Dynamic::Var());
SortMap::iterator it = _pSortMap->begin();
SortMap::iterator end = _pSortMap->end();
for (; it != end; ++it)