ソースを参照

read excel support data validation issue #7

rentiansheng 7 年 前
コミット
e9c97903cc
1 ファイル変更5 行追加5 行削除
  1. 5 5
      lib.go

+ 5 - 5
lib.go

@@ -709,11 +709,8 @@ func readSheetFromFile(sc chan *indexedSheet, index int, rsheet xlsxSheet, fi *F
 		}
 		}
 		dd.Sqref = ""
 		dd.Sqref = ""
 
 
-		if 0 == len(parts) {
-			sheet.Cell(minRow, minCol).SetDataValidation(dd)
-
-		} else {
-			maxCol, maxRow, err := GetCoordsFromCellIDString(parts[0])
+		if 2 == len(parts) {
+			maxCol, maxRow, err := GetCoordsFromCellIDString(parts[1])
 			if nil != err {
 			if nil != err {
 				return fmt.Errorf("data validation %s", err.Error())
 				return fmt.Errorf("data validation %s", err.Error())
 			}
 			}
@@ -726,6 +723,9 @@ func readSheetFromFile(sc chan *indexedSheet, index int, rsheet xlsxSheet, fi *F
 				}
 				}
 
 
 			}
 			}
+		} else {
+			sheet.Cell(minRow, minCol).SetDataValidation(dd)
+
 		}
 		}
 
 
 	}
 	}