Fixed lost heading sections
This commit is contained in:
parent
faee542d26
commit
acd74dee18
2 changed files with 31 additions and 37 deletions
|
@ -33,7 +33,6 @@ public class GreenstoneTags {
|
|||
//Get outline level
|
||||
String sLevel = Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL);
|
||||
if (sLevel == null || sLevel.isEmpty()) {
|
||||
System.out.println("Error occurred. Expected Outline level here!");
|
||||
return hnode;
|
||||
}
|
||||
int nLevel = Integer.parseInt(sLevel);
|
||||
|
|
|
@ -1581,44 +1581,39 @@ public class TextConverter extends ConverterHelper {
|
|||
}
|
||||
if (currentMasterPage == null && style != null) {
|
||||
hnode = StartMasterPage(hnode, style, newPageNumber);
|
||||
} else {
|
||||
//If old master page was defined
|
||||
|
||||
//If new master page definition found
|
||||
//Or if fo:break-before found
|
||||
//Or if soft-page-break or fo:break-after appeared before this node
|
||||
if (checkMasterPageBreak(style) || checkHardBreakBefore(style) || breakBeforeNextNode) {
|
||||
//Insert footnotes
|
||||
footCv.insertFootnotes(hnode, true);
|
||||
//Add previous MP footer
|
||||
addFooter(hnode);
|
||||
//Update MP
|
||||
updateMasterPage(style);
|
||||
//Set new page number if defined or increment if not
|
||||
if (newPageNumber != null) {
|
||||
pageNum = newPageNumber;
|
||||
} else {
|
||||
pageNum++;
|
||||
fitPageNumberToMasterPageStyle();
|
||||
}
|
||||
|
||||
if ( currentNode.getNodeType() == Node.ELEMENT_NODE
|
||||
&& Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL) != null
|
||||
&& !Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL).isEmpty()
|
||||
){
|
||||
hnode = GreenstoneTags.processHeading(currentNode, hnode, pageNum);
|
||||
} else {
|
||||
hnode = GreenstoneTags.processPageBreak(currentNode, hnode, pageNum);
|
||||
}
|
||||
|
||||
//Print new header
|
||||
addHeader(hnode);
|
||||
breakBeforeNextNode = false;
|
||||
return hnode;
|
||||
|
||||
} else if (checkMasterPageBreak(style) || checkHardBreakBefore(style) || breakBeforeNextNode) {
|
||||
// Insert footnotes
|
||||
footCv.insertFootnotes(hnode, true);
|
||||
// Add previous MP footer
|
||||
addFooter(hnode);
|
||||
// Update MP
|
||||
updateMasterPage(style);
|
||||
// Set new page number if defined or increment if not
|
||||
if (newPageNumber != null) {
|
||||
pageNum = newPageNumber;
|
||||
} else {
|
||||
pageNum++;
|
||||
fitPageNumberToMasterPageStyle();
|
||||
}
|
||||
|
||||
|
||||
if (currentNode.getNodeType() == Node.ELEMENT_NODE
|
||||
&& Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL) != null
|
||||
&& !Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL).isEmpty()) {
|
||||
hnode = GreenstoneTags.processHeading(currentNode, hnode, pageNum);
|
||||
} else {
|
||||
hnode = GreenstoneTags.processPageBreak(currentNode, hnode, pageNum);
|
||||
}
|
||||
|
||||
// Print new header
|
||||
addHeader(hnode);
|
||||
breakBeforeNextNode = false;
|
||||
return hnode;
|
||||
|
||||
} else {
|
||||
hnode = GreenstoneTags.processHeading(currentNode, hnode, pageNum);
|
||||
}
|
||||
|
||||
|
||||
//Create method to process Section -> Something -> Foo-break-before
|
||||
|
||||
/*currentNode.getNextSibling()
|
||||
|
|
Loading…
Add table
Reference in a new issue