mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 18:19:23 +02:00
lcl, grids, make sure that when changing from std grid to custom columns grid all sizes are recalculated, fix crash reported in issue #26232
git-svn-id: trunk@46148 -
This commit is contained in:
parent
2d61f083f6
commit
9da887b714
@ -2698,13 +2698,6 @@ begin
|
|||||||
if IsColumn then begin
|
if IsColumn then begin
|
||||||
AddDel(FCols, NewValue);
|
AddDel(FCols, NewValue);
|
||||||
FGCache.AccumWidth.Count:=NewValue;
|
FGCache.AccumWidth.Count:=NewValue;
|
||||||
// calc initial accumulated widths of new columns
|
|
||||||
OldCount := OldValue;
|
|
||||||
while (OldValue>0) and (OldCount<NewValue) do begin
|
|
||||||
FGCache.AccumWidth[OldCount] :=
|
|
||||||
FGCache.AccumWidth[OldCount-1] + GetColWidths(OldCount);
|
|
||||||
Inc(OldCount);
|
|
||||||
end;
|
|
||||||
OldCount:=RowCount;
|
OldCount:=RowCount;
|
||||||
if (OldValue=0)and(NewValue>=0) then begin
|
if (OldValue=0)and(NewValue>=0) then begin
|
||||||
FTopLeft.X:=FFixedCols;
|
FTopLeft.X:=FFixedCols;
|
||||||
@ -2720,6 +2713,7 @@ begin
|
|||||||
FGCache.AccumHeight.Count:=NewCount;
|
FGCache.AccumHeight.Count:=NewCount;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
UpdateCachedSizes;
|
||||||
SizeChanged(OldValue, OldCount);
|
SizeChanged(OldValue, OldCount);
|
||||||
// if new count makes current col out of range, adjust position
|
// if new count makes current col out of range, adjust position
|
||||||
// if not, position should not change (fake changed col to be the last one)
|
// if not, position should not change (fake changed col to be the last one)
|
||||||
@ -2730,13 +2724,6 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
AddDel(FRows, NewValue);
|
AddDel(FRows, NewValue);
|
||||||
FGCache.AccumHeight.Count:=NewValue;
|
FGCache.AccumHeight.Count:=NewValue;
|
||||||
// calc initial accumulated heights of new rows
|
|
||||||
OldCount := OldValue;
|
|
||||||
while (OldValue>0) and (OldCount<NewValue) do begin
|
|
||||||
FGCache.AccumHeight[OldCount] :=
|
|
||||||
FGCache.AccumHeight[OldCount-1] + GetRowHeights(OldCount);
|
|
||||||
Inc(OldCount);
|
|
||||||
end;
|
|
||||||
OldCount:=ColCount;
|
OldCount:=ColCount;
|
||||||
if (OldValue=0)and(NewValue>=0) then begin
|
if (OldValue=0)and(NewValue>=0) then begin
|
||||||
FTopleft.Y:=FFixedRows;
|
FTopleft.Y:=FFixedRows;
|
||||||
@ -2755,6 +2742,7 @@ begin
|
|||||||
FGCache.AccumWidth.Count:=NewCount;
|
FGCache.AccumWidth.Count:=NewCount;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
UpdateCachedSizes;
|
||||||
SizeChanged(OldCount, OldValue);
|
SizeChanged(OldCount, OldValue);
|
||||||
// if new count makes current row out of range, adjust position
|
// if new count makes current row out of range, adjust position
|
||||||
// if not, position should not change (fake changed row to be the last one)
|
// if not, position should not change (fake changed row to be the last one)
|
||||||
|
Loading…
Reference in New Issue
Block a user