w2x hidden text and split on page breaks + some w2l bugfixes

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@77 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2010-11-22 18:51:18 +00:00
parent 2174e5cbf5
commit a3a6b0befc
18 changed files with 202 additions and 94 deletions

View file

@ -2,7 +2,7 @@
############################################################################
# This is the Ant build file for writer2latex
# Original: Sep 2004 (mgn)
# version 1.2 (2010-10-01)
# version 1.2 (2010-11-20)
############################################################################
-->
<project name="w2l" default="help" basedir=".">
@ -35,7 +35,7 @@
<!-- configure the directories -->
<property name="jarfile" value="writer2latex"/>
<property name="basename" value="writer2latex11"/>
<property name="distrofile" value="${basename}5alpha.zip" />
<property name="distrofile" value="${basename}9beta.zip" />
<!--<property name="sourcedistrofile" value="${basename}source.zip" />-->
<property name="src" location="source/java"/>
<property name="source.distro" location="source/distro" />

View file

@ -1,7 +1,7 @@
Writer2LaTeX version 1.1.5 (development release)
================================================
Writer2LaTeX version 1.1.9 (beta test release)
==============================================
This is the distribution of Writer2LaTeX version 1.1.5
This is the distribution of Writer2LaTeX version 1.1.9
Latest version can be found at the web site
http://writer2latex.sourceforge.net
@ -14,5 +14,5 @@ Bugs and feature requests should be reported to
henrikjust (at) openoffice.org
October 2010
November 2010
Henrik Just

View file

