fpspreadsheet: Fix index bug in TsWorksheet.SetIndex (reported by forum user "iteh")

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7012 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-06-17 15:09:48 +00:00
parent 7585c5a3c9
commit b38dcbe737

View File

@ -7283,8 +7283,8 @@ begin
if AValue < 0 then
AValue := 0
else
if AValue > TsWorkbook(FWorkbook).GetWorksheetCount then
Avalue := TsWorkbook(FWorkbook).GetWorksheetCount - 1;
if AValue >= TsWorkbook(FWorkbook).GetWorksheetCount then
AValue := TsWorkbook(FWorkbook).GetWorksheetCount - 1;
oldIndex := GetIndex;
if oldIndex <> AValue then
TsWorkbook(FWorkbook).MoveSheet(oldIndex, Avalue);