Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » bug in gridcrtl
bug in gridcrtl [message #44603] Wed, 15 April 2015 20:50 Go to next message
aftershock is currently offline  aftershock
Messages: 99
Registered: May 2008
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

Re: bug in gridcrtl [message #48022 is a reply to message #44603] Wed, 10 May 2017 13:16 Go to previous message
mirek is currently online  mirek
Messages: 11002
Registered: November 2005
Ultimate Member
Thanks, patch applied.

Mirek
Previous Topic: automatic build set up does not start up
Goto Forum:
  


Current Time: Fri May 26 18:47:40 CEST 2017

Total time taken to generate the page: 0.00929 seconds