Skip to content

Commit

Permalink
getcell with row/col reference. Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fchorney authored and felipenoris committed Sep 17, 2019
1 parent 2127ce2 commit 48e6c47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/worksheet.jl
Expand Up @@ -220,6 +220,8 @@ function getcell(ws::Worksheet, ref::AbstractString)
end
end

getcell(ws::Worksheet, row::Integer, col::Integer) = getcell(ws, CellRef(row, col))

"""
getcellrange(sheet, rng)
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Expand Up @@ -1258,6 +1258,10 @@ end
@test sheet["B2"] == "hello world"
@test XLSX.getcell(sheet, "B2").style == id(textstyle)

sheet[3, 1] = CellValue("hello friend", textstyle)
@test sheet[3, 1] == "hello friend"
@test XLSX.getcell(sheet, 3, 1).style == id(textstyle)

# Check CellDataFormat only works with CellValues
@test_throws MethodError XLSX.CellValue([1,2,3,4], textstyle)

Expand Down

0 comments on commit 48e6c47

Please sign in to comment.