Do not create ODF Section div in case creating Greenstone sections to split document later.

This commit is contained in:
Georgy Litvinov 2016-12-21 20:22:08 +03:00 committed by Georgy Litvinov
parent bf765cac21
commit 512850e280

View file

@ -474,7 +474,9 @@ public class TextConverter extends ConverterHelper {
String sName = Misc.getAttribute(onode,XMLString.TEXT_NAME);
String sStyleName = Misc.getAttribute(onode,XMLString.TEXT_STYLE_NAME);
////closePageSection
Element div = converter.createElement("div");
Element div = (Element) hnode;
if (headingTags == null) {
div = converter.createElement("div");
// close page before enter
hnode = GreenstoneTags.closePage(hnode);
@ -486,15 +488,20 @@ public class TextConverter extends ConverterHelper {
sections.push(onode);
//open page after enter
div = (Element) GreenstoneTags.openPage(div, pageNum);
}
Node newhnode = traverseBlockText(onode, div);
Node result = null;
if (headingTags == null) {
//close page before exit
newhnode = GreenstoneTags.closePage(newhnode);
Node result = newhnode.getParentNode();
result = newhnode.getParentNode();
//Open page after exit
result = (Element) GreenstoneTags.openPage(result, pageNum);
sections.pop();
} else {
result = newhnode;
}
return result;
}