From a5cdbad1bb00b900df8d8347765d10d0560fd8f6 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 4 May 2023 11:33:18 +0000 Subject: [PATCH] fpspreadsheet: Fix insert row/col behaviour when insert happens at the anchor of a merged block. Issue #39051. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8819 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/fpspreadsheet.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index 13836ca5b..66aec1c26 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -5712,7 +5712,7 @@ begin for rng in FMergedCells do begin // The new row is ABOVE the merged block --> Shift entire range down by 1 row - if (AIndex < Integer(rng^.Row1)) then + if (AIndex <= Integer(rng^.Row1)) then begin // The formerly first row is no longer merged --> un-tag its cells for cell in Cells.GetRowEnumerator(rng^.Row1, rng^.Col1, rng^.Col2) do @@ -5741,7 +5741,7 @@ begin begin // The new column is at the LEFT of the merged block // --> Shift entire range to the right by 1 column - if (AIndex < Integer(rng^.Col1)) then + if (AIndex <= Integer(rng^.Col1)) then begin // The former first column is no longer merged --> un-tag its cells for cell in Cells.GetColEnumerator(rng^.Col1, rng^.Row1, rng^.Row2) do