Skip to content

Commit

Permalink
Update XSSFSheet.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilienDup committed Dec 4, 2023
1 parent f5a0721 commit 375a129
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions ooxml/XSSF/UserModel/XSSFSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 375a129

Please sign in to comment.