diff --git a/src/main/java/writer2latex/xhtml/Converter.java b/src/main/java/writer2latex/xhtml/Converter.java index 0d8fd3b..9019ca3 100644 --- a/src/main/java/writer2latex/xhtml/Converter.java +++ b/src/main/java/writer2latex/xhtml/Converter.java @@ -301,7 +301,7 @@ public class Converter extends BasicConverter { Element body = ofr.getContent(); if (ofr.isSpreadsheet()) { tableParser.convertTableContent(body); } else if (ofr.isPresentation()) { drawParser.convertDrawContent(body); } - else { textParser.convertTextContent(body); } + else { textParser.convertDocumentContent(body); } // Set the title page and text page entries if (converterResult.getContent().isEmpty()) { diff --git a/src/main/java/writer2latex/xhtml/content/TextParser.java b/src/main/java/writer2latex/xhtml/content/TextParser.java index 23b5729..807f924 100644 --- a/src/main/java/writer2latex/xhtml/content/TextParser.java +++ b/src/main/java/writer2latex/xhtml/content/TextParser.java @@ -67,7 +67,7 @@ public class TextParser extends Parser { private int nPageBreakSplit = XhtmlConfig.NONE; // Should we split at page breaks? // TODO: Collect soft page breaks between table rows private boolean bPendingPageBreak = false; // We have encountered a page break which should be inserted asap - private int nSplit = 0; // The outline level at which to split files (0=no split) + private int splitResultsLevel = 0; // The outline level at which to split files (0=no split) private int nRepeatLevels = 5; // The number of levels to repeat when splitting (0=no repeat) private int nLastSplitLevel = 1; // The outline level at which the last split occurred private int nDontSplitLevel = 0; // if > 0 splitting is forbidden @@ -89,7 +89,7 @@ public class TextParser extends Parser { private int nFloatMode; // Converter helpers used to handle all sorts of indexes - private TOCParser tocCv; + private TOCParser tocParser; private LOFParser lofCv; private LOTParser lotCv; private AlphabeticalIndexParser indexCv; @@ -132,7 +132,7 @@ public class TextParser extends Parser { public TextParser(OfficeReader ofr, XhtmlConfig config, Converter converter) { super(ofr,config,converter); - tocCv = new TOCParser(ofr, config, converter); + tocParser = new TOCParser(ofr, config, converter); lofCv = new LOFParser(ofr, config, converter); lotCv = new LOTParser(ofr, config, converter); bibCv = new BibliographyParser(ofr, config, converter); @@ -141,7 +141,7 @@ public class TextParser extends Parser { endCv = new EndnoteParser(ofr, config, converter); nSplitAfter = 1000*config.splitAfter(); nPageBreakSplit = config.pageBreakSplit(); - nSplit = config.getXhtmlSplitLevel(); + splitResultsLevel = config.getXhtmlSplitLevel(); nRepeatLevels = converter.isOPS() ? 0 : config.getXhtmlRepeatLevels(); // never repeat headings in EPUB nFloatMode = ofr.isText() && config.xhtmlFloatObjects() ? DrawParser.FLOATING : DrawParser.ABSOLUTE; @@ -156,11 +156,11 @@ public class TextParser extends Parser { * * @param onode the Office node containing the content to convert */ - public void convertTextContent(Element onode) { + public void convertDocumentContent(Element onode) { Element hnode = converter.nextOutFile(); // Create form - if (nSplit==0) { + if (splitResultsLevel==0) { Element form = getDrawCv().createForm(); if (form!=null) { hnode.appendChild(form); @@ -191,14 +191,14 @@ public class TextParser extends Parser { hnode = (Element) docSep.endDocument(hnode); // Generate all indexes bInToc = true; - tocCv.generate(); + tocParser.generate(); bInToc = false; // Generate navigation links generateHeaders(); generateFooters(); bInToc = true; - tocCv.generatePanels(nSplit); + tocParser.generatePanels(splitResultsLevel); bInToc = false; } @@ -245,7 +245,7 @@ public class TextParser extends Parser { return; } - public int getTocIndex() { return tocCv.getFileIndex(); } + public int getTocIndex() { return tocParser.getFileIndex(); } public int getAlphabeticalIndex() { return indexCv.getFileIndex(); } @@ -418,7 +418,7 @@ public class TextParser extends Parser { if (!ofr.getTocReader((Element)child).isByChapter()) { // hnode = maybeSplit(hnode,null,1); } - tocCv.handleIndex((Element)child,(Element)hnode); + tocParser.handleIndex((Element)child,(Element)hnode); } else if (nodeName.equals(TEXT_ILLUSTRATION_INDEX)) { lofCv.handleLOF(child,hnode); @@ -524,7 +524,7 @@ public class TextParser extends Parser { // TODO: Something wrong here....nLastSplitLevel is never set??? return (Element) node; } - if (nSplit>=nLevel && converter.outFileHasContent()) { + if (splitResultsLevel>=nLevel && converter.outFileHasContent()) { // No objections, this is a level that causes splitting nCharacterCount = 0; bPendingPageBreak = false; @@ -660,7 +660,7 @@ public class TextParser extends Parser { // Export the heading if (!bTocOnly) { // If split output, add headings of higher levels - if (bAfterSplit && nSplit > 0) { + if (bAfterSplit && splitResultsLevel > 0) { int nFirst = nLevel - nRepeatLevels; if (nFirst < 0) { nFirst = 0; @@ -702,7 +702,7 @@ public class TextParser extends Parser { // Add to toc if (!bInToc) { - tocCv.handleHeading(onode, heading, sLabel); + tocParser.handleHeading(onode, heading, sLabel); } // Convert content @@ -726,7 +726,7 @@ public class TextParser extends Parser { } } else { if (!bInToc) { - tocCv.handleHeadingExternal(onode, hnode, sLabel); + tocParser.handleHeadingExternal(onode, hnode, sLabel); } // Keep track of current headings for split output currentHeading[nLevel] = null; @@ -764,7 +764,7 @@ public class TextParser extends Parser { } // Maybe add to toc - tocCv.handleParagraph((Element)onode, par, sCurrentListLabel); + tocParser.handleParagraph((Element)onode, par, sCurrentListLabel); if (!bIsEmpty) { par = createTextBackground(par, styleName); @@ -1350,10 +1350,10 @@ public class TextParser extends Parser { if (!bInToc) { indexCv.handleIndexMarkStart(child,hnode); } } else if (sName.equals(TEXT_TOC_MARK)) { - tocCv.handleTocMark(child,hnode); + tocParser.handleTocMark(child,hnode); } else if (sName.equals(TEXT_TOC_MARK_START)) { - tocCv.handleTocMark(child,hnode); + tocParser.handleTocMark(child,hnode); } else if (sName.equals(TEXT_BIBLIOGRAPHY_MARK)) { handleBibliographyMark(child,hnode);