From d7d4b4083ee876133317248e68f9f098d882c7ad Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 12 Mar 2021 20:45:25 +0100 Subject: [PATCH] Don't create new SPB in List splitter --- src/main/java/w2phtml/pageSplitters/ListSplitter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/w2phtml/pageSplitters/ListSplitter.java b/src/main/java/w2phtml/pageSplitters/ListSplitter.java index 1e77336..bd80e16 100644 --- a/src/main/java/w2phtml/pageSplitters/ListSplitter.java +++ b/src/main/java/w2phtml/pageSplitters/ListSplitter.java @@ -25,7 +25,7 @@ public class ListSplitter extends BasicSplitter implements ISplitter { public SplitResults Split(Node list) { Node parent = list.getParentNode(); // System.out.println("----Start ListSplitter------"); - // Debug.prettyPrintXml(parent); + //Debug.prettyPrintXml(list.getOwnerDocument()); Node listFirstPart = list.cloneNode(false); NodeList listNodes = list.getChildNodes(); Document document = list.getOwnerDocument(); @@ -76,14 +76,16 @@ public class ListSplitter extends BasicSplitter implements ISplitter { } } if (results.isDataMoved()) { + //Debug.prettyPrintXml(list.getOwnerDocument()); ((Element) list).setAttribute(TEXT_CONTINUE_NUMBERING, "true"); parent.insertBefore(listFirstPart, list); - parent.insertBefore(softPageBreak, list); + //parent.insertBefore(softPageBreak, list); results.setSPB(softPageBreak); // System.out.println("LIST FIRST PART"); // Debug.printNode(listFirstPart); // TODO: Create dummy list style to override list item to not teleport // second part but making it list item without list mark + //Debug.prettyPrintXml(list.getOwnerDocument()); if (nextPageItemPart != null) { Node nextPageFirstNode = nextPageItemPart.getFirstChild(); @@ -97,9 +99,11 @@ public class ListSplitter extends BasicSplitter implements ISplitter { } parent.insertBefore(freeNode, list); } + //Debug.prettyPrintXml(list.getOwnerDocument()); if (!nextPageItemPart.hasChildNodes()) { list.removeChild(nextPageItemPart); } + //Debug.prettyPrintXml(list.getOwnerDocument()); } } else { @@ -108,8 +112,7 @@ public class ListSplitter extends BasicSplitter implements ISplitter { } // System.out.println("----Finish ListSplitter------"); - // Debug.prettyPrintXml(parent); - + //Debug.prettyPrintXml(list.getOwnerDocument()); return results; }