diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index 4335790..b6727ef 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,12 @@ Changelog for Writer2LaTeX version 1.2 -> 1.4 ---------- version 1.3.2 alpha ---------- +[w2l] Replace usage of StringBuffer with StringBuilder everywhere (marginal optimization) + +[w2l] The standard configurations pdfprint.xml and pdfscreen.xml no longer requires ooomath.sty + +[w2l] A bookmark in a heading no longer results in an optional argument to \section commands + [w2l] New option display_hidden_text (default false) to toggle whether or not hidden text should be included in the export (there is currently no user interface for this option) diff --git a/source/java/org/openoffice/da/comp/w2lcommon/filter/ConfigurationDialogBase.java b/source/java/org/openoffice/da/comp/w2lcommon/filter/ConfigurationDialogBase.java index 2759972..ce2ed2f 100644 --- a/source/java/org/openoffice/da/comp/w2lcommon/filter/ConfigurationDialogBase.java +++ b/source/java/org/openoffice/da/comp/w2lcommon/filter/ConfigurationDialogBase.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * -* Version 1.4 (2014-08-05) +* Version 1.4 (2014-09-16) * */ @@ -437,7 +437,7 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta if (xIs!=null) { InputStream is = new XInputStreamToInputStreamAdapter(xIs); BufferedReader reader = new BufferedReader(new InputStreamReader(is)); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); String sLine; try { while ((sLine = reader.readLine())!=null) { diff --git a/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java b/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java index 4fff391..4d9493d 100644 --- a/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java +++ b/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.3.1 (2014-08-04) + * Version 1.4 (2014-09-16) * */ @@ -403,7 +403,7 @@ public abstract class OptionsDialogBase extends DialogBase implements Object resources = XPropertySetHelper.getPropertyValue(xCfgProps,"Resources"); XNameAccess xResourceNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,resources); if (xResourceNameAccess!=null) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); String[] sResourceNames = xResourceNameAccess.getElementNames(); for (String sName : sResourceNames) { Object resource = xResourceNameAccess.getByName(sName); diff --git a/source/java/org/openoffice/da/comp/writer2latex/ConfigurationDialog.java b/source/java/org/openoffice/da/comp/writer2latex/ConfigurationDialog.java index cf8d14f..bfd2b9f 100644 --- a/source/java/org/openoffice/da/comp/writer2latex/ConfigurationDialog.java +++ b/source/java/org/openoffice/da/comp/writer2latex/ConfigurationDialog.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2012 by Henrik Just + * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2012-03-12) + * Version 1.4 (2014-09-16) * */ @@ -434,7 +434,7 @@ public final class ConfigurationDialog extends ConfigurationDialogBase implement sNextItems[i]=internalNames.get(sNextItems[i]); } } - StringBuffer list = new StringBuffer(); + StringBuilder list = new StringBuilder(); for (int i=0; i0) list.append(';'); list.append(sNextItems[i]); diff --git a/source/java/org/openoffice/da/comp/writer4latex/ApplicationsDialog.java b/source/java/org/openoffice/da/comp/writer4latex/ApplicationsDialog.java index e7bc53b..2290bde 100644 --- a/source/java/org/openoffice/da/comp/writer4latex/ApplicationsDialog.java +++ b/source/java/org/openoffice/da/comp/writer4latex/ApplicationsDialog.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2010 by Henrik Just + * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2010-10-10) + * Version 1.4 (2014-09-16) * */ @@ -229,7 +229,7 @@ public final class ApplicationsDialog } // Unix: Configure a certain application, reporting the availability - private boolean configureApp(String sName, String sAppName, String sArguments, StringBuffer info) { + private boolean configureApp(String sName, String sAppName, String sArguments, StringBuilder info) { if (hasApp(sAppName)) { externalApps.setApplication(sName, sAppName, sArguments); info.append("Found "+sAppName+" - OK\n"); @@ -244,7 +244,7 @@ public final class ApplicationsDialog // Unix: Configure a certain application testing the availability // This variant uses an array of potential apps - private boolean configureApp(String sName, String[] sAppNames, String sArguments, StringBuffer info) { + private boolean configureApp(String sName, String[] sAppNames, String sArguments, StringBuilder info) { for (String sAppName : sAppNames) { if (configureApp(sName, sAppName, sArguments)) { info.append("Found "+sName+": "+sAppName+" - OK\n"); @@ -266,7 +266,7 @@ public final class ApplicationsDialog } // Windows: Configure a certain MikTeX application - private boolean configureMikTeX(String sPath, String sName, String sAppName, String sArguments, StringBuffer info, boolean bRequired) { + private boolean configureMikTeX(String sPath, String sName, String sAppName, String sArguments, StringBuilder info, boolean bRequired) { File app = new File(new File(sPath),sAppName+".exe"); if (app.exists()) { externalApps.setApplication(sName, sAppName, sArguments); @@ -285,7 +285,7 @@ public final class ApplicationsDialog String sOsName = System.getProperty("os.name"); String sOsVersion = System.getProperty("os.version"); String sOsArch = System.getProperty("os.arch"); - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); info.append("Results of configuration:\n\n"); info.append("Your system identifies itself as "+sOsName+" version "+sOsVersion+ " (" + sOsArch +")\n\n"); if (sOsName.startsWith("Windows")) { diff --git a/source/java/org/openoffice/da/comp/writer4latex/LogViewerDialog.java b/source/java/org/openoffice/da/comp/writer4latex/LogViewerDialog.java index 763263e..9770129 100644 --- a/source/java/org/openoffice/da/comp/writer4latex/LogViewerDialog.java +++ b/source/java/org/openoffice/da/comp/writer4latex/LogViewerDialog.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2011 by Henrik Just + * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2011-02-23) + * Version 1.4 (2014-09-16) * */ @@ -117,7 +117,7 @@ public class LogViewerDialog extends DialogBase // Utility methods private String readTextFile(String sUrl) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); try { File file = new File(new URI(sUrl)); if (file.exists() && file.isFile()) { diff --git a/source/java/writer2latex/api/ConverterFactory.java b/source/java/writer2latex/api/ConverterFactory.java index 0e129d6..df37d2c 100644 --- a/source/java/writer2latex/api/ConverterFactory.java +++ b/source/java/writer2latex/api/ConverterFactory.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.4 (2014-09-08) + * Version 1.4 (2014-09-16) * */ @@ -33,7 +33,7 @@ public class ConverterFactory { // Version information private static final String VERSION = "1.3.2"; - private static final String DATE = "2014-09-08"; + private static final String DATE = "2014-09-16"; /** Return the Writer2LaTeX version in the form * (major version).(minor version).(patch level)
diff --git a/source/java/writer2latex/base/ImageConverter.java b/source/java/writer2latex/base/ImageConverter.java index 6d73b40..7631c09 100644 --- a/source/java/writer2latex/base/ImageConverter.java +++ b/source/java/writer2latex/base/ImageConverter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.4 (2014-09-05) + * Version 1.4 (2014-09-16) * */ @@ -240,7 +240,7 @@ public final class ImageConverter { if (blob==null) { Node obd = Misc.getChildByTagName(node,XMLString.OFFICE_BINARY_DATA); if (obd!=null) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); NodeList nl = obd.getChildNodes(); int nLen = nl.getLength(); for (int i=0; i nodes; // The collection of all nodes in this portion - private StringBuffer curText; // The currently active node (always the last node) + private StringBuilder curText; // The currently active node (always the last node) private boolean bEmpty; // Is the active node empty? private boolean bWrap; // Do we allow line wrap in this portion? @@ -50,7 +50,7 @@ public class LaTeXDocumentPortion { public LaTeXDocumentPortion(boolean bWrap){ this.bWrap = bWrap; nodes = new Vector(); - curText = new StringBuffer(); + curText = new StringBuilder(); bEmpty = true; } @@ -63,7 +63,7 @@ public class LaTeXDocumentPortion { if (!bEmpty) { // add the current node to the node list and create new current node nodes.add(curText); - curText = new StringBuffer(); + curText = new StringBuilder(); bEmpty = true; } nodes.add(ldp); @@ -96,8 +96,8 @@ public class LaTeXDocumentPortion { for (int i=nStart; i0) { - writeBuffer((StringBuffer) nodes.get(i),osw,nLineLen,sNewline); + writeBuffer((StringBuilder) nodes.get(i),osw,nLineLen,sNewline); } else { - writeBuffer((StringBuffer) nodes.get(i),osw,sNewline); + writeBuffer((StringBuilder) nodes.get(i),osw,sNewline); } } if (!bEmpty) { // write current node as well @@ -214,14 +214,14 @@ public class LaTeXDocumentPortion { * @return a string representation of the LaTeXDocumentPortion */ public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int n = nodes.size(); for (int i=0; i=5){ bufExpression.append(relation(fSize,eAlign)); } @@ -1134,7 +1134,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert } private String relation(float fSize, Token eAlign){ - StringBuffer bufRelation=new StringBuffer().append(sum(fSize,eAlign)); + StringBuilder bufRelation=new StringBuilder().append(sum(fSize,eAlign)); while (tokenInGroup(TGroup.RELATION)){ if (curToken.eType==Token.TRANSL) { bMultimapdotbothA=true; } else if (curToken.eType==Token.TRANSR) { bMultimapdotbothB=true; } @@ -1145,7 +1145,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert } private String sum(float fSize, Token eAlign){ - StringBuffer bufSum=new StringBuffer().append(product(fSize,eAlign)); + StringBuilder bufSum=new StringBuilder().append(product(fSize,eAlign)); while (tokenInGroup(TGroup.SUM)){ bufSum.append(opsubsup(fSize,eAlign)).append(product(fSize,eAlign)); } @@ -1262,7 +1262,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert } private String blank(){ - StringBuffer bufBlank=new StringBuffer(); + StringBuilder bufBlank=new StringBuilder(); while (tokenInGroup(TGroup.BLANK)){ bufBlank.append(curToken.sLaTeX); nextToken(); @@ -1608,7 +1608,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert private String stack(float fSize, Token eAlign){ nextToken(); if (curToken.eType==Token.LGROUP){ - StringBuffer bufStack=new StringBuffer().append("\\begin{matrix}"); + StringBuilder bufStack=new StringBuilder().append("\\begin{matrix}"); nextToken(); bufStack.append(align(fSize,eAlign,true,true)); while (curToken.eType==Token.POUND) { @@ -1631,7 +1631,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert private String matrix(float fSize, Token eAlign){ nextToken(); if (curToken.eType==Token.LGROUP){ - StringBuffer bufMatrix = new StringBuffer().append("\\begin{matrix}"); + StringBuilder bufMatrix = new StringBuilder().append("\\begin{matrix}"); int nCols = 1; boolean bProtect = false; do { diff --git a/source/java/writer2latex/latex/TableFormatter.java b/source/java/writer2latex/latex/TableFormatter.java index 1361d2d..fa694fe 100644 --- a/source/java/writer2latex/latex/TableFormatter.java +++ b/source/java/writer2latex/latex/TableFormatter.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2011 by Henrik Just + * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2011-04-20) + * Version 1.4 (2014-09-16) * */ @@ -402,7 +402,7 @@ public class TableFormatter extends ConverterHelper { return "\\hline"; } else { // individual borders for each column - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("\\hhline{"); for (int nCol=0; nCol