]> source.dussan.org Git - poi.git/commitdiff
XSSFCellAlignment get/setTextRotation + get/setWrapText + tests
authorPaolo Mottadelli <paolo@apache.org>
Sat, 5 Apr 2008 16:30:17 +0000 (16:30 +0000)
committerPaolo Mottadelli <paolo@apache.org>
Sat, 5 Apr 2008 16:30:17 +0000 (16:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@645131 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java

index 4fe095ded660e0b1821f76b92357488d6bb95731..c3d148b6ef81be56ec2e5a4c02a8a6563b5fab89 100644 (file)
@@ -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() {
index 18656b61e8a34e754e5fbf7edc8cad5de9e98dfa..71a32d4df32a15e16178c4eea33d312055eae43f 100644 (file)
@@ -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);
+       }
 }
index ef1bcf23a4969ce2d5d566649b7668bcce8d79b8..378375f7199f51b17554da8d6c9fb2d4139823fd 100644 (file)
@@ -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());
+       }
 }