Renamed parsers' getters

This commit is contained in:
Georgy Litvinov 2020-03-09 11:39:28 +01:00
parent 62d60253d5
commit 3136b4f172
20 changed files with 122 additions and 122 deletions

View file

@ -298,7 +298,7 @@ public class Converter extends BasicConverter {
} }
// Set the main content width // Set the main content width
pushContentWidth(getStylesParser().getPageSc().getTextWidth()); pushContentWidth(getStylesParser().getPageSP().getTextWidth());
// Traverse the body // Traverse the body
Element body = ofr.getContent(); Element body = ofr.getContent();
@ -640,8 +640,8 @@ public class Converter extends BasicConverter {
private void applyWritingDirection() { private void applyWritingDirection() {
StyleInfo pageInfo = new StyleInfo(); StyleInfo pageInfo = new StyleInfo();
styles.getPageSc().applyDefaultWritingDirection(pageInfo); styles.getPageSP().applyDefaultWritingDirection(pageInfo);
styles.getPageSc().writeStyle(pageInfo, htmlDoc.getContentNode()); styles.getPageSP().writeStyle(pageInfo, htmlDoc.getContentNode());
} }

View file

@ -75,34 +75,34 @@ public class Parser {
protected ParStyleParser getParSP() { return converter.getStylesParser().getParSP(); } 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 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 /** Apply style information to an XHTML node
* *

View file

@ -112,7 +112,7 @@ class AlphabeticalIndexParser extends IndexParser {
AlphabeticalEntry entry = index.get(i); AlphabeticalEntry entry = index.get(i);
Element li = converter.createElement("li"); Element li = converter.createElement("li");
container.appendChild(li); container.appendChild(li);
Element p = getTextCv().createParagraph(li,sEntryStyleName); Element p = getTextParser().createParagraph(li,sEntryStyleName);
Element a = converter.createLink("idx"+entry.nIndex); Element a = converter.createLink("idx"+entry.nIndex);
p.appendChild(a); p.appendChild(a);
a.appendChild(converter.createTextNode(entry.sWord)); a.appendChild(converter.createTextNode(entry.sWord));

View file

@ -165,7 +165,7 @@ public class DrawParser extends Parser {
// Style it (TODO: Apply hard drawing-page (background) style) // Style it (TODO: Apply hard drawing-page (background) style)
StyleInfo info = new StyleInfo(); 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("top","40px"); // Somewhat arbitrary
info.props.addProperty("left","0"); info.props.addProperty("left","0");
info.props.addProperty("position","absolute"); info.props.addProperty("position","absolute");
@ -336,7 +336,7 @@ public class DrawParser extends Parser {
} }
else if (sName.equals(XMLString.DRAW_FRAME)) { else if (sName.equals(XMLString.DRAW_FRAME)) {
// First check for TexMaths equation // 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 // OpenDocument embeds the draw element in a frame element
handleDrawElement(Misc.getFirstChildElement(onode),hnodeBlock,hnodeInline,nMode); handleDrawElement(Misc.getFirstChildElement(onode),hnodeBlock,hnodeInline,nMode);
@ -344,7 +344,7 @@ public class DrawParser extends Parser {
} }
else if (sName.equals(XMLString.DRAW_G)) { else if (sName.equals(XMLString.DRAW_G)) {
// First check for TexMaths equation // First check for TexMaths equation
if (!getMathCv().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) { if (!getMathParser().convertTexMathsEquation(onode, hnodeBlock, hnodeInline, nMode)) {
handleDrawGroup(onode,hnodeBlock,hnodeInline,nMode); handleDrawGroup(onode,hnodeBlock,hnodeInline,nMode);
} }
} }
@ -386,7 +386,7 @@ public class DrawParser extends Parser {
} }
try { try {
hnode.appendChild(converter.createTextNode(" ")); hnode.appendChild(converter.createTextNode(" "));
getMathCv().convert(replacementImage,xmlObject.getContentDOM().getDocumentElement(),hnode,bNoTextPar); getMathParser().convert(replacementImage,xmlObject.getContentDOM().getDocumentElement(),hnode,bNoTextPar);
Node convertedMath = hnode.getLastChild(); Node convertedMath = hnode.getLastChild();
applySettings(settings, convertedMath); applySettings(settings, convertedMath);
@ -429,7 +429,7 @@ public class DrawParser extends Parser {
replacementImage = Misc.getChildByTagName(getFrame(onode),XMLString.DRAW_IMAGE); replacementImage = Misc.getChildByTagName(getFrame(onode),XMLString.DRAW_IMAGE);
} }
hnode.appendChild(converter.createTextNode(" ")); hnode.appendChild(converter.createTextNode(" "));
getMathCv().convert(replacementImage,formula,hnode,bNoTextPar); getMathParser().convert(replacementImage,formula,hnode,bNoTextPar);
hnode.appendChild(converter.createTextNode(" ")); hnode.appendChild(converter.createTextNode(" "));
} }
else { // unsupported object else { // unsupported object
@ -622,7 +622,7 @@ public class DrawParser extends Parser {
// Now style it // Now style it
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME); 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); applyImageSize(frame,info.props,nMode,false);
// Apply placement // Apply placement
@ -652,15 +652,15 @@ public class DrawParser extends Parser {
// Draw frame style // Draw frame style
String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME); String sStyleName = Misc.getAttribute(frame, XMLString.DRAW_STYLE_NAME);
if (sStyleName!=null) { if (sStyleName!=null) {
getFrameSc().readStyle(sStyleName,info); getFrameSP().readStyle(sStyleName,info);
} }
// Presentation frame style // Presentation frame style
String sPresentationStyleName = Misc.getAttribute(frame, XMLString.PRESENTATION_STYLE_NAME); String sPresentationStyleName = Misc.getAttribute(frame, XMLString.PRESENTATION_STYLE_NAME);
if (sPresentationStyleName!=null) { if (sPresentationStyleName!=null) {
if ("outline".equals(Misc.getAttribute(frame, XMLString.PRESENTATION_CLASS))) { 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 // Additional text formatting
String sTextStyleName = Misc.getAttribute(frame, XMLString.DRAW_TEXT_STYLE_NAME); String sTextStyleName = Misc.getAttribute(frame, XMLString.DRAW_TEXT_STYLE_NAME);
@ -732,11 +732,11 @@ public class DrawParser extends Parser {
if (sContentWidth!=null) { if (sContentWidth!=null) {
converter.pushContentWidth(sContentWidth); converter.pushContentWidth(sContentWidth);
} }
getTextCv().traverseBlockText(onode,textbox); getTextParser().traverseBlockText(onode,textbox);
if (sContentWidth!=null) { if (sContentWidth!=null) {
converter.popContentWidth(); converter.popContentWidth();
} }
getPresentationSc().exitOutline(); getPresentationSP().exitOutline();
} }
private void handleDrawGroup(Element onode, Element hnodeBlock, Element hnodeInline, int nMode) { private void handleDrawGroup(Element onode, Element hnodeBlock, Element hnodeInline, int nMode) {
@ -803,7 +803,7 @@ public class DrawParser extends Parser {
if (hcontrol!=null) { if (hcontrol!=null) {
Element frame = onode; // controls are *not* contained in a draw:frame! Element frame = onode; // controls are *not* contained in a draw:frame!
StyleInfo info = new StyleInfo(); 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); applySize(frame,info.props,false);
applyPlacement(frame,hnodeBlock,hnodeInline,nMode,hcontrol,info); applyPlacement(frame,hnodeBlock,hnodeInline,nMode,hcontrol,info);
writeStyle(info,hcontrol); writeStyle(info,hcontrol);
@ -1023,11 +1023,11 @@ public class DrawParser extends Parser {
if (s!=null) sWidth = Calc.sub(sWidth, Calc.multiply("200%", s)); if (s!=null) sWidth = Calc.sub(sWidth, Calc.multiply("200%", s));
// Subtract border // Subtract border
s = style.getProperty(XMLString.FO_BORDER_LEFT); 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); 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); 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; return sWidth;
} }
@ -1048,11 +1048,11 @@ public class DrawParser extends Parser {
if (s!=null) sHeight = Calc.sub(sHeight, Calc.multiply("200%", s)); if (s!=null) sHeight = Calc.sub(sHeight, Calc.multiply("200%", s));
// Subtract border // Subtract border
s = style.getProperty(XMLString.FO_BORDER_TOP); 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); 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); 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; return sHeight;
} }

View file

@ -61,8 +61,8 @@ class FootnoteParser extends NoteParser {
// Add footnote rule // Add footnote rule
Element rule = converter.createElement("hr"); Element rule = converter.createElement("hr");
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
getPageSc().applyFootnoteRuleStyle(info); getPageSP().applyFootnoteRuleStyle(info);
getPageSc().writeStyle(info, rule); getPageSP().writeStyle(info, rule);
sectionElement.appendChild(rule); sectionElement.appendChild(rule);
flushAllNotes(sectionElement,"footnote"); flushAllNotes(sectionElement,"footnote");

View file

@ -95,7 +95,7 @@ abstract class IndexParser extends Parser {
String sStyleName = source.getAttribute(XMLString.TEXT_STYLE_NAME); String sStyleName = source.getAttribute(XMLString.TEXT_STYLE_NAME);
if (sStyleName!=null) { if (sStyleName!=null) {
StyleInfo sectionInfo = new StyleInfo(); StyleInfo sectionInfo = new StyleInfo();
getSectionSc().readStyle(sStyleName,sectionInfo); getSectionSP().readStyle(sStyleName,sectionInfo);
writeStyle(sectionInfo,container); writeStyle(sectionInfo,container);
} }
return container; return container;
@ -110,9 +110,9 @@ abstract class IndexParser extends Parser {
String sStyleName = Misc.getAttribute(title,XMLString.TEXT_STYLE_NAME); String sStyleName = Misc.getAttribute(title,XMLString.TEXT_STYLE_NAME);
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
info.sTagName = "h1"; info.sTagName = "h1";
getHeadingSc().applyStyle(1, sStyleName, info); getHeadingSP().applyStyle(1, sStyleName, info);
writeStyle(info,h1); writeStyle(info,h1);
getTextCv().traversePCDATA(title,h1); getTextParser().traversePCDATA(title,h1);
} }
} }

View file

@ -104,8 +104,8 @@ public class ListParser extends Parser {
// add an OL element // add an OL element
Element list = converter.createElement("ol"); Element list = converter.createElement("ol");
StyleInfo listInfo = new StyleInfo(); StyleInfo listInfo = new StyleInfo();
getListSc().applyStyle(nLevel,sStyleName,listInfo); getListSP().applyStyle(nLevel,sStyleName,listInfo);
getListSc().readParentStyle(nLevel, sStyleName, listInfo); getListSP().readParentStyle(nLevel, sStyleName, listInfo);
writeStyle(listInfo,list); writeStyle(listInfo,list);
hnode.appendChild(list); hnode.appendChild(list);
traverseList(onode,nLevel,sStyleName,list); traverseList(onode,nLevel,sStyleName,list);
@ -117,7 +117,7 @@ public class ListParser extends Parser {
// add an UL element // add an UL element
Element list = converter.createElement("ul"); Element list = converter.createElement("ul");
StyleInfo listInfo = new StyleInfo(); StyleInfo listInfo = new StyleInfo();
getListSc().applyStyle(nLevel,sStyleName,listInfo); getListSP().applyStyle(nLevel,sStyleName,listInfo);
writeStyle(listInfo,list); writeStyle(listInfo,list);
hnode.appendChild(list); hnode.appendChild(list);
traverseList(onode,nLevel,sStyleName,list); traverseList(onode,nLevel,sStyleName,list);
@ -183,7 +183,7 @@ public class ListParser extends Parser {
nCurrentListLevel = nLevel; nCurrentListLevel = nLevel;
Element item = converter.createElement("li"); Element item = converter.createElement("li");
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
getPresentationSc().applyOutlineStyle(nLevel,info); getPresentationSP().applyOutlineStyle(nLevel,info);
writeStyle(info,item); writeStyle(info,item);
hnode.appendChild(item); hnode.appendChild(item);
if (config.listFormatting()==XhtmlConfig.CSS1_HACK) { if (config.listFormatting()==XhtmlConfig.CSS1_HACK) {
@ -247,7 +247,7 @@ public class ListParser extends Parser {
String nodeName = child.getNodeName(); String nodeName = child.getNodeName();
if (nodeName.equals(TEXT_P)) { if (nodeName.equals(TEXT_P)) {
getTextCv().traverseInlineText(child,hnode); getTextParser().traverseInlineText(child,hnode);
} }
if (nodeName.equals(TEXT_LIST)) { // oasis if (nodeName.equals(TEXT_LIST)) { // oasis
handleList(child,nLevel+1,styleName,hnode); handleList(child,nLevel+1,styleName,hnode);
@ -264,7 +264,7 @@ public class ListParser extends Parser {
} }
} }
// Still here? - traverse block text as usual! // Still here? - traverse block text as usual!
getTextCv().parseText(onode,nLevel,styleName,hnode); getTextParser().parseText(onode,nLevel,styleName,hnode);
} }
protected boolean listIsOnlyHeadings(Node node) { protected boolean listIsOnlyHeadings(Node node) {
@ -350,7 +350,7 @@ public class ListParser extends Parser {
if (sNodeName.equals(TEXT_H)) { if (sNodeName.equals(TEXT_H)) {
Node rememberNode = hnode; 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)) { } else if (sNodeName.equals(TEXT_P)) {
// Currently we only handle fakes lists containing headings // Currently we only handle fakes lists containing headings
} else if (sNodeName.equals(TEXT_LIST)) { // oasis } else if (sNodeName.equals(TEXT_LIST)) { // oasis

View file

@ -72,7 +72,7 @@ class NoteParser extends Parser {
void handleNote(Node onode, Node hnode, String section) { void handleNote(Node onode, Node hnode, String section) {
// Create a style span for the citation // Create a style span for the citation
String sCitBodyStyle = noteConfig.getProperty(XMLString.TEXT_CITATION_BODY_STYLE_NAME); 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 // Add target and back-link to the span
String sId = Misc.getAttribute(onode,XMLString.TEXT_ID); String sId = Misc.getAttribute(onode,XMLString.TEXT_ID);
Element link = converter.createLink(sId); Element link = converter.createLink(sId);
@ -89,7 +89,7 @@ class NoteParser extends Parser {
} }
// Insert the citation // Insert the citation
if (citation!=null) { if (citation!=null) {
getTextCv().traversePCDATA(citation,link); getTextParser().traversePCDATA(citation,link);
} }
// Remember the actual note // Remember the actual note
List<Node> noteList = notes.get(section); List<Node> noteList = notes.get(section);
@ -173,7 +173,7 @@ class NoteParser extends Parser {
String sId = Misc.getAttribute(note,XMLString.TEXT_ID); String sId = Misc.getAttribute(note,XMLString.TEXT_ID);
converter.addTarget(aside,sId); converter.addTarget(aside,sId);
createAnchor(sId,citation); createAnchor(sId,citation);
getTextCv().traverseBlockText(body,aside); getTextParser().traverseBlockText(body,aside);
} }
//noteList.clear(); //noteList.clear();
notes.remove(section); notes.remove(section);
@ -196,7 +196,7 @@ class NoteParser extends Parser {
} }
// Add citation // Add citation
getTextCv().traversePCDATA(citation,link); getTextParser().traversePCDATA(citation,link);
// Add suffix // Add suffix
String sSuffix = noteConfig.getProperty(XMLString.STYLE_NUM_SUFFIX); String sSuffix = noteConfig.getProperty(XMLString.STYLE_NUM_SUFFIX);
@ -210,7 +210,7 @@ class NoteParser extends Parser {
span.appendChild(converter.createTextNode(" ")); span.appendChild(converter.createTextNode(" "));
// Save it for later insertion // Save it for later insertion
getTextCv().setAsapNode(span); getTextParser().setAsapNode(span);
} }
} }

View file

@ -96,7 +96,7 @@ class TOCParser extends IndexParser {
* @param sLabel the numbering label of this heading * @param sLabel the numbering label of this heading
*/ */
void handleHeading(Element onode, Element heading, String sLabel) { void handleHeading(Element onode, Element heading, String sLabel) {
int nLevel = getTextCv().getOutlineLevel(onode); int nLevel = getTextParser().getOutlineLevel(onode);
String sTarget = TOC_LINK_PREFIX+(++nTocIndex); String sTarget = TOC_LINK_PREFIX+(++nTocIndex);
converter.addTarget(heading,sTarget); 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 // 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 // Targets are added only when the toc level is deeper than the split level
void handleHeadingExternal(Element onode, Element hnode, String sLabel) { void handleHeadingExternal(Element onode, Element hnode, String sLabel) {
int nLevel = getTextCv().getOutlineLevel(onode); int nLevel = getTextParser().getOutlineLevel(onode);
if (nLevel<=nExternalTocDepth) { if (nLevel<=nExternalTocDepth) {
// Add an empty div to use as target, if required // Add an empty div to use as target, if required
String sTarget = null; String sTarget = null;
@ -235,11 +235,11 @@ class TOCParser extends IndexParser {
TocEntry entry = tocEntries.get(i); TocEntry entry = tocEntries.get(i);
String sNodeName = entry.onode.getTagName(); String sNodeName = entry.onode.getTagName();
if (XMLString.TEXT_H.equals(sNodeName)) { 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 (nLevel==1 && tocReader.isByChapter() && entry.onode!=chapter) { break; }
if (tocReader.useOutlineLevel() && nLevel<=tocReader.getOutlineLevel()) { if (tocReader.useOutlineLevel() && nLevel<=tocReader.getOutlineLevel()) {
Element p = getTextCv().createParagraph(li,sEntryStyleName[nLevel]); Element p = getTextParser().createParagraph(li,sEntryStyleName[nLevel]);
if (entry.sLabel!=null) { if (entry.sLabel!=null) {
Element span = converter.createElement("span"); Element span = converter.createElement("span");
p.appendChild(span); p.appendChild(span);
@ -248,19 +248,19 @@ class TOCParser extends IndexParser {
} }
Element a = converter.createLink(TOC_LINK_PREFIX+i); Element a = converter.createLink(TOC_LINK_PREFIX+i);
p.appendChild(a); p.appendChild(a);
getTextCv().traverseInlineText(entry.onode,a); getTextParser().traverseInlineText(entry.onode,a);
} }
else { else {
String sStyleName = getParSP().getRealParStyleName(entry.onode.getAttribute(XMLString.TEXT_STYLE_NAME)); String sStyleName = getParSP().getRealParStyleName(entry.onode.getAttribute(XMLString.TEXT_STYLE_NAME));
nLevel = tocReader.getIndexSourceStyleLevel(sStyleName); nLevel = tocReader.getIndexSourceStyleLevel(sStyleName);
if (tocReader.useIndexSourceStyles() && 1<=nLevel && nLevel<=tocReader.getOutlineLevel()) { 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) { if (entry.sLabel!=null) {
p.appendChild(converter.createTextNode(entry.sLabel)); p.appendChild(converter.createTextNode(entry.sLabel));
} }
Element a = converter.createLink(TOC_LINK_PREFIX+i); Element a = converter.createLink(TOC_LINK_PREFIX+i);
p.appendChild(a); 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)); String sStyleName = getParSP().getRealParStyleName(entry.onode.getAttribute(XMLString.TEXT_STYLE_NAME));
int nLevel = tocReader.getIndexSourceStyleLevel(sStyleName); int nLevel = tocReader.getIndexSourceStyleLevel(sStyleName);
if (tocReader.useIndexSourceStyles() && 1<=nLevel && nLevel<=tocReader.getOutlineLevel()) { 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) { if (entry.sLabel!=null) {
p.appendChild(converter.createTextNode(entry.sLabel)); p.appendChild(converter.createTextNode(entry.sLabel));
} }
Element a = converter.createLink(TOC_LINK_PREFIX+i); Element a = converter.createLink(TOC_LINK_PREFIX+i);
p.appendChild(a); p.appendChild(a);
getTextCv().traverseInlineText(entry.onode,a); getTextParser().traverseInlineText(entry.onode,a);
} }
} }
else if (XMLString.TEXT_TOC_MARK.equals(sNodeName)) { else if (XMLString.TEXT_TOC_MARK.equals(sNodeName)) {
int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1); int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1);
if (tocReader.useIndexMarks() && nLevel<=tocReader.getOutlineLevel()) { 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); Element a = converter.createLink(TOC_LINK_PREFIX+i);
p.appendChild(a); p.appendChild(a);
a.appendChild(converter.createTextNode(IndexMark.getIndexValue(entry.onode))); 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)) { else if (XMLString.TEXT_TOC_MARK_START.equals(sNodeName)) {
int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1); int nLevel = Misc.getPosInteger(entry.onode.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1);
if (tocReader.useIndexMarks() && nLevel<=tocReader.getOutlineLevel()) { 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); Element a = converter.createLink(TOC_LINK_PREFIX+i);
p.appendChild(a); p.appendChild(a);
a.appendChild(converter.createTextNode(IndexMark.getIndexValue(entry.onode))); a.appendChild(converter.createTextNode(IndexMark.getIndexValue(entry.onode)));
@ -381,7 +381,7 @@ class TOCParser extends IndexParser {
inline.appendChild(converter.createTextNode(" ")); 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); Element inline = createPanelLink(panel, nIndex, nTocFileIndex, 1);
inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.CONTENTS))); inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.CONTENTS)));
} }
else if (nFileIndex==getTextCv().getAlphabeticalIndex()) { else if (nFileIndex==getTextParser().getAlphabeticalIndex()) {
Element inline = createPanelLink(panel, nIndex, getTextCv().getAlphabeticalIndex(), 1); Element inline = createPanelLink(panel, nIndex, getTextParser().getAlphabeticalIndex(), 1);
inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.INDEX))); inline.appendChild(converter.createTextNode(converter.getL10n().get(L10n.INDEX)));
} }
} }

