Skip to content

Commit 564ebe4

Browse files
committed
- Fix checkCellInArea() index out of range when merged cell ref is single coordinate, relate issue qax-os#206;
- go test updated; - Repository icon for SourceTree has been added
1 parent a6fc5a7 commit 564ebe4

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Diff for: cell.go

+4
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ func checkCellInArea(cell, area string) bool {
532532
area = strings.ToUpper(area)
533533

534534
ref := strings.Split(area, ":")
535+
if len(ref) < 2 {
536+
return false
537+
}
538+
535539
from := ref[0]
536540
to := ref[1]
537541

Diff for: excelize_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ func TestMergeCell(t *testing.T) {
332332
xlsx.SetCellHyperLink("Sheet1", "J11", "https://github.com/360EntSecGroup-Skylar/excelize", "External")
333333
xlsx.SetCellFormula("Sheet1", "G12", "SUM(Sheet1!B19,Sheet1!C19)")
334334
xlsx.GetCellValue("Sheet1", "H11")
335+
xlsx.GetCellValue("Sheet2", "A6") // Merged cell ref is single coordinate.
335336
xlsx.GetCellFormula("Sheet1", "G12")
336337
err = xlsx.Save()
337338
if err != nil {

Diff for: logo.png

4.11 KB
Loading

Diff for: test/Book1.xlsx

19 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)