You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/04/06 06:41:00 UTC
[Bug 63624] XWPFTableCell.setText() returns empty when no paragraph
is created
https://bz.apache.org/bugzilla/show_bug.cgi?id=63624
iseletkov <is...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #3 from iseletkov <is...@gmail.com> ---
Method setText() does not add new paragraph to "paragraphs" list, while
getText() uses info from "paragraphs" only.
public void setText(String text) {
CTP ctP = (ctTc.sizeOfPArray() == 0) ? ctTc.addNewP() :
ctTc.getPArray(0);
XWPFParagraph par = new XWPFParagraph(ctP, this);
par.createRun().setText(text);
}
public String getText() {
StringBuilder text = new StringBuilder();
for (XWPFParagraph p : paragraphs) {
text.append(p.getText());
}
return text.toString();
}
I think new line is needed in line 433:
paragraphs.add(par);
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org