mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
CtrlLib: HeaderCtrl now ignores serialization when number of columns is different #898
git-svn-id: svn://ultimatepp.org/upp/trunk@7839 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7bc4483a57
commit
48fac7f2bb
1 changed files with 13 additions and 10 deletions
|
|
@ -741,23 +741,26 @@ void HeaderCtrl::Serialize(Stream& s) {
|
|||
if(version >= 0x04) {
|
||||
int n = col.GetCount();
|
||||
s / n;
|
||||
Array<Column> col2 = clone(col);
|
||||
if(s.IsLoading())
|
||||
col.InsertN(0, n);
|
||||
col2.InsertN(0, n);
|
||||
for(int i = 0; i < n; i++) {
|
||||
int ndx = col[i].index;
|
||||
int ndx = col2[i].index;
|
||||
s % ndx;
|
||||
if(s.IsLoading())
|
||||
for(int j = n; j < col.GetCount(); j++)
|
||||
if(col[j].index == ndx) {
|
||||
col.Swap(i, j);
|
||||
for(int j = n; j < col2.GetCount(); j++)
|
||||
if(col2[j].index == ndx) {
|
||||
col2.Swap(i, j);
|
||||
break;
|
||||
}
|
||||
col[i].index = ndx;
|
||||
s % col[i].ratio;
|
||||
s % col[i].visible;
|
||||
col2[i].index = ndx;
|
||||
s % col2[i].ratio;
|
||||
s % col2[i].visible;
|
||||
}
|
||||
if(s.IsLoading() && n == col.GetCount()) {
|
||||
col2.Trim(n);
|
||||
col = pick(col2);
|
||||
}
|
||||
if(s.IsLoading())
|
||||
col.Trim(n);
|
||||
}
|
||||
else
|
||||
if(version < 0x01) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue