Improved conditions in process breaks

This commit is contained in:
Georgy Litvinov 2021-03-13 18:58:07 +01:00
parent be7047683d
commit 37699b8b5a
2 changed files with 7 additions and 8 deletions

View file

@ -247,7 +247,7 @@ public class Separator {
/** /**
* Opens main document section heading tag * Opens main document section heading tag
*/ */
public Node startDocument(Node hnode, String title, int pageNum) { public Node startDocumentSeparation(Node hnode, String title, int pageNum) {
if (!greenstoneSeparation && !needPagination()) { if (!greenstoneSeparation && !needPagination()) {
return hnode; return hnode;
} }

View file

@ -1205,12 +1205,12 @@ public class TextParser extends Parser {
if (wasProcessedWithSection(currentNode, style)) { if (wasProcessedWithSection(currentNode, style)) {
return hnode; return hnode;
} }
boolean firstSeparation = (currentMasterPage == null) ;
if (currentMasterPage == null && style != null) { if (firstSeparation && style != null) {
//Document wasn't started yet.
hnode = startDocument(hnode, style); hnode = startDocument(hnode, style);
hnode = docSep.whatToDoWithOutlineNodeOnPage(currentNode, hnode, pageNum); }
} else if (isPageBreakFound(style)) {
if (isPageBreakFound(style) && !firstSeparation) {
if (hasBreakBefore(style)) { if (hasBreakBefore(style)) {
if (currentNode.getNodeName() == TEXT_SECTION) { if (currentNode.getNodeName() == TEXT_SECTION) {
@ -1337,11 +1337,10 @@ public class TextParser extends Parser {
} }
//Start tagging //Start tagging
String sTitle = converter.getTitle(); String sTitle = converter.getTitle();
hnode = docSep.startDocument(hnode, sTitle,pageNum); hnode = docSep.startDocumentSeparation(hnode, sTitle,pageNum);
//Print header //Print header
addHeader(hnode); addHeader(hnode);
//hnode = enterPageContainer(hnode);
return hnode; return hnode;
} }