You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team Describe the bug
After updating to version 3.1.0, I've encountered a bug. When I create a DocumentFormat.OpenXml.Spreadsheet.RunProperties with FontName as a child element, it changes the FontName to OpenXmlUnknownElement.
Screenshots
To Reproduce
using System.Linq;using DocumentFormat.OpenXml;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Spreadsheet;using Xunit;namespace SOME_NAME_SPACE;publicclassExcelConvertingHelperTests{[Fact]publicvoidBuildFont_Should_Return_RunProperties_With_FontName(){// ArrangevarrunProps=new RunProperties(new FontName());varspreadsheetDocument= SpreadsheetDocument.Create($"SampleWithRunProperties.xlsx", SpreadsheetDocumentType.Workbook);varworkbookPart= spreadsheetDocument.AddWorkbookPart();varworksheetPart= workbookPart.AddNewPart<WorksheetPart>();
worksheetPart.Worksheet =new Worksheet(new SheetData(new Row(new Cell(new InlineString(new Run(runProps))))));
workbookPart.Workbook =new Workbook(new Sheets(new Sheet()));
spreadsheetDocument.Save();// Actvarresult= worksheetPart.Worksheet.Descendants<RunProperties>().First().FirstChild;// Assert
Assert.True(result is FontName);
Assert.True(result is not OpenXmlUnknownElement);
spreadsheetDocument.Dispose();}}
Run the test
See error
Expected behavior
FontName becomes OpenXmlUnknownElement, I expect it to stay FontName.
Desktop (please complete the following information):
OS: Windows 11 Enterprise 23H2
.NET Target: .Net 8.0
DocumentFormat.OpenXml Version: 3.1.0
The text was updated successfully, but these errors were encountered:
Hi team
Describe the bug
After updating to version 3.1.0, I've encountered a bug. When I create a DocumentFormat.OpenXml.Spreadsheet.RunProperties with FontName as a child element, it changes the FontName to OpenXmlUnknownElement.
Screenshots
To Reproduce
Expected behavior
FontName becomes OpenXmlUnknownElement, I expect it to stay FontName.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: