<changes>
<release version="3.8-beta6" date="2012-??-??">
+ <action dev="poi-developers" type="fix">52701 - fixed seting vertical alignment for XSLFTableCell</action>
<action dev="poi-developers" type="fix">52687 - fixed merging slides with pictures with associated custom tags</action>
<action dev="poi-developers" type="add"> allow runtime registration of functions in FormulaEvaluator</action>
<action dev="poi-developers" type="fix">52665 - When reading from a ZipFileZipEntrySource that has already been closed, give IllegalArgumentException rather than NPE</action>
import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndWidth;\r
import org.openxmlformats.schemas.drawingml.x2006.main.STPenAlignment;\r
import org.openxmlformats.schemas.drawingml.x2006.main.STPresetLineDashVal;\r
+import org.openxmlformats.schemas.drawingml.x2006.main.STTextAnchoringType;\r
\r
/**\r
* Represents a cell of a table in a .pptx presentation\r
void setVMerge(boolean merge_) {\r
getXmlObject().setVMerge(merge_);\r
}\r
+ \r
+ @Override\r
+ public void setVerticalAlignment(VerticalAlignment anchor){\r
+ CTTableCellProperties cellProps = getXmlObject().getTcPr();\r
+ if(cellProps != null) {\r
+ if(anchor == null) {\r
+ if(cellProps.isSetAnchor()) {\r
+ cellProps.unsetAnchor();\r
+ }\r
+ } else {\r
+ cellProps.setAnchor(STTextAnchoringType.Enum.forInt(anchor.ordinal() + 1));\r
+ }\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public VerticalAlignment getVerticalAlignment(){\r
+ CTTableCellProperties cellProps = getXmlObject().getTcPr();\r
+\r
+ VerticalAlignment align = VerticalAlignment.TOP;\r
+ if(cellProps != null && cellProps.isSetAnchor()) {\r
+ int ival = cellProps.getAnchor().intValue();\r
+ align = VerticalAlignment.values()[ival - 1];\r
+ }\r
+ return align;\r
+ }\r
+\r
}\r
assertNull(cell1.getBorderRightColor());\r
cell1.setBorderRightColor(Color.yellow);\r
assertEquals(Color.yellow, cell1.getBorderRightColor());\r
+\r
+ assertEquals(VerticalAlignment.TOP, cell1.getVerticalAlignment());\r
+ cell1.setVerticalAlignment(VerticalAlignment.MIDDLE);\r
+ assertEquals(VerticalAlignment.MIDDLE, cell1.getVerticalAlignment());\r
+ cell1.setVerticalAlignment(null);\r
+ assertEquals(VerticalAlignment.TOP, cell1.getVerticalAlignment());\r
}\r
}
\ No newline at end of file