Skip to content

Commit 58a79b4

Browse files
authored
Update comments
1 parent 451e6e3 commit 58a79b4

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

sheetview.go

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,51 @@ package excelize
1111

1212
import "fmt"
1313

14-
// SheetViewOption is an option of a view of a worksheet. See SetSheetViewOptions().
14+
// SheetViewOption is an option of a view of a worksheet. See
15+
// SetSheetViewOptions().
1516
type SheetViewOption interface {
1617
setSheetViewOption(view *xlsxSheetView)
1718
}
1819

19-
// SheetViewOptionPtr is a writable SheetViewOption. See GetSheetViewOptions().
20+
// SheetViewOptionPtr is a writable SheetViewOption. See
21+
// GetSheetViewOptions().
2022
type SheetViewOptionPtr interface {
2123
SheetViewOption
2224
getSheetViewOption(view *xlsxSheetView)
2325
}
2426

2527
type (
26-
// DefaultGridColor specified a flag indicating that the consuming
27-
// application should use the default grid lines color (system dependent).
28-
// Overrides any color specified in colorId.
28+
// DefaultGridColor is a SheetViewOption. It specifies a flag indicating that
29+
// the consuming application should use the default grid lines color (system
30+
// dependent). Overrides any color specified in colorId.
2931
DefaultGridColor bool
30-
// RightToLeft specified a flag indicating whether the sheet is in 'right to
31-
// left' display mode. When in this mode, Column A is on the far right,
32-
// Column B ;is one column left of Column A, and so on. Also, information in
33-
// cells is displayed in the Right to Left format.
32+
// RightToLeft is a SheetViewOption. It specifies a flag indicating whether
33+
// the sheet is in 'right to left' display mode. When in this mode, Column A
34+
// is on the far right, Column B ;is one column left of Column A, and so on.
35+
// Also, information in cells is displayed in the Right to Left format.
3436
RightToLeft bool
35-
// ShowFormulas specified a flag indicating whether this sheet should display
36-
// formulas.
37+
// ShowFormulas is a SheetViewOption. It specifies a flag indicating whether
38+
// this sheet should display formulas.
3739
ShowFormulas bool
38-
// ShowGridLines specified a flag indicating whether this sheet should
39-
// display gridlines.
40+
// ShowGridLines is a SheetViewOption. It specifies a flag indicating whether
41+
// this sheet should display gridlines.
4042
ShowGridLines bool
41-
// ShowRowColHeaders specified a flag indicating whether the sheet should
42-
// display row and column headings.
43+
// ShowRowColHeaders is a SheetViewOption. It specifies a flag indicating
44+
// whether the sheet should display row and column headings.
4345
ShowRowColHeaders bool
44-
// ZoomScale specified a window zoom magnification for current view
45-
// representing percent values. This attribute is restricted to values
46-
// ranging from 10 to 400. Horizontal & Vertical scale together.
46+
// ZoomScale is a SheetViewOption. It specifies a window zoom magnification
47+
// for current view representing percent values. This attribute is restricted
48+
// to values ranging from 10 to 400. Horizontal & Vertical scale together.
4749
ZoomScale float64
48-
// TopLeftCell specified a location of the top left visible cell Location of
49-
// the top left visible cell in the bottom right pane (when in Left-to-Right
50-
// mode).
50+
// TopLeftCell is a SheetViewOption. It specifies a location of the top left
51+
// visible cell Location of the top left visible cell in the bottom right
52+
// pane (when in Left-to-Right mode).
5153
TopLeftCell string
5254
/* TODO
53-
// ShowWhiteSpace specified flag indicating whether page layout view shall
54-
// display margins. False means do not display left, right, top (header), and
55-
// bottom (footer) margins (even when there is data in the header or footer).
55+
// ShowWhiteSpace is a SheetViewOption. It specifies a flag indicating
56+
// whether page layout view shall display margins. False means do not display
57+
// left, right, top (header), and bottom (footer) margins (even when there is
58+
// data in the header or footer).
5659
ShowWhiteSpace bool
5760
// ShowZeros is a SheetViewOption.
5861
ShowZeros bool
@@ -140,19 +143,23 @@ func (f *File) getSheetView(sheetName string, viewIndex int) (*xlsxSheetView, er
140143
return &(xlsx.SheetViews.SheetView[viewIndex]), err
141144
}
142145

143-
// SetSheetViewOptions sets sheet view options.
144-
// The viewIndex may be negative and if so is counted backward (-1 is the last view).
146+
// SetSheetViewOptions sets sheet view options. The viewIndex may be negative
147+
// and if so is counted backward (-1 is the last view).
145148
//
146149
// Available options:
150+
//
147151
// DefaultGridColor(bool)
148152
// RightToLeft(bool)
149153
// ShowFormulas(bool)
150154
// ShowGridLines(bool)
151155
// ShowRowColHeaders(bool)
152156
// ZoomScale(float64)
153157
// TopLeftCell(string)
158+
//
154159
// Example:
160+
//
155161
// err = f.SetSheetViewOptions("Sheet1", -1, ShowGridLines(false))
162+
//
156163
func (f *File) SetSheetViewOptions(name string, viewIndex int, opts ...SheetViewOption) error {
157164
view, err := f.getSheetView(name, viewIndex)
158165
if err != nil {
@@ -165,20 +172,24 @@ func (f *File) SetSheetViewOptions(name string, viewIndex int, opts ...SheetView
165172
return nil
166173
}
167174

168-
// GetSheetViewOptions gets the value of sheet view options.
169-
// The viewIndex may be negative and if so is counted backward (-1 is the last view).
175+
// GetSheetViewOptions gets the value of sheet view options. The viewIndex may
176+
// be negative and if so is counted backward (-1 is the last view).
170177
//
171178
// Available options:
179+
//
172180
// DefaultGridColor(bool)
173181
// RightToLeft(bool)
174182
// ShowFormulas(bool)
175183
// ShowGridLines(bool)
176184
// ShowRowColHeaders(bool)
177185
// ZoomScale(float64)
178186
// TopLeftCell(string)
187+
//
179188
// Example:
189+
//
180190
// var showGridLines excelize.ShowGridLines
181191
// err = f.GetSheetViewOptions("Sheet1", -1, &showGridLines)
192+
//
182193
func (f *File) GetSheetViewOptions(name string, viewIndex int, opts ...SheetViewOptionPtr) error {
183194
view, err := f.getSheetView(name, viewIndex)
184195
if err != nil {

0 commit comments

Comments
 (0)