[wt-3.3.2] WTable::moveColumn alters WTableCell's column index
I think I have a patch for this (in attractant). Could you verify whether it fixes the bug?
I could provide an test case if necessary.
Updated by Koen Deforche over 8 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.3
You are right that there was something missing here. I believe the following patch is the more general solution:
diff --git a/src/Wt/WTable.C b/src/Wt/WTable.C index fd0a72d..af44518 100644 --- a/src/Wt/WTable.C +++ b/src/Wt/WTable.C @@ -451,6 +451,9 @@ void WTable::moveColumn(int from, int to) WTableRow::TableData cell = cells[from]; cells.erase(cells.begin() + from); cells.insert(cells.begin() + to, cell); + + for (unsigned j = std::min(from, to); j < cells.size(); ++j) + cells[j].cell->column_ = j; } flags_.set(BIT_GRID_CHANGED);