summaryrefslogtreecommitdiff
path: root/sheetview.go
diff options
context:
space:
mode:
authorjaby <Peter.De.Velder@ilias-solutions.com>2019-09-30 14:37:52 +0200
committerdvelderp <Peter.De.Velder@ilias-solutions.com>2019-09-30 14:39:30 +0200
commitbabfeb6b57ad3e63f68f5e031869efc54c9cfe0b (patch)
tree365adbcd9b2f1360b78c597514444ae1bd2cac86 /sheetview.go
parenteb520ae27757d4bca276fa2894bf461d75df9b37 (diff)
Add missing ShowZeros SheetViewOption implementation
Diffstat (limited to 'sheetview.go')
-rw-r--r--sheetview.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/sheetview.go b/sheetview.go
index 09f5789..8a5091f 100644
--- a/sheetview.go
+++ b/sheetview.go
@@ -51,14 +51,18 @@ type (
// visible cell Location of the top left visible cell in the bottom right
// pane (when in Left-to-Right mode).
TopLeftCell string
+ // ShowZeros is a SheetViewOption. It specifies a flag indicating
+ // whether to "show a zero in cells that have zero value".
+ // When using a formula to reference another cell which is empty, the referenced value becomes 0
+ // when the flag is true. (Default setting is true.)
+ ShowZeros bool
+
/* TODO
// ShowWhiteSpace is a SheetViewOption. It specifies a flag indicating
// whether page layout view shall display margins. False means do not display
// left, right, top (header), and bottom (footer) margins (even when there is
// data in the header or footer).
ShowWhiteSpace bool
- // ShowZeros is a SheetViewOption.
- ShowZeros bool
// WindowProtection is a SheetViewOption.
WindowProtection bool
*/
@@ -106,6 +110,14 @@ func (o *ShowGridLines) getSheetViewOption(view *xlsxSheetView) {
*o = ShowGridLines(defaultTrue(view.ShowGridLines)) // Excel default: true
}
+func (o ShowZeros) setSheetViewOption(view *xlsxSheetView) {
+ view.ShowZeros = boolPtr(bool(o))
+}
+
+func (o *ShowZeros) getSheetViewOption(view *xlsxSheetView) {
+ *o = ShowZeros(defaultTrue(view.ShowZeros)) // Excel default: true
+}
+
func (o ShowRowColHeaders) setSheetViewOption(view *xlsxSheetView) {
view.ShowRowColHeaders = boolPtr(bool(o))
}