Removed deprecated code
This commit is contained in:
parent
50f3cd615a
commit
17742eacc3
4 changed files with 7 additions and 53 deletions
|
@ -253,7 +253,7 @@ public class Converter extends BasicConverter {
|
|||
outFiles = new Vector<XhtmlDocument>();
|
||||
outFileIndex = -1;
|
||||
|
||||
bNeedHeaderFooter = !bOPS && (ofr.isSpreadsheet() || ofr.isPresentation() || config.getXhtmlSplitLevel()>0 || config.pageBreakSplit()>XhtmlConfig.NONE || config.getXhtmlUplink().length()>0);
|
||||
bNeedHeaderFooter = !bOPS && (ofr.isSpreadsheet() || ofr.isPresentation() || config.getXhtmlSplitLevel()>0 || config.getXhtmlUplink().length()>0);
|
||||
|
||||
l10n = new L10n();
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import writer2latex.util.Misc;
|
|||
|
||||
public class XhtmlConfig extends writer2latex.base.ConfigBase {
|
||||
// Implement configuration methods
|
||||
protected int getOptionCount() { return 64; }
|
||||
protected int getOptionCount() { return 63; }
|
||||
protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; }
|
||||
|
||||
// Override setOption: To be backwards compatible, we must accept options
|
||||
|
@ -140,7 +140,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
|
|||
private static final int INCLUDE_NCX = 38;
|
||||
private static final int SPLIT_LEVEL = 39;
|
||||
private static final int REPEAT_LEVELS = 40;
|
||||
private static final int PAGE_BREAK_SPLIT = 41;
|
||||
private static final int CSS_INLINE = 41;
|
||||
private static final int SPLIT_AFTER = 42;
|
||||
private static final int IMAGE_SPLIT = 43;
|
||||
private static final int COVER_IMAGE = 44;
|
||||
|
@ -162,7 +162,6 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
|
|||
private static final int PAGE_TAGS = 60;
|
||||
private static final int MIN_LETTER_SPACING = 61;
|
||||
private static final int PAGE_BREAK_STYLE = 62;
|
||||
private static final int CSS_INLINE = 63;
|
||||
|
||||
protected ComplexOption xheading = addComplexOption("heading-map");
|
||||
protected ComplexOption xpar = addComplexOption("paragraph-map");
|
||||
|
@ -265,15 +264,6 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
|
|||
nValue = Misc.getPosInteger(sValue,0);
|
||||
}
|
||||
};
|
||||
options[PAGE_BREAK_SPLIT] = new IntegerOption("page_break_split", "none") {
|
||||
@Override public void setString(String sValue) {
|
||||
super.setString(sValue);
|
||||
if ("styles".equals(sValue)) { nValue = STYLES; }
|
||||
else if ("explicit".equals(sValue)) { nValue = EXPLICIT; }
|
||||
else if ("all".equals(sValue)) { nValue = ALL; }
|
||||
else { nValue = NONE; }
|
||||
}
|
||||
};
|
||||
options[SPLIT_AFTER] = new IntegerOption("split_after","0") {
|
||||
@Override public void setString(String sValue) {
|
||||
super.setString(sValue);
|
||||
|
@ -427,7 +417,6 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
|
|||
public boolean includeNCX() { return ((BooleanOption) options[INCLUDE_NCX]).getValue(); }
|
||||
public int getXhtmlSplitLevel() { return ((IntegerOption) options[SPLIT_LEVEL]).getValue(); }
|
||||
public int getXhtmlRepeatLevels() { return ((IntegerOption) options[REPEAT_LEVELS]).getValue(); }
|
||||
public int pageBreakSplit() { return ((IntegerOption) options[PAGE_BREAK_SPLIT]).getValue(); }
|
||||
public int splitAfter() { return ((IntegerOption) options[SPLIT_AFTER]).getValue(); }
|
||||
public String imageSplit() { return options[IMAGE_SPLIT].getString(); }
|
||||
public boolean coverImage() { return ((BooleanOption) options[COVER_IMAGE]).getValue(); }
|
||||
|
|
|
@ -22,7 +22,7 @@ public class Separator {
|
|||
private static final String SECTIONS = "sections";
|
||||
private static final String DIV = "div";
|
||||
private int splitLevel = 0;
|
||||
private boolean splitByPages = false;
|
||||
private boolean alignSplitToPages = false;
|
||||
private int lastSplitPageNum = 1;
|
||||
private Integer pageNumber = null;
|
||||
private String breakStyle = null;
|
||||
|
@ -44,7 +44,7 @@ public class Separator {
|
|||
headingSeparation = config.getHeadingTags();
|
||||
pageSeparation = config.getPageTags();
|
||||
splitLevel = config.getXhtmlSplitLevel();
|
||||
splitByPages = pageSeparation.equals(DIV) ? true : false;
|
||||
alignSplitToPages = pageSeparation.equals(DIV) ? true : false;
|
||||
breakStyle = config.getPageBreakStyle();
|
||||
pageContainer = converter.pageContainer;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class Separator {
|
|||
System.out.println("Error: node is null on openPageDiv");
|
||||
return node;
|
||||
}
|
||||
if (prevPageContainer != null && splitByPages) {
|
||||
if (prevPageContainer != null && alignSplitToPages) {
|
||||
alignFilesByHeadings(node,curPageNum);
|
||||
}
|
||||
breakPage(node,curPageNum);
|
||||
|
|
|
@ -64,7 +64,6 @@ public class TextParser extends Parser {
|
|||
// In any case very large files could be a performance problem, hence we do automatic splitting
|
||||
// after this number of characters.
|
||||
private int nSplitAfter = 150000;
|
||||
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 splitResultsLevel = 0; // The outline level at which to split files (0=no split)
|
||||
|
@ -140,7 +139,6 @@ public class TextParser extends Parser {
|
|||
footCv = new FootnoteParser(ofr, config, converter);
|
||||
endCv = new EndnoteParser(ofr, config, converter);
|
||||
nSplitAfter = 1000*config.splitAfter();
|
||||
nPageBreakSplit = config.pageBreakSplit();
|
||||
splitResultsLevel = config.getXhtmlSplitLevel();
|
||||
nRepeatLevels = converter.isOPS() ? 0 : config.getXhtmlRepeatLevels(); // never repeat headings in EPUB
|
||||
nFloatMode = ofr.isText() && config.xhtmlFloatObjects() ?
|
||||
|
@ -432,8 +430,7 @@ public class TextParser extends Parser {
|
|||
bibCv.handleIndex((Element)child,(Element)hnode);
|
||||
}
|
||||
else if (nodeName.equals(TEXT_SOFT_PAGE_BREAK)) {
|
||||
breakBeforeNextNode = true;
|
||||
if (nPageBreakSplit==XhtmlConfig.ALL) { bPendingPageBreak = true; }
|
||||
breakBeforeNextNode = true;
|
||||
}
|
||||
else if (nodeName.equals(OFFICE_ANNOTATION)) {
|
||||
converter.handleOfficeAnnotation(child,hnode);
|
||||
|
@ -454,35 +451,6 @@ public class TextParser extends Parser {
|
|||
return hnode;
|
||||
}
|
||||
|
||||
private boolean getPageBreak(StyleWithProperties style) {
|
||||
if (style!=null && nPageBreakSplit>XhtmlConfig.NONE) {
|
||||
// If we don't consider manual page breaks, we may have to consider the parent style
|
||||
if (style.isAutomatic() && nPageBreakSplit<XhtmlConfig.EXPLICIT) {
|
||||
OfficeStyle parentStyle = style.getParentStyle();
|
||||
if (parentStyle!=null && parentStyle instanceof StyleWithProperties) {
|
||||
style = (StyleWithProperties) parentStyle;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// A page break can be a simple page break before or after...
|
||||
if ("page".equals(style.getProperty(FO_BREAK_BEFORE))) {
|
||||
return true;
|
||||
}
|
||||
if ("page".equals(style.getProperty(FO_BREAK_AFTER))) {
|
||||
bPendingPageBreak = true;
|
||||
return false;
|
||||
}
|
||||
// ...or it can be a new master page
|
||||
String sMasterPage = style.getMasterPageName();
|
||||
if (sMasterPage!=null && sMasterPage.length()>0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process a text:section tag (returns current html node) */
|
||||
private Node handleSection(Node onode, Node hnode) {
|
||||
// Unlike headings, paragraphs and spans, text:display is not attached to the style:
|
||||
|
@ -1305,9 +1273,6 @@ public class TextParser extends Parser {
|
|||
else if (sName.equals(TEXT_BIBLIOGRAPHY_MARK)) {
|
||||
handleBibliographyMark(child,hnode);
|
||||
}
|
||||
else if (sName.equals(TEXT_SOFT_PAGE_BREAK)) {
|
||||
if (nPageBreakSplit==XhtmlConfig.ALL) { bPendingPageBreak = true; }
|
||||
}
|
||||
else if (sName.equals(OFFICE_ANNOTATION)) {
|
||||
converter.handleOfficeAnnotation(child,hnode);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue