Fix for today's commits

This commit is contained in:
Georgy Litvinov 2020-01-22 21:39:16 +01:00
parent 00813f1aa7
commit 96940951ae
3 changed files with 6 additions and 5 deletions

View file

@ -266,6 +266,9 @@ public class DocumentSeparator {
} }
} }
protected Node closePage(Node hnode){ protected Node closePage(Node hnode){
if (pageOpened == false) {
return hnode;
}
hnode = exitPageContainer(hnode); hnode = exitPageContainer(hnode);
if (pageSeparation.equals(SECTIONS)){ if (pageSeparation.equals(SECTIONS)){
//If section is empty. In case we are closing section //If section is empty. In case we are closing section
@ -282,6 +285,9 @@ public class DocumentSeparator {
return hnode; return hnode;
} }
protected Node openPage(Node hnode, Integer pageNum){ protected Node openPage(Node hnode, Integer pageNum){
if (pageOpened == true) {
return hnode;
}
if (pageSeparation.equals(SECTIONS)){ if (pageSeparation.equals(SECTIONS)){
openPageComment(hnode, pageNum); openPageComment(hnode, pageNum);
pageOpened = true; pageOpened = true;
@ -296,7 +302,6 @@ public class DocumentSeparator {
} }
private Node exitPageContainer(Node hnode) { private Node exitPageContainer(Node hnode) {
String className = ((Element) hnode).getAttribute("class"); String className = ((Element) hnode).getAttribute("class");
if (!className.equals("pageContainer")) { if (!className.equals("pageContainer")) {
System.out.println("Can't exit not my container!"); System.out.println("Can't exit not my container!");
@ -311,7 +316,6 @@ public class DocumentSeparator {
} }
private Node enterPageContainer(Node hnode) { private Node enterPageContainer(Node hnode) {
if (hnode == null) { if (hnode == null) {
System.out.println("Enter page container error. hnode is null"); System.out.println("Enter page container error. hnode is null");
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) { for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
System.out.println(ste); System.out.println(ste);

View file

@ -138,8 +138,6 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
private void cssColumns(StyleWithProperties style, CSVList props, boolean bInherit) { private void cssColumns(StyleWithProperties style, CSVList props, boolean bInherit) {
String columnCount = style.getAbsoluteProperty(XMLString.FO_COLUMN_COUNT); String columnCount = style.getAbsoluteProperty(XMLString.FO_COLUMN_COUNT);
System.out.println("columnCount " + columnCount);
//System.out.println(style.);
} }
public void cssMargins(StyleWithProperties style, CSVList props, boolean bInherit){ public void cssMargins(StyleWithProperties style, CSVList props, boolean bInherit){

View file

@ -272,7 +272,6 @@ public class TextConverter extends ConverterHelper {
breakBeforeNextNode = false; breakBeforeNextNode = false;
while (i < nLen) { while (i < nLen) {
Node child = nList.item(i); Node child = nList.item(i);
if (child.getNodeType() == Node.ELEMENT_NODE) { if (child.getNodeType() == Node.ELEMENT_NODE) {
String nodeName = child.getNodeName(); String nodeName = child.getNodeName();
// Block splitting // Block splitting