summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-09-18 22:20:58 +0800
committerxuri <xuri.me@gmail.com>2020-09-18 22:20:58 +0800
commit324f87bcaed9ec775c0b79627956a093ad481d36 (patch)
tree56a779bde041b3dae82ab0f2e827ed0021c3d602 /col.go
parent96917e4617c9e7eb15c0ee1723a042f169321430 (diff)
add checking and limits for the worksheet
Diffstat (limited to 'col.go')
-rw-r--r--col.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/col.go b/col.go
index 72db4be..19ce99b 100644
--- a/col.go
+++ b/col.go
@@ -444,6 +444,9 @@ func (f *File) SetColWidth(sheet, startcol, endcol string, width float64) error
if err != nil {
return err
}
+ if width > MaxColumnWidth {
+ return errors.New("the width of the column must be smaller than or equal to 255 characters")
+ }
if min > max {
min, max = max, min
}