From 375a129a6734f43d198537c4d39335910cf5eb29 Mon Sep 17 00:00:00 2001 From: Emilien Dup Date: Mon, 4 Dec 2023 14:43:45 +0100 Subject: [PATCH] Update XSSFSheet.cs --- ooxml/XSSF/UserModel/XSSFSheet.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ooxml/XSSF/UserModel/XSSFSheet.cs b/ooxml/XSSF/UserModel/XSSFSheet.cs index 6b8234f22..f299ebe66 100644 --- a/ooxml/XSSF/UserModel/XSSFSheet.cs +++ b/ooxml/XSSF/UserModel/XSSFSheet.cs @@ -5688,18 +5688,9 @@ private static void CopyRow(XSSFSheet srcSheet, XSSFSheet destSheet, XSSFRow src mergedRegion.FirstColumn, mergedRegion.LastColumn); - if (keepMergedRegion) - { - CellRangeAddress mergedRegion = srcSheet.GetMergedRegion(new CellRangeAddress(srcRow.RowNum, srcRow.RowNum, (short)oldCell.ColumnIndex, (short)oldCell.ColumnIndex)); - if (mergedRegion != null) + if (!destSheet.IsMergedRegion(newMergedRegion)) { - CellRangeAddress newMergedRegion = new CellRangeAddress(mergedRegion.FirstRow, - mergedRegion.LastRow, mergedRegion.FirstColumn, mergedRegion.LastColumn); - - if (!destSheet.IsMergedRegion(newMergedRegion)) - { - destSheet.AddMergedRegion(newMergedRegion); - } + destSheet.AddMergedRegion(newMergedRegion); } } }