From ecc3adf22ab825b69c2aca74018247fbb4ed8cfd Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Wed, 7 Mar 2018 12:56:18 +0800 Subject: - Add protection properties associated with the cell support, relate issue #191; - godoc and go test has been updated --- excelize_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'excelize_test.go') diff --git a/excelize_test.go b/excelize_test.go index a89369a..41a2d7f 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -607,6 +607,23 @@ func TestSetCellStyleFont(t *testing.T) { } } +func TestSetCellStyleProtection(t *testing.T) { + xlsx, err := OpenFile("./test/Book2.xlsx") + if err != nil { + t.Log(err) + } + var style int + style, err = xlsx.NewStyle(`{"protection":{"hidden":true, "locked":true}}`) + if err != nil { + t.Log(err) + } + xlsx.SetCellStyle("Sheet2", "A6", "A6", style) + err = xlsx.Save() + if err != nil { + t.Log(err) + } +} + func TestSetDeleteSheet(t *testing.T) { xlsx, err := OpenFile("./test/Book3.xlsx") if err != nil { -- cgit v1.2.1