Browse Source

Merge branch 'shawnps-master'

Geoffrey J. Teale 11 years ago
parent
commit
ef904967da
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib.go

+ 5 - 1
lib.go

@@ -414,6 +414,8 @@ func calculateMaxMinFromWorksheet(worksheet *xlsxWorksheet) (minx, miny, maxx, m
 			}
 			}
 		}
 		}
 	}
 	}
+	if minx == math.MaxInt64 { minx = 0 }
+	if miny == math.MaxInt64 { miny = 0 }
 	return
 	return
 }
 }
 
 
@@ -554,7 +556,9 @@ func readRowsFromSheet(Worksheet *xlsxWorksheet, file *File) ([]*Row, int, int)
 			row.Cells[cellX].date1904 = file.Date1904
 			row.Cells[cellX].date1904 = file.Date1904
 			insertColIndex++
 			insertColIndex++
 		}
 		}
-		rows[insertRowIndex-minRow] = row
+		if len(rows) > insertRowIndex-minRow {
+			rows[insertRowIndex-minRow] = row
+		}
 		insertRowIndex++
 		insertRowIndex++
 	}
 	}
 	return rows, colCount, rowCount
 	return rows, colCount, rowCount