diff --git a/source/java/writer2latex/xhtml/TextConverter.java b/source/java/writer2latex/xhtml/TextConverter.java index 9113a26..fecaf35 100644 --- a/source/java/writer2latex/xhtml/TextConverter.java +++ b/source/java/writer2latex/xhtml/TextConverter.java @@ -109,6 +109,7 @@ public class TextConverter extends ConverterHelper { private String headingTags = config.getHeadingTags(); private String pageTags = config.getPageTags(); private boolean breakBeforeNextNode = false; + private boolean inTable = false; public TextConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) { super(ofr,config,converter); @@ -252,7 +253,7 @@ public class TextConverter extends ConverterHelper { String nodeName = child.getNodeName(); // Block splitting nDontSplitLevel++; - + if (OfficeReader.isDrawElement(child)) { getDrawCv().handleDrawElement((Element)child,(Element)hnode,null,nFloatMode); } @@ -332,7 +333,9 @@ public class TextConverter extends ConverterHelper { StyleWithProperties style = ofr.getTableStyle(Misc.getAttribute(child, XMLString.TABLE_STYLE_NAME)); hnode = processPageBreaks(child, hnode,style); hnode = maybeSplit(hnode,style); + inTable = true; getTableCv().handleTable(child,hnode); + inTable = false; } else if (nodeName.equals(XMLString.TABLE_SUB_TABLE)) { getTableCv().handleTable(child,hnode); @@ -1607,6 +1610,16 @@ public class TextConverter extends ConverterHelper { Misc.getPosInteger(node.getAttribute(XMLString.TEXT_LEVEL),1); } private Node processPageBreaks(Node currentNode, Node hnode,StyleWithProperties style){ + //Check for paragraph in current node in case currentNode is table + // If currentNode is table + //check for first para inside + // Check it's master page, pageNumber, Page break before - if we already set MP - throw it away + // And make a note to pass this paragraph next time you'll meet it. + if (inTable){ + return hnode; + } + + Integer newPageNumber = null; if (style != null) { // If style:paragraph-properties extists and contain