Skip to content

Commit

Permalink
- Fix checkCellInArea() index out of range when merged cell ref is …
Browse files Browse the repository at this point in the history
…single coordinate, relate issue qax-os#206;

- go test updated;
- Repository icon for SourceTree has been added
  • Loading branch information
xuri committed Apr 8, 2018
1 parent a6fc5a7 commit 564ebe4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ func checkCellInArea(cell, area string) bool {
area = strings.ToUpper(area)

ref := strings.Split(area, ":")
if len(ref) < 2 {
return false
}

from := ref[0]
to := ref[1]

Expand Down
1 change: 1 addition & 0 deletions excelize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func TestMergeCell(t *testing.T) {
xlsx.SetCellHyperLink("Sheet1", "J11", "https://github.com/360EntSecGroup-Skylar/excelize", "External")
xlsx.SetCellFormula("Sheet1", "G12", "SUM(Sheet1!B19,Sheet1!C19)")
xlsx.GetCellValue("Sheet1", "H11")
xlsx.GetCellValue("Sheet2", "A6") // Merged cell ref is single coordinate.
xlsx.GetCellFormula("Sheet1", "G12")
err = xlsx.Save()
if err != nil {
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/Book1.xlsx
Binary file not shown.

0 comments on commit 564ebe4

Please sign in to comment.