mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 12:18:01 +01:00
fixed sorted row idx
This commit is contained in:
@@ -186,12 +186,14 @@ protected:
|
|||||||
pTable->setValue(std::string("three"), 2,0);
|
pTable->setValue(std::string("three"), 2,0);
|
||||||
pTable->setValue(std::string("four"), 3,0);
|
pTable->setValue(std::string("four"), 3,0);
|
||||||
pTable->setValue(std::string("five"), 4,0);
|
pTable->setValue(std::string("five"), 4,0);
|
||||||
|
pTable->setValue(std::string("12' 23''"), 5,0);
|
||||||
|
|
||||||
pTable->setValue(true, 0,1);
|
pTable->setValue(true, 0,1);
|
||||||
pTable->setValue(false, 1,1);
|
pTable->setValue(false, 1,1);
|
||||||
pTable->setValue(true, 2,1);
|
pTable->setValue(true, 2,1);
|
||||||
pTable->setValue(false, 3,1);
|
pTable->setValue(false, 3,1);
|
||||||
pTable->setValue(true, 4,1);
|
pTable->setValue(true, 4,1);
|
||||||
|
pTable->setValue(true, 5,1);
|
||||||
pTable->setWidth(310);
|
pTable->setWidth(310);
|
||||||
pTable->setHeight(200);
|
pTable->setHeight(200);
|
||||||
pTable->setPaging(2);
|
pTable->setPaging(2);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void ArrayTableSerializer::serialize(std::ostream& ostr, const Table* pTable, st
|
|||||||
if (sortCol >= 0)
|
if (sortCol >= 0)
|
||||||
pSorted = pTable->getSortedModel(static_cast<std::size_t>(sortCol), sortAscending);
|
pSorted = pTable->getSortedModel(static_cast<std::size_t>(sortCol), sortAscending);
|
||||||
|
|
||||||
const TableModel& tm = ((sortCol >= 0)?*pSorted:pTable->getModel());
|
const TableModel& tm = (pSorted?*pSorted:pTable->getModel());
|
||||||
const Table::TableColumns& tc = pTable->getColumns();
|
const Table::TableColumns& tc = pTable->getColumns();
|
||||||
if (rowCntUser == 0 && pTable->getPagingSize() > 0)
|
if (rowCntUser == 0 && pTable->getPagingSize() > 0)
|
||||||
rowCntUser = pTable->getPagingSize();
|
rowCntUser = pTable->getPagingSize();
|
||||||
@@ -111,6 +111,10 @@ void ArrayTableSerializer::serialize(std::ostream& ostr, const Table* pTable, st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// the last column contains the rowIndx
|
// the last column contains the rowIndx
|
||||||
|
// with a sorted tablemodel we want the original row value
|
||||||
|
if (pSorted)
|
||||||
|
ostr << "," << pSorted->mapping(row);
|
||||||
|
else
|
||||||
ostr << "," << row;
|
ostr << "," << row;
|
||||||
ostr << "]";
|
ostr << "]";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,12 +86,11 @@ public:
|
|||||||
|
|
||||||
std::size_t getSortedColumn() const;
|
std::size_t getSortedColumn() const;
|
||||||
|
|
||||||
|
std::size_t mapping(std::size_t) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~SortedTableModel();
|
virtual ~SortedTableModel();
|
||||||
/// Destroys the SortedTableModel.
|
/// Destroys the SortedTableModel.
|
||||||
|
|
||||||
std::size_t mapping(std::size_t) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TableModel& _unsorted;
|
TableModel& _unsorted;
|
||||||
const Table* _pTable;
|
const Table* _pTable;
|
||||||
|
|||||||
Reference in New Issue
Block a user