-
Notifications
You must be signed in to change notification settings - Fork 302
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Whilst not a bug per se, this can cause problems for someone doing this:
double? bottomMargin = default;
ws.PrinterSettings.BottomMargin = bottomMargin ?? ws.PrinterSettings.BottomMargin;Since bottomMargin has no value the return value from ws.PrinterSettings.BottomMargin will be assigned to itself, which probably makes sense. However since the getter of these properties reads directly from the xml via the GetXmlNodeDouble method they will return double.NaN if there is no value set. And this causes "NaN" to be written to the xml and causes a corrupt workbook.
Possible improvements
- Improve the xml documents for the properties in the PrinterSettings class and add the information that they return NaN if there is no value set.
- We could perhaps ignore NaN values in the setters - if the current value is Null and the new value is double.NaN don't write the new value to the xml.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog