From 07f9fa03dfc955ec290813db600707a28e8a334f Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 3 Feb 2017 12:09:21 +0000 Subject: [PATCH] fpspreadsheet: Fix worksheetgrid initially selecting cell B1 if attached to the internal workbook source git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5738 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/visual/fpspreadsheetgrid.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas index ac78755bb..ebea0f11d 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas @@ -82,6 +82,7 @@ type FDefColWidth100: Integer; // Default col width for 100% zoom factor, in pixels FZoomLock: Integer; FRowHeightLock: Integer; + FActiveCellLock: Integer; FOnClickHyperlink: TsHyperlinkClickEvent; function CalcAutoRowHeight(ARow: Integer): Integer; function CalcColWidthFromSheet(AWidth: Single): Integer; @@ -1017,7 +1018,9 @@ begin FInternalWorkbookSource := TsWorkbookSource.Create(self); FInternalWorkbookSource.Name := 'internal'; + inc(FActiveCellLock); inherited Create(AOwner); + dec(FActiveCellLock); AutoAdvance := aaDown; ExtendedSelect := true; @@ -4378,6 +4381,9 @@ var i: Integer; {$ENDIF} begin + if (FActiveCellLock > 0) then + exit; + if Worksheet <> nil then begin {$IFNDEF FPS_NO_GRID_MULTISELECT}