From 0f8b78f1c981e813a7c39d15894f8bcdee3ed368 Mon Sep 17 00:00:00 2001 From: jesus Date: Mon, 17 Mar 2008 18:49:19 +0000 Subject: [PATCH] LCL, fixed creating handle during loading of rowheights, hint from C Western, issue #10977 git-svn-id: trunk@14559 - --- lcl/grids.pas | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/lcl/grids.pas b/lcl/grids.pas index 37a4b92d57..7102a2707c 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -1775,10 +1775,13 @@ var R: TRect; Bigger: boolean; begin - if AValue<0 then Avalue:=-1; + if AValue<0 then + Avalue:=-1; + if Avalue<>integer(PtrUInt(FCols[ACol])) then begin Bigger := AValue>integer(PtrUInt(FCols[ACol])); SetRawColWidths(ACol, Avalue); + if not (csLoading in ComponentState) then begin if FUpdateCount=0 then begin @@ -1800,6 +1803,7 @@ begin EditorWidthChanged(aCol, aValue); ColWidthsChanged; end; + end; end; @@ -2052,30 +2056,35 @@ var R: TRect; Bigger: boolean; begin - if AValue<0 then AValue:=-1; + if AValue<0 then + AValue:=-1; + if AValue<>integer(PtrUInt(FRows[ARow])) then begin bigger := aValue > RowHeights[aRow]; FRows[ARow]:=Pointer(PtrInt(AValue)); - if FUpdateCount=0 then begin - UpdateSizes; + if not (csLoading in ComponentState) then begin + if FUpdateCount=0 then begin + UpdateSizes; - R := CellRect(0, aRow); - R.Right := FGCache.MaxClientXY.X+GetBorderWidth+1; - if bigger then - R.Bottom := FGCache.MaxClientXY.Y+GetBorderWidth+1 - else - R.Bottom := FGCache.ClientHeight; - if aRow=FTopLeft.y then - R.Top := FGCache.FixedHeight; + R := CellRect(0, aRow); + R.Right := FGCache.MaxClientXY.X+GetBorderWidth+1; + if bigger then + R.Bottom := FGCache.MaxClientXY.Y+GetBorderWidth+1 + else + R.Bottom := FGCache.ClientHeight; + if aRow=FTopLeft.y then + R.Top := FGCache.FixedHeight; - InvalidateRect(handle, @R, False); + InvalidateRect(handle, @R, False); + end; + + if (FEditor<>nil)and(Feditor.Visible)and(ARow<=FRow) then EditorPos; + RowHeightsChanged; end; - if (FEditor<>nil)and(Feditor.Visible)and(ARow<=FRow) then EditorPos; - RowHeightsChanged; end; end;