java - Apache POI PPTX - 如何克隆表中的一行
问题描述
我正在尝试添加以下代码来克隆现有行,但新行有单元格,但文本段落的大小显示为 0。
private XSLFTableRow cloneRow(XSLFTableRow templateRow , XSLFTable tble) {
XSLFTableRow nwRow = tble.addRow();
for (int c = 0; c < templateRow.getCells().size(); c++) {
nwRow.addCell();
// nwRow.getCells().get(c).getXmlObject().set(templateRow.getCells().get(c).getXmlObject());
}
nwRow.getXmlObject().set(templateRow.getXmlObject().copy());
System.out.println("in new row");
for(XSLFTableCell tc : nwRow.getCells()) {
System.out.println(tc.getTextParagraphs().size());
}
return nwRow;
}
解决方案
推荐阅读
- terraform - 尽管声明了 Terraform,但未显示输出
- adobe-illustrator - 多个用户打开同一个文件并覆盖工作
- sqlite - 如何获取 ATTACHED 数据库的当前 sqlite 数据库大小
- angular - Observables Angular 6
- boost - BOOST_DATA_TEST_CASE 的自定义名称
- android-studio - java.lang.NumberFormatException:对于输入字符串:kotlin 中的“16000$”
- laravel - Laravel 存储方法 allDirectories() 不会从 FTP 服务器递归返回目录
- python - 为什么 randn 并不总是具有 0 的均值和 1 的方差?
- azure-devops - 我应该多久部署一次基础架构即代码 (IaC)
- intellij-idea - PhpStorm 中的格式化代码不起作用,因为我需要它才能工作