Added logic for left and right side headers and footers

This commit is contained in:
Georgy Litvinov 2019-04-14 15:01:54 +03:00
parent b336e22ca1
commit 1bf31d5358

View file

@ -1854,12 +1854,16 @@ public class TextConverter extends ConverterHelper {
}
private Node addHeader(Node node) {
Node headerNode = null;
inHeader = true;
MasterPage masterPage = ofr.getFullMasterPage(currentMasterPage);
if (currentMasterPage != null) {
Node headerNode = masterPage.getHeader();
if (pageNum % 2 == 0) {
headerNode = masterPage.getHeaderLeft();
}
if (headerNode == null) {
headerNode = masterPage.getHeader();
}
if (headerNode != null) {
//Create header element
Element headerElement = converter.createElement("header");
@ -1874,12 +1878,16 @@ public class TextConverter extends ConverterHelper {
}
private Node addFooter(Node node) {
Node footerNode = null;
inFooter = true;
MasterPage masterPage = ofr.getFullMasterPage(currentMasterPage);
if (currentMasterPage != null) {
Node footerNode = masterPage.getFooter();
if (pageNum % 2 == 0) {
footerNode = masterPage.getFooterLeft();
}
if (footerNode == null) {
footerNode = masterPage.getFooter();
}
if (footerNode != null) {
//Create footer element
Element footerElement = converter.createElement("footer");