Skip to content

Commit

Permalink
Fixes issue #1302
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKallman committed Feb 16, 2024
1 parent 7b8c27a commit 4f9bb47
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/EPPlus/Drawing/ExcelDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,16 @@ internal static ExcelDrawing GetDrawingFromNode(ExcelDrawings drawings, XmlNode
{
return new ExcelPivotTableSlicer(drawings, node, parent);
}
else if (choice.ChildNodes.Count > 0 && choice.FirstChild.LocalName=="sp")
else if (choice.ChildNodes.Count > 0)
{
return GetShapeOrControl(drawings, node, (XmlElement)choice.FirstChild, parent);
if (choice.FirstChild.LocalName == "sp")
{
return GetShapeOrControl(drawings, node, (XmlElement)choice.FirstChild, parent);
}
else if(choice.FirstChild.LocalName == "grpSp")
{
return new ExcelGroupShape(drawings, choice.FirstChild, parent);
}
}
break;

Expand Down
23 changes: 23 additions & 0 deletions src/EPPlusTest/Issues/WorksheetIssues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using OfficeOpenXml;
using System.IO;
namespace EPPlusTest
{
[TestClass]
Expand Down Expand Up @@ -132,5 +133,27 @@ public void s610()
SaveAndCleanup(p);
}
}
[TestMethod]
public void s614()
{
using (var package = OpenTemplatePackage("s614.xlsx"))
{
int sheetIndex = 5;
var sheetName = $"Data Sheet_{sheetIndex}";
var worksheet = package.Workbook.Worksheets[sheetName];
worksheet.Name = "TestSheet_{sheetIndex}";

worksheet.InsertColumn(1, 2);
worksheet.Cells.Style.Font.Name = "MS Pゴシック";
worksheet.Cells.Style.Font.Size = 11;

worksheet.Cells[1, 1].Value = "TextTextTextTextTextTextTextTextTextTextTextText";

worksheet.Column(1).AutoFit();
worksheet.Column(2).AutoFit();

package.Save();
}
}
}
}

0 comments on commit 4f9bb47

Please sign in to comment.