Fix for prev commit

This commit is contained in:
Georgy Litvinov 2020-07-24 21:52:49 +02:00
parent 759d3302e7
commit ce0a5d5df9
2 changed files with 28 additions and 26 deletions

View file

@ -10,6 +10,7 @@ import org.w3c.dom.Element;
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 ListSplitter extends BasicSplitter implements ISplitter { public class ListSplitter extends BasicSplitter implements ISplitter {
@ -56,10 +57,8 @@ public class ListSplitter extends BasicSplitter implements ISplitter {
list.removeChild(child); list.removeChild(child);
} }
} }
//Add text:continue-numbering="true" // Debug.printNode(child);
if (dataMoved){
((Element) list).setAttribute(TEXT_CONTINUE_NUMBERING, "true");
}
break; break;
} else { } else {
// Not with SPB yet, move node, set dataMoved=true // Not with SPB yet, move node, set dataMoved=true
@ -73,6 +72,7 @@ public class ListSplitter extends BasicSplitter implements ISplitter {
} }
} }
if (dataMoved) { if (dataMoved) {
((Element) list).setAttribute(TEXT_CONTINUE_NUMBERING, "true");
parent.insertBefore(listFirstPart, list); parent.insertBefore(listFirstPart, list);
parent.insertBefore(softPageBreak, list); parent.insertBefore(softPageBreak, list);
if (hangingItem != null) { if (hangingItem != null) {
@ -85,6 +85,9 @@ public class ListSplitter extends BasicSplitter implements ISplitter {
list.removeChild(hangingItem); list.removeChild(hangingItem);
} }
} else {
//If SPB right before list items
parent.insertBefore(softPageBreak, list);
} }
return dataMoved; return dataMoved;

View file

@ -17,7 +17,6 @@ public class SplitFactory {
System.exit(1); System.exit(1);
} }
String nodeName = node.getNodeName(); String nodeName = node.getNodeName();
System.out.println(nodeName);
ISplitter splitter = null; ISplitter splitter = null;
if (nodeName.contentEquals(TEXT_SPAN)) { if (nodeName.contentEquals(TEXT_SPAN)) {
splitter = new SpanSplitter(officeReader, this); splitter = new SpanSplitter(officeReader, this);