未验证 提交 4046e09b 编写于 作者: T Tony Qu 提交者: GitHub

Merge pull request #1125 from Bykiev/master

Fix checking if cell is locked
......@@ -30,7 +30,7 @@ public static CT_CellProtection Parse(XmlNode node, XmlNamespaceManager namespac
if (node == null)
return null;
CT_CellProtection ctObj = new CT_CellProtection();
ctObj.locked = XmlHelper.ReadBool(node.Attributes["locked"]);
ctObj.locked = XmlHelper.ReadBool(node.Attributes["locked"], true);
ctObj.hidden = XmlHelper.ReadBool(node.Attributes["hidden"]);
return ctObj;
}
......
......@@ -806,7 +806,6 @@ public bool IsLocked
{
get
{
if (!_cellXf.IsSetProtection())
{
return true;
......
......@@ -724,9 +724,24 @@ public void TestGetSetLocked()
cellStyle.IsLocked = (false);
Assert.IsFalse(cellStyle.IsLocked);
}
[Test]
public void TestBug738()
{
XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("738.xlsx");
ISheet sheet = wb.GetSheet("Sheet1");
IRow row = sheet.GetRow(0);
ICell cell = row.GetCell(0);
Assert.IsTrue(cell.CellStyle.IsLocked);
cell.CellStyle.IsLocked = true;
Assert.IsTrue(cell.CellStyle.IsLocked);
Assert.IsTrue(cell.CellStyle.IsHidden);
}
[Test]
public void TestGetSetIndent()
{
Assert.AreEqual((short)0, cellStyle.Indention);
cellStyle.Indention = ((short)3);
Assert.AreEqual((short)3, cellStyle.Indention);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册