Преглед на файлове

Fixed checking accessible value for ZoomScale, was missed in last commit

OloloevReal преди 7 години
родител
ревизия
9933a49f0e
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      sheetview.go

+ 4 - 1
sheetview.go

@@ -79,7 +79,10 @@ func (o *ShowRowColHeaders) getSheetViewOption(view *xlsxSheetView) {
 }
 }
 
 
 func (o ZoomScale) setSheetViewOption(view *xlsxSheetView) {
 func (o ZoomScale) setSheetViewOption(view *xlsxSheetView) {
-	view.ZoomScale = float64(o)
+	//This attribute is restricted to values ranging from 10 to 400.
+	if float64(o) >= 10 && float64(o) <= 400 {
+		view.ZoomScale = float64(o)
+	}
 }
 }
 
 
 func (o *ZoomScale) getSheetViewOption(view *xlsxSheetView) {
 func (o *ZoomScale) getSheetViewOption(view *xlsxSheetView) {