}
public void setText(String text) {
- CTP ctP = (ctTc.sizeOfPArray() == 0) ? ctTc.addNewP() : ctTc.getPArray(0);
- XWPFParagraph par = new XWPFParagraph(ctP, this);
+ XWPFParagraph par = (paragraphs.size() == 0) ? addParagraph() : paragraphs.get(0);
par.createRun().setText(text);
}
assertEquals(2500, cell.getWidth());
doc.close();
}
+
+ @Test
+ public void testBug63624() throws Exception {
+ XWPFDocument doc = new XWPFDocument();
+ XWPFTable table = doc.createTable(1, 1);
+ XWPFTableRow row = table.getRow(0);
+ XWPFTableCell cell = row.getCell(0);
+
+ String expected = "this must not be empty";
+ cell.setText(expected);
+ String actual = cell.getText();
+ assertEquals(expected, actual);
+ doc.close();
+ }
}