Home » U++ Library support » U++ Library : Other (not classified elsewhere) » bug in gridcrtl
bug in gridcrtl [message #44603] |
Wed, 15 April 2015 20:50 |
aftershock
Messages: 143 Registered: May 2008
|
Experienced Member |
|
|
Hi,
I created a grid control with columns.
I rearranged the order of some of the columns.
result.RemoveColumn ( 0, result.GetColumnCount() - 0 ); failed
void GridCtrl::RemoveColumn(int n, int count)
{
n += fixed_cols;
if(count < 0)
count = total_cols - n;
if(n < fixed_cols || n + count > total_cols)
return;
for(int i = 0; i < total_rows; i++)
items[i].Remove(n, count);
Vector<int> r;
for(int i = 0; i < count; i++)
{
if(edits[hitems[n + i].id].factory)
--genr_ctrls;
r.Add(hitems[n + i].id);
}
///////////BUG is HERE r is not sorted.... that is why Remove fails at assert later on
Upp::Sort(r); // solution
hitems.Remove(n, count);
rowbkp.Remove(r);
summary.Remove(r);
edits.Remove(r);
total_cols -= count;
recalc_cols = true;
valid_cursor = SetCursor0(min(curpos.x, total_cols - 1), curpos.y).IsValid();
Repaint(true);
}
[Updated on: Wed, 15 April 2015 20:55] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 07:04:56 CEST 2024
Total time taken to generate the page: 0.03753 seconds
|