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;
public class ExcelConvertingHelperTests
{
[Fact]
public void BuildFont_Should_Return_RunProperties_With_FontName()
{
// Arrange
var runProps = new RunProperties(new FontName());
var spreadsheetDocument = SpreadsheetDocument.Create($"SampleWithRunProperties.xlsx", SpreadsheetDocumentType.Workbook);
var workbookPart = spreadsheetDocument.AddWorkbookPart();
var worksheetPart = 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();
// Act
var result = 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):
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):