@ -1,5 +1,23 @@
Changelog for Writer2LaTeX version 1.0 -> 1.2
---------- version 1.1.9 ----------
[w2x] New option page_break_split with values none (default), styles (split on page breaks defined by a style),
explicit (split on all explicit page breaks, manual or defined by a style), all (split on all page breaks, including
soft page breaks (will not split until current paragraph, table or list is finished))
[w2x] New option display_hidden_text (default false) to export sections, paragraphs and text marked as hidden
[w2l] Bugfix: Export footnote configuration before other styles (otherwise some definitions may be lost)
[w2l] XeTeX bugfix: AMS packages should be loaded before fontspec
[w2l] XeTeX bugfix: Corrected translation of apostrophe (') and tilde (~) and removed unnecessary translations
[w2l] Bugfix: Formatting attribute map for italic created with the configuration dialog did not work
[w2l] Bugfix: Character formatting in footnotes and endnotes was sometimes lost
---------- version 1.1.5 ----------
[w2x] Automatic split of files in EPUB export after 150000 characters (to avoid problems with some EPUB readers

Binary file not shown.

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2009 by Henrik Just
* Copyright: 2002-2010 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2009-11-19)
* Version 1.2 (2010-11-21)
*
*/
@ -73,7 +73,7 @@ public final class ConfigurationDialog extends WeakBase
private String[] sFamilyNames = { "text", "paragraph", "paragraph-block", "list", "listitem" };
private String[] sOOoFamilyNames = { "CharacterStyles", "ParagraphStyles", "ParagraphStyles", "NumberingStyles", "NumberingStyles" };
private String[] sAttributeNames = { "bold", "italics", "small-caps", "superscript", "subscipt" };
private String[] sAttributeNames = { "bold", "italic", "small-caps", "superscript", "subscipt" };
private XComponentContext xContext;
private XSimpleFileAccess2 sfa2;

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-30)
* Version 1.2 (2010-11-21)
*
*/
@ -32,8 +32,8 @@ package writer2latex.api;
public class ConverterFactory {
// Version information
private static final String VERSION = "1.1.5";
private static final String DATE = "2010-10-30";
private static final String VERSION = "1.1.9";
private static final String DATE = "2010-11-22";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-28)
* Version 1.2 (2010-11-21)
*
*/
@ -206,6 +206,7 @@ public final class ConverterPalette extends ConverterBase {
// Add declarations from our helpers
i18n.appendDeclarations(packages,declarations);
colorCv.appendDeclarations(packages,declarations);
noteCv.appendDeclarations(packages,declarations);
charSc.appendDeclarations(packages,declarations);
headingCv.appendDeclarations(packages,declarations);
parCv.appendDeclarations(packages,declarations);
@ -216,7 +217,6 @@ public final class ConverterPalette extends ConverterBase {
bibCv.appendDeclarations(packages,declarations);
sectionCv.appendDeclarations(packages,declarations);
tableCv.appendDeclarations(packages,declarations);
noteCv.appendDeclarations(packages,declarations);
captionCv.appendDeclarations(packages,declarations);
inlineCv.appendDeclarations(packages,declarations);
fieldCv.appendDeclarations(packages,declarations);

View file

@ -16,14 +16,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2008 by Henrik Just
* Copyright: 2002-2010 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.0 (2008-11-23)
* Version 1.2 (2010-11-21)
*
*/
// TODO: Get the styles for footnotes and endnotes and use Context.resetFormattingFromStyle...
package writer2latex.latex;
import java.util.LinkedList;
@ -276,6 +278,8 @@ public class NoteConverter extends ConverterHelper {
}
if (nodeName.equals(XMLString.TEXT_P)) {
StyleWithProperties style = ofr.getParStyle(node.getAttribute(XMLString.TEXT_STYLE_NAME));
oc.resetFormattingFromStyle(style);
palette.getInlineCv().traverseInlineText(child,ldp,oc);
if (i<len-1) {
if (nList.item(i+1).getNodeName().startsWith(XMLString.TEXT_)) {

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2009 by Henrik Just
* Copyright: 2002-2010 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2009-03-26)
* Version 1.2 (2010-11-21)
*
*/
@ -52,10 +52,11 @@ public class XeTeXI18n extends I18n {
* @param decl other declarations
*/
public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
pack.append("\\usepackage{fontspec}").nl()
pack.append("\\usepackage{amsmath,amssymb,amsfonts}").nl()
.append("\\usepackage{fontspec}").nl()
.append("\\usepackage{xunicode}").nl()
.append("\\usepackage{xltxtra}").nl()
.append("\\usepackage{amsmath,amssymb,amsfonts}").nl();
.append("\\usepackage{xltxtra}").nl();
}
/** Apply a language language
@ -94,22 +95,17 @@ public class XeTeXI18n extends I18n {
for (int i=0; i<nLen; i++) {
c = s.charAt(i);
switch (c) {
case '"' : buf.append("\\textquotedbl{}"); break;
case '#' : buf.append("\\#"); break;
case '$' : buf.append("\\$"); break;
case '%' : buf.append("\\%"); break;
case '&' : buf.append("\\&"); break;
case '\'' : buf.append("\\textbackslash{}"); break;
case '<' : buf.append("\\textless{}"); break;
case '>' : buf.append("\\textgreater{}"); break;
case '\\' : buf.append("\\textbackslash{}"); break;
case '\u005e' : buf.append("\\^{}"); break;
case '_' : buf.append("\\_"); break;
case '\u0060' : buf.append("\\textasciigrave{}"); break;
case '{' : buf.append("\\{"); break;
case '|' : buf.append("\\textbar{}"); break;
case '}' : buf.append("\\}"); break;
case '~' : buf.append("\\~{}"); break;
case '#' : buf.append("\\#"); break; // Parameter
case '$' : buf.append("\\$"); break; // Math shift
case '%' : buf.append("\\%"); break; // Comment
case '&' : buf.append("\\&"); break; // Alignment tab
case '\\' : buf.append("\\textbackslash{}"); break; // Escape
case '^' : buf.append("\\^{}"); break; // Superscript
case '_' : buf.append("\\_"); break; // Subscript
case '{' : buf.append("\\{"); break; // Begin group
case '}' : buf.append("\\}"); break; // End group
case '~' : buf.append("\\textasciitilde{}"); break; // Active (non-breaking space)
case '\u00A0' : buf.append('~'); break; // Make non-breaking spaces visible
default: buf.append(c);
}
}

View file

@ -50,6 +50,10 @@ public abstract class OfficeStyle {
public String getDisplayName() { return sDisplayName; }
public String getParentName() { return sParentName; }
public OfficeStyle getParentStyle() {
return family.getStyle(sParentName);
}
public String getListStyleName() { return sListStyleName; }

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-30)
* Version 1.2 (2010-11-22)
*
*/
@ -182,7 +182,7 @@ public class Converter extends ConverterBase {
outFiles = new Vector<XhtmlDocument>();
nOutFileIndex = -1;
bNeedHeaderFooter = !bOPS && (ofr.isSpreadsheet() || ofr.isPresentation() || config.getXhtmlSplitLevel()>0 || config.getXhtmlUplink().length()>0);
bNeedHeaderFooter = !bOPS && (ofr.isSpreadsheet() || ofr.isPresentation() || config.getXhtmlSplitLevel()>0 || config.pageBreakSplit()>XhtmlConfig.NONE || config.getXhtmlUplink().length()>0);
l10n = new L10n();
@ -306,7 +306,7 @@ public class Converter extends ConverterBase {
if (footer!=null) { footer.appendChild(footerPar); }
}
}
else if (ofr.isPresentation() || config.getXhtmlSplitLevel()>0) {
else if (nOutFileIndex>0) {
for (int i=0; i<=nOutFileIndex; i++) {
XhtmlDocument doc = outFiles.get(i);
Document dom = doc.getContentDOM();

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-30)
* Version 1.2 (2010-11-22)
*
*/
@ -41,6 +41,7 @@ import org.w3c.dom.Element;
import writer2latex.util.Misc;
import writer2latex.office.FontDeclaration;
import writer2latex.office.OfficeStyle;
import writer2latex.office.XMLString;
import writer2latex.office.IndexMark;
import writer2latex.office.ListCounter;
@ -83,9 +84,12 @@ public class TextConverter extends ConverterHelper {
// In any case very large files could be a performance problem, hence we do automatic splitting
// after this number of characters. TODO: Make configurable.
private static final int EPUB_CHARACTER_COUNT_TRESHOLD = 150000;
int nSplit = 0; // The outline level at which to split files (0=no split)
int nRepeatLevels = 5; // The number of levels to repeat when splitting (0=no repeat)
private int nLastSplitLevel = 1; // The outline level at which the last split occured
private int nPageBreakSplit = XhtmlConfig.NONE; // Should we split at page breaks?
// TODO: Collect soft page breaks between table rows
private boolean bPendingPageBreak = false; // We have encountered a page break which should be inserted asap
private int nSplit = 0; // The outline level at which to split files (0=no split)
private int nRepeatLevels = 5; // The number of levels to repeat when splitting (0=no repeat)
private int nLastSplitLevel = 1; // The outline level at which the last split occurred
private int nDontSplitLevel = 0; // if > 0 splitting is forbidden
boolean bAfterHeading=false; // last element was a top level heading
protected Stack<Node> sections = new Stack<Node>(); // stack of nested sections
@ -134,9 +138,13 @@ public class TextConverter extends ConverterHelper {
// When generating toc, a few things should be done differently
private boolean bInToc = false;
// Display hidden text?
private boolean bDisplayHiddenText = false;
public TextConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
super(ofr,config,converter);
nPageBreakSplit = config.pageBreakSplit();
nSplit = config.getXhtmlSplitLevel();
nRepeatLevels = config.getXhtmlRepeatLevels();
nFloatMode = ofr.isText() && config.xhtmlFloatObjects() ?
@ -153,6 +161,7 @@ public class TextConverter extends ConverterHelper {
sEntCitBodyStyle = notes.getProperty(XMLString.TEXT_CITATION_BODY_STYLE_NAME);
sEntCitStyle = notes.getProperty(XMLString.TEXT_CITATION_STYLE_NAME);
}
bDisplayHiddenText = config.displayHiddenText();
}
/** Converts an office node as a complete text document
@ -357,11 +366,12 @@ public class TextConverter extends ConverterHelper {
getDrawCv().handleDrawElement((Element)child,(Element)hnode,null,nFloatMode);
}
else if (nodeName.equals(XMLString.TEXT_P)) {
hnode = maybeSplit(hnode);
StyleWithProperties style = ofr.getParStyle(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME));
hnode = maybeSplit(hnode, style);
nCharacterCount+=OfficeReader.getCharacterCount(child);
// is there a block element, we should use?
XhtmlStyleMap xpar = config.getXParStyleMap();
String sDisplayName = ofr.getParStyles().getDisplayName(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME));
String sDisplayName = style!=null ? style.getDisplayName() : null;
if (sDisplayName!=null && xpar.contains(sDisplayName)) {
Node curHnode = hnode;
@ -400,9 +410,10 @@ public class TextConverter extends ConverterHelper {
}
}
else if(nodeName.equals(XMLString.TEXT_H)) {
StyleWithProperties style = ofr.getParStyle(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME));
int nOutlineLevel = getOutlineLevel((Element)child);
Node rememberNode = hnode;
hnode = maybeSplit(hnode,nOutlineLevel);
hnode = maybeSplit(hnode,style,nOutlineLevel);
nCharacterCount+=OfficeReader.getCharacterCount(child);
handleHeading((Element)child,hnode,rememberNode!=hnode);
}
@ -410,7 +421,7 @@ public class TextConverter extends ConverterHelper {
nodeName.equals(XMLString.TEXT_UNORDERED_LIST) || // old
nodeName.equals(XMLString.TEXT_ORDERED_LIST)) // old
{
hnode = maybeSplit(hnode);
hnode = maybeSplit(hnode,null);
if (listIsOnlyHeadings(child)) {
nDontSplitLevel--;
hnode = handleFakeList(child,nLevel+1,styleName,hnode);
@ -421,21 +432,22 @@ public class TextConverter extends ConverterHelper {
}
}
else if (nodeName.equals(XMLString.TABLE_TABLE)) {
hnode = maybeSplit(hnode);
StyleWithProperties style = ofr.getTableStyle(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME));
hnode = maybeSplit(hnode,style);
getTableCv().handleTable(child,hnode);
}
else if (nodeName.equals(XMLString.TABLE_SUB_TABLE)) {
getTableCv().handleTable(child,hnode);
}
else if (nodeName.equals(XMLString.TEXT_SECTION)) {
hnode = maybeSplit(hnode);
hnode = maybeSplit(hnode,null);
nDontSplitLevel--;
hnode = handleSection(child,hnode);
nDontSplitLevel++;
}
else if (nodeName.equals(XMLString.TEXT_TABLE_OF_CONTENT)) {
if (!ofr.getTocReader((Element)child).isByChapter()) {
hnode = maybeSplit(hnode,1);
hnode = maybeSplit(hnode,null,1);
}
handleTOC(child,hnode);
}
@ -452,13 +464,16 @@ public class TextConverter extends ConverterHelper {
handleUserIndex(child,hnode);
}
else if (nodeName.equals(XMLString.TEXT_ALPHABETICAL_INDEX)) {
hnode = maybeSplit(hnode,1);
hnode = maybeSplit(hnode,null,1);
handleAlphabeticalIndex(child,hnode);
}
else if (nodeName.equals(XMLString.TEXT_BIBLIOGRAPHY)) {
hnode = maybeSplit(hnode,1);
hnode = maybeSplit(hnode,null,1);
handleBibliography(child,hnode);
}
else if (nodeName.equals(XMLString.TEXT_SOFT_PAGE_BREAK)) {
if (nPageBreakSplit==XhtmlConfig.ALL) { bPendingPageBreak = true; }
}
else if (nodeName.equals(XMLString.OFFICE_ANNOTATION)) {
converter.handleOfficeAnnotation(child,hnode);
}
@ -477,18 +492,55 @@ public class TextConverter extends ConverterHelper {
return hnode;
}
private Node maybeSplit(Node node) {
if (converter.isOPS() && nCharacterCount>EPUB_CHARACTER_COUNT_TRESHOLD) {
return doMaybeSplit(node, 0);
}
return node;
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(XMLString.FO_BREAK_BEFORE))) {
return true;
}
if ("page".equals(style.getProperty(XMLString.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;
}
private Node maybeSplit(Node node, int nLevel) {
private Node maybeSplit(Node node, StyleWithProperties style) {
return maybeSplit(node,style,-1);
}
private Node maybeSplit(Node node, StyleWithProperties style, int nLevel) {
if (bPendingPageBreak) {
return doMaybeSplit(node, 0);
}
if (getPageBreak(style)) {
return doMaybeSplit(node, 0);
}
if (converter.isOPS() && nCharacterCount>EPUB_CHARACTER_COUNT_TRESHOLD) {
return doMaybeSplit(node, 0);
}
return doMaybeSplit(node, nLevel);
if (nLevel>=0) {
return doMaybeSplit(node, nLevel);
}
else {
return node;
}
}
private Node doMaybeSplit(Node node, int nLevel) {
@ -504,6 +556,7 @@ public class TextConverter extends ConverterHelper {
if (nSplit>=nLevel && converter.outFileHasContent()) {
// No objections, this is a level that causes splitting
nCharacterCount = 0;
bPendingPageBreak = false;
return converter.nextOutFile();
}
return node;
@ -511,6 +564,8 @@ public class TextConverter extends ConverterHelper {
/* 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:
if (!bDisplayHiddenText && "none".equals(Misc.getAttribute(onode,XMLString.TEXT_DISPLAY))) { return hnode; }
String sName = Misc.getAttribute(onode,XMLString.TEXT_NAME);
String sStyleName = Misc.getAttribute(onode,XMLString.TEXT_STYLE_NAME);
Element div = converter.createElement("div");
@ -541,9 +596,10 @@ public class TextConverter extends ConverterHelper {
ListStyle listStyle, int nListLevel, boolean bUnNumbered,
boolean bRestart, int nStartValue) {
String sStyleName = onode.getAttribute(XMLString.TEXT_STYLE_NAME);
StyleWithProperties style = ofr.getParStyle(sStyleName);
if (!bDisplayHiddenText && style!=null && "none".equals(style.getProperty(XMLString.TEXT_DISPLAY))) { return; }
if (!bUnNumbered) {
// If the heading uses a paragraph style which sets an explicit empty list style name, it's unnumbered
StyleWithProperties style = ofr.getParStyle(sStyleName);
if (style!=null) {
String sListStyleName = style.getListStyleName();
if (sListStyleName!=null && sListStyleName.length()==0) {
@ -551,6 +607,7 @@ public class TextConverter extends ConverterHelper {
}
}
}
// Note: nListLevel may in theory be different from the outline level,
// though the ui in OOo does not allow this
@ -662,6 +719,8 @@ public class TextConverter extends ConverterHelper {
boolean bIsEmpty = OfficeReader.isWhitespaceContent(onode);
if (config.ignoreEmptyParagraphs() && bIsEmpty) { return; }
String sStyleName = Misc.getAttribute(onode,XMLString.TEXT_STYLE_NAME);
StyleWithProperties style = ofr.getParStyle(sStyleName);
if (!bDisplayHiddenText && style!=null && "none".equals(style.getProperty(XMLString.TEXT_DISPLAY))) { return; }
Element par;
if (ofr.isSpreadsheet()) { // attach inline text directly to parent (always a table cell)
@ -1070,7 +1129,8 @@ public class TextConverter extends ConverterHelper {
nDontSplitLevel++;
int nOutlineLevel = getOutlineLevel((Element)onode);
Node rememberNode = hnode;
hnode = maybeSplit(hnode,nOutlineLevel);
StyleWithProperties style = ofr.getParStyle(Misc.getAttribute(child, XMLString.TEXT_STYLE_NAME));
hnode = maybeSplit(hnode,style,nOutlineLevel);
handleHeading((Element)child, hnode, rememberNode!=hnode,
ofr.getListStyle(sStyleName), nLevel,
bUnNumbered, bRestart, nStartValue);
@ -1535,6 +1595,9 @@ public class TextConverter extends ConverterHelper {
else if (sName.equals(XMLString.TEXT_BIBLIOGRAPHY_MARK)) {
handleBibliographyMark(child,hnode);
}
else if (sName.equals(XMLString.TEXT_SOFT_PAGE_BREAK)) {
if (nPageBreakSplit==XhtmlConfig.ALL) { bPendingPageBreak = true; }
}
else if (sName.equals(XMLString.OFFICE_ANNOTATION)) {
converter.handleOfficeAnnotation(child,hnode);
}
@ -1565,6 +1628,9 @@ public class TextConverter extends ConverterHelper {
}
private void handleSpan(Node onode, Node hnode) {
StyleWithProperties style = ofr.getTextStyle(Misc.getAttribute(onode, XMLString.TEXT_STYLE_NAME));
if (!bDisplayHiddenText && style!=null && "none".equals(style.getProperty(XMLString.TEXT_DISPLAY))) { return; }
if (!bInToc) {
String sStyleName = Misc.getAttribute(onode,XMLString.TEXT_STYLE_NAME);
Element span = createInline((Element) hnode,sStyleName);

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-06-20)
* Version 1.2 (2010-11-22)
*
*/
@ -41,7 +41,7 @@ import writer2latex.util.Misc;
public class XhtmlConfig extends writer2latex.base.ConfigBase {
// Implement configuration methods
protected int getOptionCount() { return 44; }
protected int getOptionCount() { return 46; }
protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; }
// Override setOption: To be backwards compatible, we must accept options
@ -76,6 +76,12 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public static final int IMAGE_STARMATH = 2;
public static final int IMAGE_LATEX = 3;
// Page breaks
public static final int NONE = 0;
public static final int STYLES = 1;
public static final int EXPLICIT = 2;
public static final int ALL = 3;
// Options
private static final int IGNORE_HARD_LINE_BREAKS = 0;
private static final int IGNORE_EMPTY_PARAGRAPHS = 1;
@ -99,28 +105,30 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int LIST_FORMATTING = 19;
private static final int USE_DUBLIN_CORE = 20;
private static final int NOTES = 21;
private static final int CONVERT_TO_PX = 22;
private static final int SCALING = 23;
private static final int COLUMN_SCALING = 24;
private static final int FLOAT_OBJECTS = 25;
private static final int TABSTOP_STYLE = 26;
private static final int FORMULAS = 27;
private static final int ENDNOTES_HEADING = 28;
private static final int SPLIT_LEVEL = 29;
private static final int REPEAT_LEVELS = 30;
private static final int CALC_SPLIT = 31;
private static final int DISPLAY_HIDDEN_SHEETS = 32;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 33;
private static final int DISPLAY_FILTERED_ROWS_COLS = 34;
private static final int APPLY_PRINT_RANGES = 35;
private static final int USE_TITLE_AS_HEADING = 36;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 37;
private static final int XSLT_PATH = 38;
private static final int SAVE_IMAGES_IN_SUBDIR = 39;
private static final int UPLINK = 40;
private static final int DIRECTORY_ICON = 41;
private static final int DOCUMENT_ICON = 42;
private static final int ZEN_HACK = 43; // temporary hack for ePub Zen Garden styles
private static final int DISPLAY_HIDDEN_TEXT = 22;
private static final int CONVERT_TO_PX = 23;
private static final int SCALING = 24;
private static final int COLUMN_SCALING = 25;
private static final int FLOAT_OBJECTS = 26;
private static final int TABSTOP_STYLE = 27;
private static final int FORMULAS = 28;
private static final int ENDNOTES_HEADING = 29;
private static final int SPLIT_LEVEL = 30;
private static final int REPEAT_LEVELS = 31;
private static final int PAGE_BREAK_SPLIT = 32;
private static final int CALC_SPLIT = 33;
private static final int DISPLAY_HIDDEN_SHEETS = 34;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 35;
private static final int DISPLAY_FILTERED_ROWS_COLS = 36;
private static final int APPLY_PRINT_RANGES = 37;
private static final int USE_TITLE_AS_HEADING = 38;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 39;
private static final int XSLT_PATH = 40;
private static final int SAVE_IMAGES_IN_SUBDIR = 41;
private static final int UPLINK = 42;
private static final int DIRECTORY_ICON = 43;
private static final int DOCUMENT_ICON = 44;
private static final int ZEN_HACK = 45; // temporary hack for ePub Zen Garden styles
protected ComplexOption xheading = addComplexOption("heading-map");
protected ComplexOption xpar = addComplexOption("paragraph-map");
@ -161,6 +169,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
};
options[USE_DUBLIN_CORE] = new BooleanOption("use_dublin_core","true");
options[NOTES] = new BooleanOption("notes","true");
options[DISPLAY_HIDDEN_TEXT] = new BooleanOption("display_hidden_text", "false");
options[CONVERT_TO_PX] = new BooleanOption("convert_to_px","true");
options[SCALING] = new Option("scaling","100%");
options[COLUMN_SCALING] = new Option("column_scaling","100%");
@ -188,8 +197,17 @@ 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[CALC_SPLIT] = new BooleanOption("calc_split","false");
options[DISPLAY_HIDDEN_SHEETS] = new BooleanOption("display_hidden_sheets","false");
options[DISPLAY_HIDDEN_SHEETS] = new BooleanOption("display_hidden_sheets", "false");
options[DISPLAY_HIDDEN_ROWS_COLS] = new BooleanOption("display_hidden_rows_cols","false");
options[DISPLAY_FILTERED_ROWS_COLS] = new BooleanOption("display_filtered_rows_cols","false");
options[APPLY_PRINT_RANGES] = new BooleanOption("apply_print_ranges","false");
@ -293,6 +311,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public int listFormatting() { return ((IntegerOption) options[LIST_FORMATTING]).getValue(); }
public boolean xhtmlUseDublinCore() { return ((BooleanOption) options[USE_DUBLIN_CORE]).getValue(); }
public boolean xhtmlNotes() { return ((BooleanOption) options[NOTES]).getValue(); }
public boolean displayHiddenText() { return ((BooleanOption) options[DISPLAY_HIDDEN_TEXT]).getValue(); }
public boolean xhtmlConvertToPx() { return ((BooleanOption) options[CONVERT_TO_PX]).getValue(); }
public String getXhtmlScaling() { return options[SCALING].getString(); }
public String getXhtmlColumnScaling() { return options[COLUMN_SCALING].getString(); }
@ -302,6 +321,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public int formulas() { return ((IntegerOption) options[FORMULAS]).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 boolean xhtmlCalcSplit() { return ((BooleanOption) options[CALC_SPLIT]).getValue(); }
public boolean xhtmlDisplayHiddenSheets() { return ((BooleanOption) options[DISPLAY_HIDDEN_SHEETS]).getValue(); }
public boolean displayHiddenRowsCols() { return ((BooleanOption) options[DISPLAY_HIDDEN_ROWS_COLS]).getValue(); }

View file

@ -5,7 +5,7 @@
<identifier value="org.openoffice.da.writer2latex.oxt"/>
<version value="1.1.5" />
<version value="1.1.9" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>

View file

@ -5,7 +5,7 @@
<identifier value="org.openoffice.da.writer2xhtml.oxt" />
<version value="1.1.5" />
<version value="1.1.9" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>

View file

@ -4,7 +4,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="org.openoffice.da.writer4latex.oxt" />
<version value="1.1.5" />
<version value="1.1.9" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>
</dependencies>

View file

@ -2,5 +2,5 @@
<description xmlns="http://openoffice.org/extensions/description/2006"
xmlns:d="http://openoffice.org/extensions/description/2006">
<identifier value="org.openoffice.da.writer2latex.xhtml-config-sample.oxt" />
<version value="1.1.5" />
<version value="1.1.9" />
</description>

View file

@ -1,4 +1,4 @@
Writer2LaTeX source version 1.1.5
Writer2LaTeX source version 1.1.9
=================================
Writer2LaTeX is (c) 2002-2010 by Henrik Just.
@ -53,7 +53,7 @@ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Fromiharder.sourceforge.net:
From iharder.sourceforge.net:
The class writer2latex.util.Base64 is Robert Harders public domain Base64 class
@ -95,7 +95,7 @@ In addition to oxt, the build file supports the following targets:
clean
Henrik Just, May 2010
Henrik Just, November 2010
Thanks to Michael Niedermair for writing the original ant build file