diff --git a/src/main/java/writer2latex/xhtml/Converter.java b/src/main/java/writer2latex/xhtml/Converter.java index 10c8397..aeb016e 100644 --- a/src/main/java/writer2latex/xhtml/Converter.java +++ b/src/main/java/writer2latex/xhtml/Converter.java @@ -298,7 +298,7 @@ public class Converter extends BasicConverter { } // Set the main content width - pushContentWidth(getStylesParser().getPageSc().getTextWidth()); + pushContentWidth(getStylesParser().getPageSP().getTextWidth()); // Traverse the body Element body = ofr.getContent(); @@ -640,8 +640,8 @@ public class Converter extends BasicConverter { private void applyWritingDirection() { StyleInfo pageInfo = new StyleInfo(); - styles.getPageSc().applyDefaultWritingDirection(pageInfo); - styles.getPageSc().writeStyle(pageInfo, htmlDoc.getContentNode()); + styles.getPageSP().applyDefaultWritingDirection(pageInfo); + styles.getPageSP().writeStyle(pageInfo, htmlDoc.getContentNode()); } diff --git a/src/main/java/writer2latex/xhtml/Parser.java b/src/main/java/writer2latex/xhtml/Parser.java index bdc8728..dd60138 100644 --- a/src/main/java/writer2latex/xhtml/Parser.java +++ b/src/main/java/writer2latex/xhtml/Parser.java @@ -75,34 +75,34 @@ public class Parser { protected ParStyleParser getParSP() { return converter.getStylesParser().getParSP(); } - protected HeadingStyleParser getHeadingSc() { return converter.getStylesParser().getHeadingSc(); } + protected HeadingStyleParser getHeadingSP() { return converter.getStylesParser().getHeadingSP(); } - protected ListStyleParser getListSc() { return converter.getStylesParser().getListSc(); } + protected ListStyleParser getListSP() { return converter.getStylesParser().getListSP(); } - protected SectionStyleParser getSectionSc() { return converter.getStylesParser().getSectionSc(); } + protected SectionStyleParser getSectionSP() { return converter.getStylesParser().getSectionSP(); } - protected TableStyleParser getTableSc() { return converter.getStylesParser().getTableSc(); } + protected TableStyleParser getTableSP() { return converter.getStylesParser().getTableSP(); } - protected RowStyleParser getRowSc() { return converter.getStylesParser().getRowSc(); } + protected RowStyleParser getRowSP() { return converter.getStylesParser().getRowSP(); } - protected CellStyleParser getCellSc() { return converter.getStylesParser().getCellSc(); } + protected CellStyleParser getCellSP() { return converter.getStylesParser().getCellSP(); } - protected FrameStyleParser getFrameSc() { return converter.getStylesParser().getFrameSc(); } + protected FrameStyleParser getFrameSP() { return converter.getStylesParser().getFrameSP(); } - protected PresentationStyleParser getPresentationSc() { return converter.getStylesParser().getPresentationSc(); } + protected PresentationStyleParser getPresentationSP() { return converter.getStylesParser().getPresentationSP(); } - protected PageStyleParser getPageSc() { return converter.getStylesParser().getPageSc(); } + protected PageStyleParser getPageSP() { return converter.getStylesParser().getPageSP(); } - protected TextParser getTextCv() { return converter.getTextParser(); } + protected TextParser getTextParser() { return converter.getTextParser(); } protected ListParser getListParser() { return converter.getListParser(); } - protected TableParser getTableCv() { return converter.getTableParser(); } + protected TableParser getTableParser() { return converter.getTableParser(); } - protected DrawParser getDrawCv() { return converter.getDrawParser(); } + protected DrawParser getDrawParser() { return converter.getDrawParser(); } - protected MathParser getMathCv() { return converter.getMathParser(); } + protected MathParser getMathParser() { return converter.getMathParser(); } /** Apply style information to an XHTML node * diff --git a/src/main/java/writer2latex/xhtml/content/AlphabeticalIndexParser.java b/src/main/java/writer2latex/xhtml/content/AlphabeticalIndexParser.java index 45bc416..9c28ab3 100644 --- a/src/main/java/writer2latex/xhtml/content/AlphabeticalIndexParser.java +++ b/src/main/java/writer2latex/xhtml/content/AlphabeticalIndexParser.java @@ -112,7 +112,7 @@ class AlphabeticalIndexParser extends IndexParser { AlphabeticalEntry entry = index.get(i); Element li = converter.createElement("li"); container.appendChild(li); - Element p = getTextCv().createParagraph(li,sEntryStyleName); + Element p = getTextParser().createParagraph(li,sEntryStyleName); Element a = converter.createLink("idx"+entry.nIndex); p.appendChild(a); a.appendChild(converter.createTextNode(entry.sWord)); diff --git a/src/main/java/writer2latex/xhtml/content/DrawParser.java b/src/main/java/writer2latex/xhtml/content/DrawParser.java index 7c126c5..632f14b 100644 --- a/src/main/java/writer2latex/xhtml/content/DrawParser.java +++ b/src/main/java/writer2latex/xhtml/content/DrawParser.java @@ -165,7 +165,7 @@ public class DrawParser extends Parser { // Style it (TODO: Apply hard drawing-page (background) style) StyleInfo info = new StyleInfo(); - getPageSc().applyStyle(onode.getAttribute(XMLString.DRAW_MASTER_PAGE_NAME),info); + getPageSP().applyStyle(onode.getAttribute(XMLString.DRAW_MASTER_PAGE_NAME),info); info.props.addProperty("top","40px"); // Somewhat arbitrary info.props.addProperty("left","0"); info.props.addProperty("position","absolute"); @@ -336,7 +336,7 @@ public class DrawParser extends Parser { } else if (sName.equals(XMLString.DRAW_FRAME)) { // First check for TexMaths equation - if (!getMathCv().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) { + if (!getMathParser().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) { // OpenDocument embeds the draw element in a frame element handleDrawElement(Misc.getFirstChildElement(onode),hnodeBlock,hnodeInline,nMode); @@ -344,7 +344,7 @@ public class DrawParser extends Parser { } else if (sName.equals(XMLString.DRAW_G)) { // First check for TexMaths equation - if (!getMathCv().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) { + if (!getMathParser().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) { handleDrawGroup(onode,hnodeBlock,hnodeInline,nMode); } } @@ -386,7 +386,7 @@ public class DrawParser extends Parser { } try { hnode.appendChild(converter.createTextNode(" ")); - getMathCv().convert(replacementImage,xmlObject.getContentDOM().getDocumentElement(),hnode,bNoTextPar); + getMathParser().convert(replacementImage,xmlObject.getContentDOM().getDocumentElement(),hnode,bNoTextPar); Node convertedMath = hnode.getLastChild(); applySettings(settings, convertedMath); @@ -429,7 +429,7 @@ public class DrawParser extends Parser { replacementImage = Misc.getChildByTagName(getFrame(onode),XMLString.DRAW_IMAGE); } hnode.appendChild(converter.createTextNode(" ")); - getMathCv().convert(replacementImage,formula,hnode,bNoTextPar); + getMathParser().convert(replacementImage,formula,hnode,bNoTextPar); hnode.appendChild(converter.createTextNode(" ")); } else { // unsupported object @@ -622,7 +622,7 @@ public class DrawParser extends Parser { // Now style it StyleInfo info = new StyleInfo(); String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME); - if (nMode!=FULL_SCREEN) { getFrameSc().readStyle(sStyleName,info); } + if (nMode!=FULL_SCREEN) { getFrameSP().readStyle(sStyleName,info); } applyImageSize(frame,info.props,nMode,false); // Apply placement @@ -652,15 +652,15 @@ public class DrawParser extends Parser { // Draw frame style String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME); if (sStyleName!=null) { - getFrameSc().readStyle(sStyleName,info); + getFrameSP().readStyle(sStyleName,info); } // Presentation frame style String sPresentationStyleName = Misc.getAttribute(frame, XMLString.PRESENTATION_STYLE_NAME); if (sPresentationStyleName!=null) { if ("outline".equals(Misc.getAttribute(frame, XMLString.PRESENTATION_CLASS))) { - getPresentationSc().enterOutline(sPresentationStyleName); + getPresentationSP().enterOutline(sPresentationStyleName); } - getPresentationSc().readStyle(sPresentationStyleName,info); + getPresentationSP().readStyle(sPresentationStyleName,info); } // Additional text formatting String sTextStyleName = Misc.getAttribute(frame, XMLString.DRAW_TEXT_STYLE_NAME); @@ -732,11 +732,11 @@ public class DrawParser extends Parser { if (sContentWidth!=null) { converter.pushContentWidth(sContentWidth); } - getTextCv().traverseBlockText(onode,textbox); + getTextParser().traverseBlockText(onode,textbox); if (sContentWidth!=null) { converter.popContentWidth(); } - getPresentationSc().exitOutline(); + getPresentationSP().exitOutline(); } private void handleDrawGroup(Element onode, Element hnodeBlock, Element hnodeInline, int nMode) { @@ -803,7 +803,7 @@ public class DrawParser extends Parser { if (hcontrol!=null) { Element frame = onode; // controls are *not* contained in a draw:frame! StyleInfo info = new StyleInfo(); - getFrameSc().readStyle(frame.getAttribute(XMLString.DRAW_STYLE_NAME),info); + getFrameSP().readStyle(frame.getAttribute(XMLString.DRAW_STYLE_NAME),info); applySize(frame,info.props,false); applyPlacement(frame,hnodeBlock,hnodeInline,nMode,hcontrol,info); writeStyle(info,hcontrol); @@ -1023,11 +1023,11 @@ public class DrawParser extends Parser { if (s!=null) sWidth = Calc.sub(sWidth, Calc.multiply("200%", s)); // Subtract border s = style.getProperty(XMLString.FO_BORDER_LEFT); - if (s!=null) sWidth = Calc.sub(sWidth, getTableCv().borderWidth(s)); + if (s!=null) sWidth = Calc.sub(sWidth, getTableParser().borderWidth(s)); s = style.getProperty(XMLString.FO_BORDER_RIGHT); - if (s!=null) sWidth = Calc.sub(sWidth, getTableCv().borderWidth(s)); + if (s!=null) sWidth = Calc.sub(sWidth, getTableParser().borderWidth(s)); s = style.getProperty(XMLString.FO_BORDER); - if (s!=null) sWidth = Calc.sub(sWidth, Calc.multiply("200%", getTableCv().borderWidth(s))); + if (s!=null) sWidth = Calc.sub(sWidth, Calc.multiply("200%", getTableParser().borderWidth(s))); } return sWidth; } @@ -1048,11 +1048,11 @@ public class DrawParser extends Parser { if (s!=null) sHeight = Calc.sub(sHeight, Calc.multiply("200%", s)); // Subtract border s = style.getProperty(XMLString.FO_BORDER_TOP); - if (s!=null) sHeight = Calc.sub(sHeight, getTableCv().borderWidth(s)); + if (s!=null) sHeight = Calc.sub(sHeight, getTableParser().borderWidth(s)); s = style.getProperty(XMLString.FO_BORDER_BOTTOM); - if (s!=null) sHeight = Calc.sub(sHeight, getTableCv().borderWidth(s)); + if (s!=null) sHeight = Calc.sub(sHeight, getTableParser().borderWidth(s)); s = style.getProperty(XMLString.FO_BORDER); - if (s!=null) sHeight = Calc.sub(sHeight, Calc.multiply("200%", getTableCv().borderWidth(s))); + if (s!=null) sHeight = Calc.sub(sHeight, Calc.multiply("200%", getTableParser().borderWidth(s))); } return sHeight; } diff --git a/src/main/java/writer2latex/xhtml/content/FootnoteParser.java b/src/main/java/writer2latex/xhtml/content/FootnoteParser.java index 11e40ca..4891e28 100644 --- a/src/main/java/writer2latex/xhtml/content/FootnoteParser.java +++ b/src/main/java/writer2latex/xhtml/content/FootnoteParser.java @@ -61,8 +61,8 @@ class FootnoteParser extends NoteParser { // Add footnote rule Element rule = converter.createElement("hr"); StyleInfo info = new StyleInfo(); - getPageSc().applyFootnoteRuleStyle(info); - getPageSc().writeStyle(info, rule); + getPageSP().applyFootnoteRuleStyle(info); + getPageSP().writeStyle(info, rule); sectionElement.appendChild(rule); flushAllNotes(sectionElement,"footnote"); diff --git a/src/main/java/writer2latex/xhtml/content/IndexParser.java b/src/main/java/writer2latex/xhtml/content/IndexParser.java index c822555..35c04c4 100644 --- a/src/main/java/writer2latex/xhtml/content/IndexParser.java +++ b/src/main/java/writer2latex/xhtml/content/IndexParser.java @@ -95,7 +95,7 @@ abstract class IndexParser extends Parser { String sStyleName = source.getAttribute(XMLString.TEXT_STYLE_NAME); if (sStyleName!=null) { StyleInfo sectionInfo = new StyleInfo(); - getSectionSc().readStyle(sStyleName,sectionInfo); + getSectionSP().readStyle(sStyleName,sectionInfo); writeStyle(sectionInfo,container); } return container; @@ -110,9 +110,9 @@ abstract class IndexParser extends Parser { String sStyleName = Misc.getAttribute(title,XMLString.TEXT_STYLE_NAME); StyleInfo info = new StyleInfo(); info.sTagName = "h1"; - getHeadingSc().applyStyle(1, sStyleName, info); + getHeadingSP().applyStyle(1, sStyleName, info); writeStyle(info,h1); - getTextCv().traversePCDATA(title,h1); + getTextParser().traversePCDATA(title,h1); } } diff --git a/src/main/java/writer2latex/xhtml/content/ListParser.java b/src/main/java/writer2latex/xhtml/content/ListParser.java index d4c00a5..7859907 100644 --- a/src/main/java/writer2latex/xhtml/content/ListParser.java +++ b/src/main/java/writer2latex/xhtml/content/ListParser.java @@ -104,8 +104,8 @@ public class ListParser extends Parser { // add an OL element Element list = converter.createElement("ol"); StyleInfo listInfo = new StyleInfo(); - getListSc().applyStyle(nLevel,sStyleName,listInfo); - getListSc().readParentStyle(nLevel, sStyleName, listInfo); + getListSP().applyStyle(nLevel,sStyleName,listInfo); + getListSP().readParentStyle(nLevel, sStyleName, listInfo); writeStyle(listInfo,list); hnode.appendChild(list); traverseList(onode,nLevel,sStyleName,list); @@ -117,7 +117,7 @@ public class ListParser extends Parser { // add an UL element Element list = converter.createElement("ul"); StyleInfo listInfo = new StyleInfo(); - getListSc().applyStyle(nLevel,sStyleName,listInfo); + getListSP().applyStyle(nLevel,sStyleName,listInfo); writeStyle(listInfo,list); hnode.appendChild(list); traverseList(onode,nLevel,sStyleName,list); @@ -183,7 +183,7 @@ public class ListParser extends Parser { nCurrentListLevel = nLevel; Element item = converter.createElement("li"); StyleInfo info = new StyleInfo(); - getPresentationSc().applyOutlineStyle(nLevel,info); + getPresentationSP().applyOutlineStyle(nLevel,info); writeStyle(info,item); hnode.appendChild(item); if (config.listFormatting()==XhtmlConfig.CSS1_HACK) { @@ -247,7 +247,7 @@ public class ListParser extends Parser { String nodeName = child.getNodeName(); if (nodeName.equals(TEXT_P)) { - getTextCv().traverseInlineText(child,hnode); + getTextParser().traverseInlineText(child,hnode); } if (nodeName.equals(TEXT_LIST)) { // oasis handleList(child,nLevel+1,styleName,hnode); @@ -264,7 +264,7 @@ public class ListParser extends Parser { } } // Still here? - traverse block text as usual! - getTextCv().parseText(onode,nLevel,styleName,hnode); + getTextParser().parseText(onode,nLevel,styleName,hnode); } protected boolean listIsOnlyHeadings(Node node) { @@ -350,7 +350,7 @@ public class ListParser extends Parser { if (sNodeName.equals(TEXT_H)) { Node rememberNode = hnode; - getTextCv().handleHeading((Element) child, (Element) hnode, rememberNode != hnode, ofr.getListStyle(sStyleName), nLevel, bUnNumbered, bRestart, nStartValue); + getTextParser().handleHeading((Element) child, (Element) hnode, rememberNode != hnode, ofr.getListStyle(sStyleName), nLevel, bUnNumbered, bRestart, nStartValue); } else if (sNodeName.equals(TEXT_P)) { // Currently we only handle fakes lists containing headings } else if (sNodeName.equals(TEXT_LIST)) { // oasis diff --git a/src/main/java/writer2latex/xhtml/content/NoteParser.java b/src/main/java/writer2latex/xhtml/content/NoteParser.java index dda5574..e567c0e 100644 --- a/src/main/java/writer2latex/xhtml/content/NoteParser.java +++ b/src/main/java/writer2latex/xhtml/content/NoteParser.java @@ -72,7 +72,7 @@ class NoteParser extends Parser { void handleNote(Node onode, Node hnode, String section) { // Create a style span for the citation String sCitBodyStyle = noteConfig.getProperty(XMLString.TEXT_CITATION_BODY_STYLE_NAME); - Element span = getTextCv().createInline((Element) hnode,sCitBodyStyle); + Element span = getTextParser().createInline((Element) hnode,sCitBodyStyle); // Add target and back-link to the span String sId = Misc.getAttribute(onode,XMLString.TEXT_ID); Element link = converter.createLink(sId); @@ -89,7 +89,7 @@ class NoteParser extends Parser { } // Insert the citation if (citation!=null) { - getTextCv().traversePCDATA(citation,link); + getTextParser().traversePCDATA(citation,link); } // Remember the actual note List noteList = notes.get(section); @@ -173,7 +173,7 @@ class NoteParser extends Parser { String sId = Misc.getAttribute(note,XMLString.TEXT_ID); converter.addTarget(aside,sId); createAnchor(sId,citation); - getTextCv().traverseBlockText(body,aside); + getTextParser().traverseBlockText(body,aside); } //noteList.clear(); notes.remove(section); @@ -196,7 +196,7 @@ class NoteParser extends Parser { } // Add citation - getTextCv().traversePCDATA(citation,link); + getTextParser().traversePCDATA(citation,link); // Add suffix String sSuffix = noteConfig.getProperty(XMLString.STYLE_NUM_SUFFIX); @@ -210,7 +210,7 @@ class NoteParser extends Parser { span.appendChild(converter.createTextNode(" ")); // Save it for later insertion - getTextCv().setAsapNode(span); + getTextParser().setAsapNode(span); } } diff --git a/src/main/java/writer2latex/xhtml/content/TOCParser.java b/src/main/java/writer2latex/xhtml/content/TOCParser.java index 3834e54..78de2a8 100644 --- a/src/main/java/writer2latex/xhtml/content/TOCParser.java +++ b/src/main/java/writer2latex/xhtml/content/TOCParser.java @@ -96,7 +96,7 @@ class TOCParser extends IndexParser { * @param sLabel the numbering label of this heading */ void handleHeading(Element onode, Element heading, String sLabel) { - int nLevel = getTextCv().getOutlineLevel(onode); + int nLevel = getTextParser().getOutlineLevel(onode); String sTarget = TOC_LINK_PREFIX+(++nTocIndex); converter.addTarget(heading,sTarget); @@ -122,7 +122,7 @@ class TOCParser extends IndexParser { // Add in external content. For single file output we include all level 1 headings + their target // Targets are added only when the toc level is deeper than the split level void handleHeadingExternal(Element onode, Element hnode, String sLabel) { - int nLevel = getTextCv().getOutlineLevel(onode); + int nLevel = getTextParser().getOutlineLevel(onode); if (nLevel<=nExternalTocDepth) { // Add an empty div to use as target, if required String sTarget = null; @@ -235,11 +235,11 @@ class TOCParser extends IndexParser { TocEntry entry = tocEntries.get(i); String sNodeName = entry.onode.getTagName(); if (XMLString.TEXT_H.equals(sNodeName)) { - int nLevel = getTextCv().getOutlineLevel(entry.onode); + int nLevel = getTextParser().getOutlineLevel(entry.onode); if (nLevel==1 && tocReader.isByChapter() && entry.onode!=chapter) { break; } if (tocReader.useOutlineLevel() && nLevel<=tocReader.getOutlineLevel()) { - Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); + Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]); if (entry.sLabel!=null) { Element span = converter.createElement("span"); p.appendChild(span); @@ -248,19 +248,19 @@ class TOCParser extends IndexParser { } Element a = converter.createLink(TOC_LINK_PREFIX+i); p.appendChild(a); - getTextCv().traverseInlineText(entry.onode,a); + getTextParser().traverseInlineText(entry.onode,a); } else { String sStyleName = getParSP().getRealParStyleName(entry.onode.getAttribute(XMLString.TEXT_STYLE_NAME)); nLevel = tocReader.getIndexSourceStyleLevel(sStyleName); if (tocReader.useIndexSourceStyles() && 1<=nLevel && nLevel<=tocReader.getOutlineLevel()) { - Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); + Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]); if (entry.sLabel!=null) { p.appendChild(converter.createTextNode(entry.sLabel)); } Element a = converter.createLink(TOC_LINK_PREFIX+i); p.appendChild(a); - getTextCv().traverseInlineText(entry.onode,a); + getTextParser().traverseInlineText(entry.onode,a); } } } @@ -268,19 +268,19 @@ class TOCParser extends IndexParser { String sStyleName = getParSP().getRealParStyleName(entry.onode.getAttribute(XMLString.TEXT_STYLE_NAME)); int nLevel = tocReader.getIndexSourceStyleLevel(sStyleName); if (tocReader.useIndexSourceStyles() && 1<=nLevel && nLevel<=tocReader.getOutlineLevel()) { - Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); + Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]); if (entry.sLabel!=null) { p.appendChild(converter.createTextNode(entry.sLabel)); } Element a = converter.createLink(TOC_LINK_PREFIX+i); p.appendChild(a); - getTextCv().traverseInlineText(entry.onode,a); + getTextParser().traverseInlineText(entry.onode,a); } } else if (XMLString.TEXT_TOC_MARK.equals(sNodeName)) { int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1); if (tocReader.useIndexMarks() && nLevel<=tocReader.getOutlineLevel()) { - Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); + Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]); Element a = converter.createLink(TOC_LINK_PREFIX+i); p.appendChild(a); a.appendChild(converter.createTextNode(IndexMark.getIndexValue(entry.onode))); @@ -289,7 +289,7 @@ class TOCParser extends IndexParser { else if (XMLString.TEXT_TOC_MARK_START.equals(sNodeName)) { int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1); if (tocReader.useIndexMarks() && nLevel<=tocReader.getOutlineLevel()) { - Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); + Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]); Element a = converter.createLink(TOC_LINK_PREFIX+i); p.appendChild(a); a.appendChild(converter.createTextNode(IndexMark.getIndexValue(entry.onode))); @@ -381,7 +381,7 @@ class TOCParser extends IndexParser { inline.appendChild(converter.createTextNode(" ")); } } - getTextCv().traverseInlineText(entry.onode,inline); + getTextParser().traverseInlineText(entry.onode,inline); } } } @@ -403,8 +403,8 @@ class TOCParser extends IndexParser { Element inline = createPanelLink(panel, nIndex, nTocFileIndex, 1); inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.CONTENTS))); } - else if (nFileIndex==getTextCv().getAlphabeticalIndex()) { - Element inline = createPanelLink(panel, nIndex, getTextCv().getAlphabeticalIndex(), 1); + else if (nFileIndex==getTextParser().getAlphabeticalIndex()) { + Element inline = createPanelLink(panel, nIndex, getTextParser().getAlphabeticalIndex(), 1); inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.INDEX))); } } diff --git a/src/main/java/writer2latex/xhtml/content/TableParser.java b/src/main/java/writer2latex/xhtml/content/TableParser.java index 6492705..881f880 100644 --- a/src/main/java/writer2latex/xhtml/content/TableParser.java +++ b/src/main/java/writer2latex/xhtml/content/TableParser.java @@ -101,12 +101,12 @@ public class TableParser extends Parser { while (shape!=null) { if (OfficeReader.isDrawElement(shape)) { // Actually only the first parameter is used - getDrawCv().handleDrawElement((Element)shape,div,null,DrawParser.CENTERED); + getDrawParser().handleDrawElement((Element)shape,div,null,DrawParser.CENTERED); } shape = shape.getNextSibling(); } } - getDrawCv().flushFrames(div); + getDrawParser().flushFrames(div); if (div.hasChildNodes()) { hnode.appendChild(div); } } } @@ -225,7 +225,7 @@ public class TableParser extends Parser { for (int nCol=0; nCol 0) { content = converter.createElement(innerInfo.sTagName); @@ -698,7 +698,7 @@ public class TextParser extends Parser { if (child.getNodeType()==Node.ELEMENT_NODE) { Element elm = (Element) child; if (OfficeReader.isDrawElement(elm)) { - elm = getDrawCv().getRealDrawElement(elm); + elm = getDrawParser().getRealDrawElement(elm); String sAnchor = elm.getAttribute(TEXT_ANCHOR_TYPE); if (Misc.isElement(elm, DRAW_FRAME)) { elm = Misc.getFirstChildElement(elm); @@ -707,11 +707,11 @@ public class TextParser extends Parser { String sTag = elm.getTagName(); // Convert only floating frames; text-boxes must always float if (!"as-char".equals(sAnchor)) { - getDrawCv().handleDrawElement(elm,(Element)hnodeBlock, + getDrawParser().handleDrawElement(elm,(Element)hnodeBlock, (Element)hnodeInline,nFloatMode); } else if (DRAW_TEXT_BOX.equals(sTag)) { - getDrawCv().handleDrawElement(elm,(Element)hnodeBlock, + getDrawParser().handleDrawElement(elm,(Element)hnodeBlock, (Element)hnodeInline,DrawParser.INLINE); } } @@ -753,11 +753,11 @@ public class TextParser extends Parser { case Node.ELEMENT_NODE: String sName = child.getNodeName(); if (OfficeReader.isDrawElement(child)) { - Element elm = getDrawCv().getRealDrawElement((Element) child); + Element elm = getDrawParser().getRealDrawElement((Element) child); if (elm != null) { String sAnchor = (elm.getAttribute(TEXT_ANCHOR_TYPE)); if ("as-char".equals(sAnchor)) { - getDrawCv().handleDrawElement(elm, null, (Element) hnode, DrawParser.INLINE); + getDrawParser().handleDrawElement(elm, null, (Element) hnode, DrawParser.INLINE); } } } else if (child.getNodeName().equals(TEXT_S)) { @@ -1397,7 +1397,7 @@ public class TextParser extends Parser { //Create header element Element headerElement = converter.createElement("header"); if (marginBottom != null) { - headerElement.setAttribute("style", "margin-bottom:"+getPageSc().scale(marginBottom)+"; height:auto; width:auto;"); + headerElement.setAttribute("style", "margin-bottom:"+getPageSP().scale(marginBottom)+"; height:auto; width:auto;"); } Node pageNode = node.getParentNode(); pageNode.insertBefore(headerElement, node); @@ -1431,7 +1431,7 @@ public class TextParser extends Parser { //Create footer element Element footerElement = converter.createElement("footer"); if (marginTop != null) { - footerElement.setAttribute("style", "margin-top:"+getPageSc().scale(marginTop)+"; height:auto; width:auto;"); + footerElement.setAttribute("style", "margin-top:"+getPageSP().scale(marginTop)+"; height:auto; width:auto;"); } Node pageNode = node.getParentNode(); pageNode.appendChild(footerElement); diff --git a/src/main/java/writer2latex/xhtml/style/CellStyleParser.java b/src/main/java/writer2latex/xhtml/style/CellStyleParser.java index 082702c..4aff16e 100644 --- a/src/main/java/writer2latex/xhtml/style/CellStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/CellStyleParser.java @@ -78,9 +78,9 @@ public class CellStyleParser extends StyleWithPropertiesParser { */ public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { // Apply "inner" box properties (no margins) - getFrameSc().cssBorder(style,props,bInherit); - getFrameSc().cssPadding(style,props,bInherit); - getFrameSc().cssBackground(style,props,bInherit); + getFrameSP().cssBorder(style,props,bInherit); + getFrameSP().cssPadding(style,props,bInherit); + getFrameSP().cssBackground(style,props,bInherit); // only relevant for spreadsheets getParSP().cssPar(style,props,bInherit); getTextSP().cssTextCommon(style,props,bInherit); diff --git a/src/main/java/writer2latex/xhtml/style/FrameStyleParser.java b/src/main/java/writer2latex/xhtml/style/FrameStyleParser.java index bd02688..1480ef1 100644 --- a/src/main/java/writer2latex/xhtml/style/FrameStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/FrameStyleParser.java @@ -96,7 +96,7 @@ public class FrameStyleParser extends StyleWithPropertiesParser { public String composeDeclarationBlock( String sDisplayName) { StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(sDisplayName); Properties props = new Properties(";"); - getFrameSc().cssMargins(style, props, true); + getFrameSP().cssMargins(style, props, true); getParSP().cssPar(style, props, true); getTextSP().cssTextCommon(style, props, true); return props.toString(); diff --git a/src/main/java/writer2latex/xhtml/style/PageStyleParser.java b/src/main/java/writer2latex/xhtml/style/PageStyleParser.java index 3002e30..0f9ee25 100644 --- a/src/main/java/writer2latex/xhtml/style/PageStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/PageStyleParser.java @@ -177,7 +177,7 @@ public class PageStyleParser extends StyleParser { MasterPage masterPage = ofr.getFirstMasterPage(); PageLayout pageLayout = ofr.getPageLayout(masterPage.getPageLayoutName()); StyleInfo pageInfo = new StyleInfo(); - getFrameSc().cssBackground(pageLayout, pageInfo.props, true); + getFrameSP().cssBackground(pageLayout, pageInfo.props, true); String pageDeclaration = pageInfo.props.toString(); return pageDeclaration; } @@ -210,7 +210,7 @@ public class PageStyleParser extends StyleParser { if (pageLayout!=null) { applyDirection(pageLayout,info); cssPageSize(pageLayout,info.props); - getFrameSc().cssBackground(pageLayout,info.props,true); + getFrameSP().cssBackground(pageLayout,info.props,true); } // Next apply drawing-page style (draw background) StyleWithProperties drawingPage = ofr.getDrawingPageStyle(style.getProperty(XMLString.DRAW_STYLE_NAME)); diff --git a/src/main/java/writer2latex/xhtml/style/ParStyleParser.java b/src/main/java/writer2latex/xhtml/style/ParStyleParser.java index fb736ba..96e6b39 100644 --- a/src/main/java/writer2latex/xhtml/style/ParStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/ParStyleParser.java @@ -83,10 +83,10 @@ public class ParStyleParser extends StyleWithPropertiesParser { */ public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { cssPageBreak(style, props, bInherit); - getFrameSc().cssMargins(style, props, bInherit); - getFrameSc().cssBorder(style, props, bInherit); - getFrameSc().cssPadding(style, props, bInherit); - getFrameSc().cssBackgroundCommon(style, props, bInherit); + getFrameSP().cssMargins(style, props, bInherit); + getFrameSP().cssBorder(style, props, bInherit); + getFrameSP().cssPadding(style, props, bInherit); + getFrameSP().cssBackgroundCommon(style, props, bInherit); cssPar(style, props, bInherit); getTextSP().cssTextCommon(style, props, bInherit); } diff --git a/src/main/java/writer2latex/xhtml/style/PresentationStyleParser.java b/src/main/java/writer2latex/xhtml/style/PresentationStyleParser.java index 1d32b21..c84704d 100644 --- a/src/main/java/writer2latex/xhtml/style/PresentationStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/PresentationStyleParser.java @@ -122,7 +122,7 @@ public class PresentationStyleParser extends FrameStyleParser { public String composeDeclarationBlock(String displayName) { StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(displayName); Properties props = new Properties(";"); - getFrameSc().cssMargins(style, props, true); + getFrameSP().cssMargins(style, props, true); getParSP().cssPar(style, props, true); getTextSP().cssTextCommon(style, props, true); return props.toString(); diff --git a/src/main/java/writer2latex/xhtml/style/RowStyleParser.java b/src/main/java/writer2latex/xhtml/style/RowStyleParser.java index d401f67..96a92e1 100644 --- a/src/main/java/writer2latex/xhtml/style/RowStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/RowStyleParser.java @@ -77,7 +77,7 @@ public class RowStyleParser extends StyleWithPropertiesParser { * @param bInherit true if properties should be inherited from parent style(s) */ public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { - getFrameSc().cssBackground(style,props,bInherit); + getFrameSP().cssBackground(style,props,bInherit); } } diff --git a/src/main/java/writer2latex/xhtml/style/SectionStyleParser.java b/src/main/java/writer2latex/xhtml/style/SectionStyleParser.java index b465f9c..5338706 100644 --- a/src/main/java/writer2latex/xhtml/style/SectionStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/SectionStyleParser.java @@ -81,7 +81,7 @@ public class SectionStyleParser extends StyleWithPropertiesParser { * @param bInherit true if properties should be inherited from parent style(s) */ public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { - getFrameSc().cssBox(style,props,bInherit); + getFrameSP().cssBox(style,props,bInherit); } } diff --git a/src/main/java/writer2latex/xhtml/style/Styles.java b/src/main/java/writer2latex/xhtml/style/Styles.java index d24e0e7..c0e4ab0 100644 --- a/src/main/java/writer2latex/xhtml/style/Styles.java +++ b/src/main/java/writer2latex/xhtml/style/Styles.java @@ -94,23 +94,23 @@ public class Styles extends Parser { public ParStyleParser getParSP() { return parStyleParser; } - public HeadingStyleParser getHeadingSc() { return headingStyleParser; } + public HeadingStyleParser getHeadingSP() { return headingStyleParser; } - public ListStyleParser getListSc() { return listStyleParser; } + public ListStyleParser getListSP() { return listStyleParser; } - public SectionStyleParser getSectionSc() { return sectionStyleParser; } + public SectionStyleParser getSectionSP() { return sectionStyleParser; } - public TableStyleParser getTableSc() { return tableStyleParser; } + public TableStyleParser getTableSP() { return tableStyleParser; } - public RowStyleParser getRowSc() { return rowStyleParser; } + public RowStyleParser getRowSP() { return rowStyleParser; } - public CellStyleParser getCellSc() { return cellStyleParser; } + public CellStyleParser getCellSP() { return cellStyleParser; } - public FrameStyleParser getFrameSc() { return frameStyleParser; } + public FrameStyleParser getFrameSP() { return frameStyleParser; } - public PresentationStyleParser getPresentationSc() { return presentationStyleParser; } + public PresentationStyleParser getPresentationSP() { return presentationStyleParser; } - public PageStyleParser getPageSc() { return pageStyleParser; } + public PageStyleParser getPageSP() { return pageStyleParser; } /** Apply the default language of the source document on an XHTML element * diff --git a/src/main/java/writer2latex/xhtml/style/TableStyleParser.java b/src/main/java/writer2latex/xhtml/style/TableStyleParser.java index c125fa6..088649a 100644 --- a/src/main/java/writer2latex/xhtml/style/TableStyleParser.java +++ b/src/main/java/writer2latex/xhtml/style/TableStyleParser.java @@ -80,7 +80,7 @@ public class TableStyleParser extends StyleWithPropertiesParser { // Page break getParSP().cssPageBreak(style, props, bInherit); // Apply background - getFrameSc().cssBackground(style,props,bInherit); + getFrameSP().cssBackground(style,props,bInherit); // Table-specific properties cssTable(style,props,bInherit); }