From a658f6f7e6134c692e3bac1ee76318f0b7f4fb57 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 2 Jun 2015 08:31:00 +0000 Subject: [PATCH] fpspreadsheet: Fix runtime errors of guitests in debug mode git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4174 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsclasses.pas | 2 +- components/fpspreadsheet/tests/copytests.pas | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/fpspreadsheet/fpsclasses.pas b/components/fpspreadsheet/fpsclasses.pas index f9903973f..479623c17 100644 --- a/components/fpspreadsheet/fpsclasses.pas +++ b/components/fpspreadsheet/fpsclasses.pas @@ -278,7 +278,7 @@ begin begin rc := curr^; if LongInt(rc.Col) < FStartCol then - dec(rc.Row); + dec(LongInt(rc.Row)); rc.Col := FEndCol; FCurrentNode := FTree.FindNearest(@rc); if FCurrentNode <> nil then begin diff --git a/components/fpspreadsheet/tests/copytests.pas b/components/fpspreadsheet/tests/copytests.pas index c162e6f70..72584184b 100644 --- a/components/fpspreadsheet/tests/copytests.pas +++ b/components/fpspreadsheet/tests/copytests.pas @@ -339,7 +339,7 @@ begin SourceCells[i+(col-2)].UsedFormattingFields = MyWorksheet.ReadUsedFormatting(cell), 'Used formatting fields mismatch, cell ' + CellNotation(myWorksheet, row, col) ); - if (uffBackground in SourceCells[i].UsedFormattingFields) then + if (uffBackground in SourceCells[i+(col-2)].UsedFormattingFields) then CheckEquals( SourceCells[i+(col-2)].BackgroundColor, MyWorksheet.ReadBackgroundColor(cell), @@ -408,7 +408,7 @@ begin end; 6: begin - if row = 0 then + if (row = 0) or (i >= Length(SourceCells)) then expectedFormula := '' else begin