Fix splitting lists in table cell
This commit is contained in:
parent
89f2807f4e
commit
17bf5a9259
1 changed files with 11 additions and 2 deletions
|
@ -9,6 +9,7 @@ import static w2phtml.office.XMLString.TEXT_SOFT_PAGE_BREAK;
|
|||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import pro.litvinovg.xml.Debug;
|
||||
import w2phtml.office.OfficeReader;
|
||||
|
||||
public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
||||
|
@ -40,10 +41,16 @@ public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
|||
results.setDataMoved(true);
|
||||
}
|
||||
} else if (nodeName.equals(TEXT_LIST)) {
|
||||
if (factory.split(cellChildNode).isDataMoved()){
|
||||
cellFirstPart.appendChild(cellChildNode.getPreviousSibling());
|
||||
SplitResults listSplitResults = factory.split(cellChildNode);
|
||||
if (listSplitResults.isDataMoved()){
|
||||
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||
cellFirstPart.appendChild(listSplitResults.getFirstPart());
|
||||
results.setDataMoved(true);
|
||||
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||
}
|
||||
if (!cellChildNode.hasChildNodes()) {
|
||||
cellNode.removeChild(cellChildNode);
|
||||
}
|
||||
} else if (nodeName.equals(TABLE_TABLE)) {
|
||||
if (factory.split(cellChildNode).isDataMoved()){
|
||||
cellFirstPart.appendChild(cellChildNode.getPreviousSibling());
|
||||
|
@ -69,6 +76,8 @@ public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
|||
if (results.isDataMoved()) {
|
||||
parent.insertBefore(cellFirstPart, cellNode);
|
||||
}
|
||||
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue