File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,12 @@ type (
60
60
ShowZeros bool
61
61
// View is a SheetViewOption. It specifies a flag indicating
62
62
// how sheet is displayed, by default it uses empty string
63
- // available options: pageLayout, pageBreakPreview
63
+ // available options: normal, pageLayout, pageBreakPreview
64
64
View string
65
-
65
+ // ShowRuler is a SheetViewOption. It specifies a flag indicating
66
+ // this sheet should display ruler.
67
+ ShowRuler bool
68
+
66
69
/* TODO
67
70
// ShowWhiteSpace is a SheetViewOption. It specifies a flag indicating
68
71
// whether page layout view shall display margins. False means do not display
@@ -124,6 +127,14 @@ func (o *ShowGridLines) getSheetViewOption(view *xlsxSheetView) {
124
127
* o = ShowGridLines (defaultTrue (view .ShowGridLines )) // Excel default: true
125
128
}
126
129
130
+ func (o ShowRuler ) setSheetViewOption (view * xlsxSheetView ) {
131
+ view .ShowRuler = boolPtr (bool (o ))
132
+ }
133
+
134
+ func (o * ShowRuler ) getSheetViewOption (view * xlsxSheetView ) {
135
+ * o = ShowRuler (defaultTrue (view .ShowRuler )) // Excel default: true
136
+ }
137
+
127
138
func (o ShowZeros ) setSheetViewOption (view * xlsxSheetView ) {
128
139
view .ShowZeros = boolPtr (bool (o ))
129
140
}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ var _ = []SheetViewOption{
15
15
ShowRowColHeaders (true ),
16
16
TopLeftCell ("B2" ),
17
17
View ("pageLayout" ),
18
+ ShowRuler (false ),
18
19
// SheetViewOptionPtr are also SheetViewOption
19
20
new (DefaultGridColor ),
20
21
new (RightToLeft ),
@@ -32,6 +33,7 @@ var _ = []SheetViewOptionPtr{
32
33
(* ShowRowColHeaders )(nil ),
33
34
(* TopLeftCell )(nil ),
34
35
(* View )(nil ),
36
+ (* ShowRuler )(nil ),
35
37
}
36
38
37
39
func ExampleFile_SetSheetViewOptions () {
@@ -47,6 +49,7 @@ func ExampleFile_SetSheetViewOptions() {
47
49
ZoomScale (80 ),
48
50
TopLeftCell ("C3" ),
49
51
View ("pageLayout" ),
52
+ ShowRuler (false ),
50
53
); err != nil {
51
54
fmt .Println (err )
52
55
}
Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ type xlsxSheetView struct {
191
191
ShowZeros * bool `xml:"showZeros,attr,omitempty"`
192
192
RightToLeft bool `xml:"rightToLeft,attr,omitempty"`
193
193
TabSelected bool `xml:"tabSelected,attr,omitempty"`
194
+ ShowRuler * bool `xml:"showRuler,attr,omitempty"`
194
195
ShowWhiteSpace * bool `xml:"showWhiteSpace,attr"`
195
196
ShowOutlineSymbols bool `xml:"showOutlineSymbols,attr,omitempty"`
196
197
DefaultGridColor * bool `xml:"defaultGridColor,attr"`
You can’t perform that action at this time.
0 commit comments