]> source.dussan.org Git - poi.git/commitdiff
fixed bug #46033: table cells had incorrect text type resulting in corrupted style...
authorYegor Kozlov <yegor@apache.org>
Mon, 3 Nov 2008 19:19:39 +0000 (19:19 +0000)
committerYegor Kozlov <yegor@apache.org>
Mon, 3 Nov 2008 19:19:39 +0000 (19:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@710134 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java

index 7fa69b1d0c2a31c8fdc92e19dc944405b1de8925..71833678a51a7daf8d78a563811f49e2fac862e7 100755 (executable)
@@ -56,8 +56,8 @@ public class TableCell extends TextBox {
         super(parent);\r
 \r
         setShapeType(ShapeTypes.Rectangle);\r
-        _txtrun.setRunType(TextHeaderAtom.HALF_BODY_TYPE);\r
-        _txtrun.getRichTextRuns()[0].setFlag(false, 0, false);\r
+        //_txtrun.setRunType(TextHeaderAtom.HALF_BODY_TYPE);\r
+        //_txtrun.getRichTextRuns()[0].setFlag(false, 0, false);\r
     }\r
 \r
     protected EscherContainerRecord createSpContainer(boolean isChild){\r
index 7202ff345fe76a67afdbce372769cf7bff22f82a..8a9cf7da27a36dea4e2e6b09e3b7b93aeed3e320 100755 (executable)
@@ -24,6 +24,7 @@ import java.awt.geom.Rectangle2D;
 \r
 import org.apache.poi.hslf.usermodel.SlideShow;\r
 import org.apache.poi.hslf.HSLFSlideShow;\r
+import org.apache.poi.hslf.record.TextHeaderAtom;\r
 \r
 /**\r
  * Test <code>Table</code> object.\r
@@ -43,6 +44,10 @@ public class TestTable extends TestCase {
         Table tbl = new Table(2, 5);\r
         slide.addShape(tbl);\r
 \r
+        TableCell cell = tbl.getCell(0, 0);\r
+        //table cells have type=TextHeaderAtom.OTHER_TYPE, see bug #46033\r
+        assertEquals(TextHeaderAtom.OTHER_TYPE, cell.getTextRun().getRunType());\r
+\r
         assertTrue(slide.getShapes()[0] instanceof Table);\r
         Table tbl2 = (Table)slide.getShapes()[0];\r
         assertEquals(tbl.getNumberOfColumns(), tbl2.getNumberOfColumns());\r