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.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
import pro.litvinovg.xml.Debug;
|
||||||
import w2phtml.office.OfficeReader;
|
import w2phtml.office.OfficeReader;
|
||||||
|
|
||||||
public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
||||||
|
@ -40,10 +41,16 @@ public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
||||||
results.setDataMoved(true);
|
results.setDataMoved(true);
|
||||||
}
|
}
|
||||||
} else if (nodeName.equals(TEXT_LIST)) {
|
} else if (nodeName.equals(TEXT_LIST)) {
|
||||||
if (factory.split(cellChildNode).isDataMoved()){
|
SplitResults listSplitResults = factory.split(cellChildNode);
|
||||||
cellFirstPart.appendChild(cellChildNode.getPreviousSibling());
|
if (listSplitResults.isDataMoved()){
|
||||||
|
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||||
|
cellFirstPart.appendChild(listSplitResults.getFirstPart());
|
||||||
results.setDataMoved(true);
|
results.setDataMoved(true);
|
||||||
|
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||||
}
|
}
|
||||||
|
if (!cellChildNode.hasChildNodes()) {
|
||||||
|
cellNode.removeChild(cellChildNode);
|
||||||
|
}
|
||||||
} else if (nodeName.equals(TABLE_TABLE)) {
|
} else if (nodeName.equals(TABLE_TABLE)) {
|
||||||
if (factory.split(cellChildNode).isDataMoved()){
|
if (factory.split(cellChildNode).isDataMoved()){
|
||||||
cellFirstPart.appendChild(cellChildNode.getPreviousSibling());
|
cellFirstPart.appendChild(cellChildNode.getPreviousSibling());
|
||||||
|
@ -69,6 +76,8 @@ public class TableCellSplitter extends BasicSplitter implements ISplitter {
|
||||||
if (results.isDataMoved()) {
|
if (results.isDataMoved()) {
|
||||||
parent.insertBefore(cellFirstPart, cellNode);
|
parent.insertBefore(cellFirstPart, cellNode);
|
||||||
}
|
}
|
||||||
|
//Debug.prettyPrintXml(cellNode.getOwnerDocument());
|
||||||
|
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue