diff --git a/src/NPOI/SS/Util/SheetUtil.cs b/src/NPOI/SS/Util/SheetUtil.cs index a5b16aa..523f52d 100644 --- a/src/NPOI/SS/Util/SheetUtil.cs +++ b/src/NPOI/SS/Util/SheetUtil.cs @@ -170,7 +170,7 @@ namespace NPOI.SS.Util targetSheet.AddMergedRegion(newCellRangeAddress); } } - return newRow; + return newRow; } public static IRow CopyRow(ISheet sheet, int sourceRowIndex, int targetRowIndex) { @@ -183,12 +183,12 @@ namespace NPOI.SS.Util // If the row exist in destination, push down all rows by 1 else create a new row if (newRow != null) { - sheet.ShiftRows(targetRowIndex, sheet.LastRowNum, 1); - } - else - { - newRow = sheet.CreateRow(targetRowIndex); + sheet.ShiftRows(targetRowIndex, sheet.LastRowNum, 1, true, false); } + //new row + newRow = sheet.CreateRow(targetRowIndex); + //copyHeight + newRow.Height = sourceRow.Height; // Loop through source columns to add to new row for (int i = sourceRow.FirstCellNum; i < sourceRow.LastCellNum; i++) @@ -312,7 +312,7 @@ namespace NPOI.SS.Util //TextLayout layout; double width = -1; - using (Bitmap bmp = new Bitmap(1,1)) + using (Bitmap bmp = new Bitmap(1, 1)) using (Graphics g = Graphics.FromImage(bmp)) { if (cellType == CellType.String) @@ -450,7 +450,7 @@ namespace NPOI.SS.Util IWorkbook wb = sheet.Workbook; DataFormatter formatter = new DataFormatter(); - IFont defaultFont = wb.GetFontAt((short) 0); + IFont defaultFont = wb.GetFontAt((short)0); //str = new AttributedString((defaultChar)); //copyAttributes(defaultFont, str, 0, 1);