diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java index 4fe095ded..c3d148b6e 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java @@ -284,8 +284,7 @@ public class XSSFCellStyle implements CellStyle { } public void setRotation(short rotation) { - // TODO Auto-generated method stub - + getCellAlignment().setTextRotation(rotation); } public void setTopBorderColor(short color) { @@ -302,8 +301,7 @@ public class XSSFCellStyle implements CellStyle { } public void setWrapText(boolean wrapped) { - // TODO Auto-generated method stub - + getCellAlignment().setWrapText(wrapped); } private XSSFCellBorder getCellBorder() { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java index 18656b61e..71a32d4df 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java @@ -63,7 +63,15 @@ public class XSSFCellAlignment { return cellAlignement.getTextRotation(); } + public void setTextRotation(long rotation) { + cellAlignement.setTextRotation(rotation); + } + public boolean getWrapText() { return cellAlignement.getWrapText(); } + + public void setWrapText(boolean wrapped) { + cellAlignement.setWrapText(wrapped); + } } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java index ef1bcf23a..378375f71 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java @@ -183,4 +183,12 @@ public class TestXSSFCellStyle extends TestCase { cellStyle.setVerticalAlignmentEnum(STVerticalAlignment.JUSTIFY); assertEquals((short)4, cellStyle.getVerticalAlignment()); } + + public void testGetSetWrapText() { + assertFalse(cellStyle.getWrapText()); + cellXf.getAlignment().setWrapText(true); + assertTrue(cellStyle.getWrapText()); + cellStyle.setWrapText(false); + assertFalse(cellXf.getAlignment().getWrapText()); + } }