Actions
Bug #3071
closed[wt-3.3.2] WTable::moveColumn alters WTableCell's column index
Start date:
05/05/2014
Due date:
% Done:
0%
Estimated time:
Description
Hi,
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.
Regards,
Stoycho
Files
Updated by Стойчо Стефанов Stoycho Stefanov over 10 years ago
Stoycho Stefanov wrote:
Hi,
I think I have a patch for this (in attractant). Could you verify whether it fixes the bug?
I think I have a patch for this (in ATTACHMENT). Could you verify whether it fixes the bug in general?
Updated by Koen Deforche over 10 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.3
Hey,
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);
Updated by Koen Deforche over 10 years ago
- Status changed from Resolved to Closed
Actions