From 2abbee1637d5b68b02926c45fd47916f77c602dd Mon Sep 17 00:00:00 2001 From: ondrej Date: Mon, 8 May 2017 21:37:25 +0000 Subject: [PATCH] lcl: dbgrids: adapt after r54816 #43e271b439. Issue #31765 and #31715 git-svn-id: trunk@54842 - --- lcl/dbgrids.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 9357815c65..62ba5313f0 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -1447,13 +1447,13 @@ end; function TCustomDBGrid.DefaultFieldColWidth(F: TField): Integer; begin if not HandleAllocated or (F=nil) then - result:=DefaultColWidth + result:=GetRealDefaultColWidth else begin if F.DisplayWidth = 0 then if Canvas.HandleAllocated then result := Canvas.TextWidth( F.DisplayName ) + 3 else - Result := DefaultColWidth + Result := GetRealDefaultColWidth else result := F.DisplayWidth * CalcCanvasCharWidth(Canvas); end; @@ -1610,7 +1610,7 @@ begin {$ifdef dbgDBGrid} DebugLn('%s.GetBufferCount', [ClassName]); {$endif} - Result := ClientHeight div DefaultRowHeight; + Result := ClientHeight div GetRealDefaultRowHeight; if dgTitles in Options then Dec(Result, 1); end; @@ -4249,7 +4249,7 @@ begin FreeWorkingCanvas(tmpCanvas); end else - result := DEFCOLWIDTH; + result := -1; end; function TColumn.CreateTitle: TGridColumnTitle;