Description
Read and complete the full issue template
Do you want to request a feature or report a bug?
- Bug
- Feature
- Question
Did you test against the latest CI build?
- Yes
- No
Version of ClosedXML
0.102.3
What is the current behavior?
Firstly, set up formatting in Excel as shown in the attached file.
Steps to make this Excel file:
- Set the border of the cells to "thin" around the outer edges using the standard style.
- Configure Conditional Formatting as shown in the attached image.
When opening the Excel file, it displays as shown in the attached image.
However, when copying the file using ClosedXML and saving it as is, the display changes as shown in the attached image.
After tracing through the ClosedXML code, it seems that when copying a cell with a border set to "None", the value XLBorderStyleValues.None is applied.
When saving the file in this state, the border does not remain "None" state but instead reverts to the default border style.
What is the expected behavior or new feature?
In Excel, a border set to "None" and the default border are treated as different states, so I would appreciate it if ClosedXML could handle them as distinct states as well.
Is this a regression from the previous version?
n/a.
Reproducibility
Code to reproduce problem:
using ClosedXML.Excel;
public void Main()
{
var workbook = new XLWorkbook("path/to/source.xlsx");
// additional ConditionalFormatting for test
var worksheet = workbook.Worksheet(1);
worksheet.Cell("D5").AddConditionalFormat().WhenBetween(1, 5).Border.SetTopBorder(XLBorderStyleValues.None);
workbook.SaveAs("path/to/destination.xlsx");
}
- I attached a sample spreadsheet. (You can drag files on to this issue)
source.xlsx
Activity