View file

@ -101,12 +101,12 @@ public class TableParser extends Parser {
while (shape!=null) { while (shape!=null) {
if (OfficeReader.isDrawElement(shape)) { if (OfficeReader.isDrawElement(shape)) {
// Actually only the first parameter is used // 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(); shape = shape.getNextSibling();
} }
} }
getDrawCv().flushFrames(div); getDrawParser().flushFrames(div);
if (div.hasChildNodes()) { hnode.appendChild(div); } if (div.hasChildNodes()) { hnode.appendChild(div); }
} }
} }
@ -225,7 +225,7 @@ public class TableParser extends Parser {
for (int nCol=0; nCol<nColCount; nCol++) { for (int nCol=0; nCol<nColCount; nCol++) {
Element col = converter.createElement("col"); Element col = converter.createElement("col");
colgroup.appendChild(col); colgroup.appendChild(col);
col.setAttribute("style","width:"+getTableSc().colScale(view.getColumnWidth(nCol))); col.setAttribute("style","width:"+getTableSP().colScale(view.getColumnWidth(nCol)));
} }
} }
} }
@ -288,7 +288,7 @@ public class TableParser extends Parser {
if (sWidth!=null) { if (sWidth!=null) {
converter.pushContentWidth(sWidth); converter.pushContentWidth(sWidth);
} }
getTextCv().traverseBlockText(cell,td); getTextParser().traverseBlockText(cell,td);
if (sWidth!=null) { if (sWidth!=null) {
converter.popContentWidth(); converter.popContentWidth();
} }
@ -336,7 +336,7 @@ public class TableParser extends Parser {
private void applyTableStyle(String sStyleName, Element table, boolean bIsSubTable) { private void applyTableStyle(String sStyleName, Element table, boolean bIsSubTable) {
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
getTableSc().readStyle(sStyleName,info); getTableSP().readStyle(sStyleName,info);
if (config.tableSize()!=XhtmlConfig.NONE) { if (config.tableSize()!=XhtmlConfig.NONE) {
StyleWithProperties style = ofr.getTableStyle(sStyleName); StyleWithProperties style = ofr.getTableStyle(sStyleName);
@ -355,7 +355,7 @@ public class TableParser extends Parser {
info.props.addProperty("width",sWidth); info.props.addProperty("width",sWidth);
} }
else { else {
info.props.addProperty("width",getTableSc().colScale(sWidth)); info.props.addProperty("width",getTableSP().colScale(sWidth));
} }
} }
} }
@ -382,7 +382,7 @@ public class TableParser extends Parser {
private void applyRowStyle(String sStyleName, Element row) { private void applyRowStyle(String sStyleName, Element row) {
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
getRowSc().readStyle(sStyleName,info); getRowSP().readStyle(sStyleName,info);
if (config.tableSize()!=XhtmlConfig.NONE) { if (config.tableSize()!=XhtmlConfig.NONE) {
StyleWithProperties style = ofr.getRowStyle(sStyleName); StyleWithProperties style = ofr.getRowStyle(sStyleName);
@ -394,7 +394,7 @@ public class TableParser extends Parser {
String s = style.getAbsoluteProperty(XMLString.STYLE_ROW_HEIGHT); String s = style.getAbsoluteProperty(XMLString.STYLE_ROW_HEIGHT);
// Do not export minimal row height; causes trouble with ie // Do not export minimal row height; causes trouble with ie
//if (s==null) { s = style.getAbsoluteProperty(XMLString.STYLE_MIN_ROW_HEIGHT); } //if (s==null) { s = style.getAbsoluteProperty(XMLString.STYLE_MIN_ROW_HEIGHT); }
if (s!=null) { info.props.addProperty("height",getRowSc().scale(s)); } if (s!=null) { info.props.addProperty("height",getRowSP().scale(s)); }
} }
} }
@ -403,7 +403,7 @@ public class TableParser extends Parser {
private void applyCellStyle(String sStyleName, boolean bIsRelative, String sTotalWidth, String sValueType, Element cell, boolean bIsSubTable) { private void applyCellStyle(String sStyleName, boolean bIsRelative, String sTotalWidth, String sValueType, Element cell, boolean bIsSubTable) {
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
getCellSc().readStyle(sStyleName,info); getCellSP().readStyle(sStyleName,info);
StyleWithProperties style = ofr.getCellStyle(sStyleName); StyleWithProperties style = ofr.getCellStyle(sStyleName);
if (style!=null) { if (style!=null) {
@ -414,31 +414,31 @@ public class TableParser extends Parser {
// "total cell width" - "border" - "padding" // "total cell width" - "border" - "padding"
String s = style.getProperty(XMLString.FO_PADDING_LEFT); String s = style.getProperty(XMLString.FO_PADDING_LEFT);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,getTableSc().colScale(s)); sEdge=Calc.add(sEdge,getTableSP().colScale(s));
} }
s = style.getProperty(XMLString.FO_PADDING_RIGHT); s = style.getProperty(XMLString.FO_PADDING_RIGHT);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,getTableSc().colScale(s)); sEdge=Calc.add(sEdge,getTableSP().colScale(s));
} }
s = style.getProperty(XMLString.FO_PADDING); s = style.getProperty(XMLString.FO_PADDING);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,Calc.multiply("200%",getTableSc().colScale(s))); sEdge=Calc.add(sEdge,Calc.multiply("200%",getTableSP().colScale(s)));
} }
s = style.getProperty(XMLString.FO_BORDER_LEFT); s = style.getProperty(XMLString.FO_BORDER_LEFT);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,getTableSc().colScale(borderWidth(s))); sEdge=Calc.add(sEdge,getTableSP().colScale(borderWidth(s)));
} }
s = style.getProperty(XMLString.FO_BORDER_RIGHT); s = style.getProperty(XMLString.FO_BORDER_RIGHT);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,getTableSc().colScale(borderWidth(s))); sEdge=Calc.add(sEdge,getTableSP().colScale(borderWidth(s)));
} }
s = style.getProperty(XMLString.FO_BORDER); s = style.getProperty(XMLString.FO_BORDER);
if (s!=null) { if (s!=null) {
sEdge=Calc.add(sEdge,Calc.multiply("200%",getTableSc().colScale(borderWidth(s)))); sEdge=Calc.add(sEdge,Calc.multiply("200%",getTableSP().colScale(borderWidth(s))));
} }
if (sTotalWidth!=null) { if (sTotalWidth!=null) {
info.props.addProperty("width",Calc.sub(getTableSc().colScale(sTotalWidth),sEdge)); info.props.addProperty("width",Calc.sub(getTableSP().colScale(sTotalWidth),sEdge));
} }
} }
} }

