public void setLineWidth(double width) {\r
CTShapeProperties spPr = getSpPr();\r
if (width == 0.) {\r
- if (spPr.isSetLn())\r
+ if (spPr.isSetLn() && spPr.getLn().isSetW())\r
spPr.getLn().unsetW();\r
} else {\r
CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr\r
public void setLineDash(LineDash dash) {\r
CTShapeProperties spPr = getSpPr();\r
if (dash == null) {\r
- if (spPr.isSetLn())\r
+ if (spPr.isSetLn() && spPr.getLn().isSetPrstDash())\r
spPr.getLn().unsetPrstDash();\r
} else {\r
CTPresetLineDashProperties val = CTPresetLineDashProperties.Factory\r
public void setLineCap(LineCap cap) {\r
CTShapeProperties spPr = getSpPr();\r
if (cap == null) {\r
- if (spPr.isSetLn())\r
+ if (spPr.isSetLn() && spPr.getLn().isSetCap())\r
spPr.getLn().unsetCap();\r
} else {\r
CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr\r
assertEquals(null, shape.getLineColor());\r
// setting dash width to null unsets the SolidFill element\r
assertFalse(shape.getSpPr().getLn().isSetSolidFill());\r
+\r
+ XSLFSimpleShape ln2 = slide.createAutoShape();\r
+ ln2.setLineDash(LineDash.DOT);\r
+ assertEquals(LineDash.DOT, ln2.getLineDash());\r
+ ln2.setLineWidth(0.);\r
+ assertEquals(0., ln2.getLineWidth());\r
+\r
+ XSLFSimpleShape ln3 = slide.createAutoShape();\r
+ ln3.setLineWidth(1.);\r
+ assertEquals(1., ln3.getLineWidth());\r
+ ln3.setLineDash(null);\r
+ assertEquals(null, ln3.getLineDash());\r
+ ln3.setLineCap(null);\r
+ assertEquals(null, ln3.getLineDash());\r
}\r
\r
public void testFill() {\r