View file

@ -152,7 +152,7 @@ public class TextParser extends Parser {
Element hnode = converter.nextOutFile(); Element hnode = converter.nextOutFile();
// Create form // Create form
if (splitHeadingLevel==0) { if (splitHeadingLevel==0) {
Element form = getDrawCv().createForm(); Element form = getDrawParser().createForm();
if (form!=null) { if (form!=null) {
hnode.appendChild(form); hnode.appendChild(form);
hnode = form; hnode = form;
@ -160,7 +160,7 @@ public class TextParser extends Parser {
} }
// Add cover image // Add cover image
hnode = getDrawCv().insertCoverImage(hnode); hnode = getDrawParser().insertCoverImage(hnode);
//Extract table:index-body content from TOC //Extract table:index-body content from TOC
if (!config.includeToc()){ if (!config.includeToc()){
extractRealTOC(onode); extractRealTOC(onode);
@ -267,7 +267,7 @@ public class TextParser extends Parser {
// Block splitting // Block splitting
if (OfficeReader.isDrawElement(child)) { if (OfficeReader.isDrawElement(child)) {
getDrawCv().handleDrawElement((Element)child,(Element)hnode,null,nFloatMode); getDrawParser().handleDrawElement((Element)child,(Element)hnode,null,nFloatMode);
} }
else if (nodeName.equals(TEXT_P)) { else if (nodeName.equals(TEXT_P)) {
StyleWithProperties style = ofr.getParStyle(Misc.getAttribute(child,TEXT_STYLE_NAME)); StyleWithProperties style = ofr.getParStyle(Misc.getAttribute(child,TEXT_STYLE_NAME));
@ -374,11 +374,11 @@ public class TextParser extends Parser {
StyleWithProperties style = ofr.getTableStyle(Misc.getAttribute(child, TABLE_STYLE_NAME)); StyleWithProperties style = ofr.getTableStyle(Misc.getAttribute(child, TABLE_STYLE_NAME));
hnode = processPageBreaks(child, hnode,style); hnode = processPageBreaks(child, hnode,style);
inTable = true; inTable = true;
getTableCv().handleTable(child,hnode); getTableParser().handleTable(child,hnode);
inTable = false; inTable = false;
} }
else if (nodeName.equals(TABLE_SUB_TABLE)) { else if (nodeName.equals(TABLE_SUB_TABLE)) {
getTableCv().handleTable(child,hnode); getTableParser().handleTable(child,hnode);
} }
else if (nodeName.equals(TEXT_SECTION)) { else if (nodeName.equals(TEXT_SECTION)) {
hnode = processPageBreaks(child, hnode,null); hnode = processPageBreaks(child, hnode,null);
@ -417,7 +417,7 @@ public class TextParser extends Parser {
//handleSeqeuenceDecls(child); //handleSeqeuenceDecls(child);
} }
//TODO:IS IT NEEDED? //TODO:IS IT NEEDED?
hnode = getDrawCv().flushFullscreenFrames((Element)hnode); hnode = getDrawParser().flushFullscreenFrames((Element)hnode);
} }
i++; i++;
} }
@ -461,7 +461,7 @@ public class TextParser extends Parser {
String styleName = Misc.getAttribute(onode,TEXT_STYLE_NAME); String styleName = Misc.getAttribute(onode,TEXT_STYLE_NAME);
String sectionName = Misc.getAttribute(onode,TEXT_NAME); String sectionName = Misc.getAttribute(onode,TEXT_NAME);
OfficeStyle ofStyle = getSectionSc().getStyles().getStyle(styleName); OfficeStyle ofStyle = getSectionSP().getStyles().getStyle(styleName);
if (ofStyle != null) { if (ofStyle != null) {
sectionStyle = (StyleWithProperties) ofStyle; sectionStyle = (StyleWithProperties) ofStyle;
int colCount = sectionStyle.getColCount(); int colCount = sectionStyle.getColCount();
@ -563,8 +563,8 @@ public class TextParser extends Parser {
// Apply style // Apply style
StyleInfo info = new StyleInfo(); StyleInfo info = new StyleInfo();
info.sTagName = "h" + nLevel; info.sTagName = "h" + nLevel;
getHeadingSc().readParentStyle(nLevel, sStyleName, info); getHeadingSP().readParentStyle(nLevel, sStyleName, info);
getHeadingSc().applyStyle(nLevel, sStyleName, info); getHeadingSP().applyStyle(nLevel, sStyleName, info);
// add root element // add root element
Element heading = converter.createElement(info.sTagName); Element heading = converter.createElement(info.sTagName);
@ -595,7 +595,7 @@ public class TextParser extends Parser {
// Convert content // Convert content
StyleInfo innerInfo = new StyleInfo(); StyleInfo innerInfo = new StyleInfo();
getHeadingSc().applyInnerStyle(nLevel, sStyleName, innerInfo); getHeadingSP().applyInnerStyle(nLevel, sStyleName, innerInfo);
Element content = heading; Element content = heading;
if (innerInfo.sTagName != null && innerInfo.sTagName.length() > 0) { if (innerInfo.sTagName != null && innerInfo.sTagName.length() > 0) {
content = converter.createElement(innerInfo.sTagName); content = converter.createElement(innerInfo.sTagName);
@ -698,7 +698,7 @@ public class TextParser extends Parser {
if (child.getNodeType()==Node.ELEMENT_NODE) { if (child.getNodeType()==Node.ELEMENT_NODE) {
Element elm = (Element) child; Element elm = (Element) child;
if (OfficeReader.isDrawElement(elm)) { if (OfficeReader.isDrawElement(elm)) {
elm = getDrawCv().getRealDrawElement(elm); elm = getDrawParser().getRealDrawElement(elm);
String sAnchor = elm.getAttribute(TEXT_ANCHOR_TYPE); String sAnchor = elm.getAttribute(TEXT_ANCHOR_TYPE);
if (Misc.isElement(elm, DRAW_FRAME)) { if (Misc.isElement(elm, DRAW_FRAME)) {
elm = Misc.getFirstChildElement(elm); elm = Misc.getFirstChildElement(elm);
@ -707,11 +707,11 @@ public class TextParser extends Parser {
String sTag = elm.getTagName(); String sTag = elm.getTagName();
// Convert only floating frames; text-boxes must always float // Convert only floating frames; text-boxes must always float
if (!"as-char".equals(sAnchor)) { if (!"as-char".equals(sAnchor)) {
getDrawCv().handleDrawElement(elm,(Element)hnodeBlock, getDrawParser().handleDrawElement(elm,(Element)hnodeBlock,
(Element)hnodeInline,nFloatMode); (Element)hnodeInline,nFloatMode);
} }
else if (DRAW_TEXT_BOX.equals(sTag)) { else if (DRAW_TEXT_BOX.equals(sTag)) {
getDrawCv().handleDrawElement(elm,(Element)hnodeBlock, getDrawParser().handleDrawElement(elm,(Element)hnodeBlock,
(Element)hnodeInline,DrawParser.INLINE); (Element)hnodeInline,DrawParser.INLINE);
} }
} }
@ -753,11 +753,11 @@ public class TextParser extends Parser {
case Node.ELEMENT_NODE: case Node.ELEMENT_NODE:
String sName = child.getNodeName(); String sName = child.getNodeName();
if (OfficeReader.isDrawElement(child)) { if (OfficeReader.isDrawElement(child)) {
Element elm = getDrawCv().getRealDrawElement((Element) child); Element elm = getDrawParser().getRealDrawElement((Element) child);
if (elm != null) { if (elm != null) {
String sAnchor = (elm.getAttribute(TEXT_ANCHOR_TYPE)); String sAnchor = (elm.getAttribute(TEXT_ANCHOR_TYPE));
if ("as-char".equals(sAnchor)) { 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)) { } else if (child.getNodeName().equals(TEXT_S)) {
@ -1397,7 +1397,7 @@ public class TextParser extends Parser {
//Create header element //Create header element
Element headerElement = converter.createElement("header"); Element headerElement = converter.createElement("header");
if (marginBottom != null) { 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(); Node pageNode = node.getParentNode();
pageNode.insertBefore(headerElement, node); pageNode.insertBefore(headerElement, node);
@ -1431,7 +1431,7 @@ public class TextParser extends Parser {
//Create footer element //Create footer element
Element footerElement = converter.createElement("footer"); Element footerElement = converter.createElement("footer");
if (marginTop != null) { 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(); Node pageNode = node.getParentNode();
pageNode.appendChild(footerElement); pageNode.appendChild(footerElement);

View file

@ -78,9 +78,9 @@ public class CellStyleParser extends StyleWithPropertiesParser {
*/ */
public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) {
// Apply "inner" box properties (no margins) // Apply "inner" box properties (no margins)
getFrameSc().cssBorder(style,props,bInherit); getFrameSP().cssBorder(style,props,bInherit);
getFrameSc().cssPadding(style,props,bInherit); getFrameSP().cssPadding(style,props,bInherit);
getFrameSc().cssBackground(style,props,bInherit); getFrameSP().cssBackground(style,props,bInherit);
// only relevant for spreadsheets // only relevant for spreadsheets
getParSP().cssPar(style,props,bInherit); getParSP().cssPar(style,props,bInherit);
getTextSP().cssTextCommon(style,props,bInherit); getTextSP().cssTextCommon(style,props,bInherit);

View file

@ -96,7 +96,7 @@ public class FrameStyleParser extends StyleWithPropertiesParser {
public String composeDeclarationBlock( String sDisplayName) { public String composeDeclarationBlock( String sDisplayName) {
StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(sDisplayName); StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(sDisplayName);
Properties props = new Properties(";"); Properties props = new Properties(";");
getFrameSc().cssMargins(style, props, true); getFrameSP().cssMargins(style, props, true);
getParSP().cssPar(style, props, true); getParSP().cssPar(style, props, true);
getTextSP().cssTextCommon(style, props, true); getTextSP().cssTextCommon(style, props, true);
return props.toString(); return props.toString();

View file

@ -177,7 +177,7 @@ public class PageStyleParser extends StyleParser {
MasterPage masterPage = ofr.getFirstMasterPage(); MasterPage masterPage = ofr.getFirstMasterPage();
PageLayout pageLayout = ofr.getPageLayout(masterPage.getPageLayoutName()); PageLayout pageLayout = ofr.getPageLayout(masterPage.getPageLayoutName());
StyleInfo pageInfo = new StyleInfo(); StyleInfo pageInfo = new StyleInfo();
getFrameSc().cssBackground(pageLayout, pageInfo.props, true); getFrameSP().cssBackground(pageLayout, pageInfo.props, true);
String pageDeclaration = pageInfo.props.toString(); String pageDeclaration = pageInfo.props.toString();
return pageDeclaration; return pageDeclaration;
} }
@ -210,7 +210,7 @@ public class PageStyleParser extends StyleParser {
if (pageLayout!=null) { if (pageLayout!=null) {
applyDirection(pageLayout,info); applyDirection(pageLayout,info);
cssPageSize(pageLayout,info.props); cssPageSize(pageLayout,info.props);
getFrameSc().cssBackground(pageLayout,info.props,true); getFrameSP().cssBackground(pageLayout,info.props,true);
} }
// Next apply drawing-page style (draw background) // Next apply drawing-page style (draw background)
StyleWithProperties drawingPage = ofr.getDrawingPageStyle(style.getProperty(XMLString.DRAW_STYLE_NAME)); StyleWithProperties drawingPage = ofr.getDrawingPageStyle(style.getProperty(XMLString.DRAW_STYLE_NAME));

View file

@ -83,10 +83,10 @@ public class ParStyleParser extends StyleWithPropertiesParser {
*/ */
public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) {
cssPageBreak(style, props, bInherit); cssPageBreak(style, props, bInherit);
getFrameSc().cssMargins(style, props, bInherit); getFrameSP().cssMargins(style, props, bInherit);
getFrameSc().cssBorder(style, props, bInherit); getFrameSP().cssBorder(style, props, bInherit);
getFrameSc().cssPadding(style, props, bInherit); getFrameSP().cssPadding(style, props, bInherit);
getFrameSc().cssBackgroundCommon(style, props, bInherit); getFrameSP().cssBackgroundCommon(style, props, bInherit);
cssPar(style, props, bInherit); cssPar(style, props, bInherit);
getTextSP().cssTextCommon(style, props, bInherit); getTextSP().cssTextCommon(style, props, bInherit);
} }

View file

@ -122,7 +122,7 @@ public class PresentationStyleParser extends FrameStyleParser {
public String composeDeclarationBlock(String displayName) { public String composeDeclarationBlock(String displayName) {
StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(displayName); StyleWithProperties style = (StyleWithProperties) getStyles().getStyleByDisplayName(displayName);
Properties props = new Properties(";"); Properties props = new Properties(";");
getFrameSc().cssMargins(style, props, true); getFrameSP().cssMargins(style, props, true);
getParSP().cssPar(style, props, true); getParSP().cssPar(style, props, true);
getTextSP().cssTextCommon(style, props, true); getTextSP().cssTextCommon(style, props, true);
return props.toString(); return props.toString();

View file

@ -77,7 +77,7 @@ public class RowStyleParser extends StyleWithPropertiesParser {
* @param bInherit true if properties should be inherited from parent style(s) * @param bInherit true if properties should be inherited from parent style(s)
*/ */
public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) {
getFrameSc().cssBackground(style,props,bInherit); getFrameSP().cssBackground(style,props,bInherit);
} }
} }

View file

@ -81,7 +81,7 @@ public class SectionStyleParser extends StyleWithPropertiesParser {
* @param bInherit true if properties should be inherited from parent style(s) * @param bInherit true if properties should be inherited from parent style(s)
*/ */
public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) { public void applyProperties(StyleWithProperties style, Properties props, boolean bInherit) {
getFrameSc().cssBox(style,props,bInherit); getFrameSP().cssBox(style,props,bInherit);
} }
} }

View file

@ -94,23 +94,23 @@ public class Styles extends Parser {
public ParStyleParser getParSP() { return parStyleParser; } 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 /** Apply the default language of the source document on an XHTML element
* *

View file

@ -80,7 +80,7 @@ public class TableStyleParser extends StyleWithPropertiesParser {
// Page break // Page break
getParSP().cssPageBreak(style, props, bInherit); getParSP().cssPageBreak(style, props, bInherit);
// Apply background // Apply background
getFrameSc().cssBackground(style,props,bInherit); getFrameSP().cssBackground(style,props,bInherit);
// Table-specific properties // Table-specific properties
cssTable(style,props,bInherit); cssTable(style,props,bInherit);
} }