A few minor bugfixes and improvements

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@174 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2014-09-17 07:32:31 +00:00
parent 5d82772d91
commit 2fd6ccd490
35 changed files with 129 additions and 111 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.4 (2014-09-05)
* Version 1.4 (2014-09-16)
*
*/
@ -538,7 +538,7 @@ public class Converter extends ConverterBase {
/* get inline text, ignoring any draw objects, footnotes, formatting and hyperlinks */
protected String getPlainInlineText(Node node) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
Node child = node.getFirstChild();
while (child!=null) {
short nodeType = child.getNodeType();
@ -575,7 +575,7 @@ public class Converter extends ConverterBase {
public void handleOfficeAnnotation(Node onode, Node hnode) {
if (config.xhtmlNotes()) {
// Extract the text from the paragraphs, separate paragraphs with newline
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
Element creator = null;
Element date = null;
Node child = onode.getFirstChild();

View file

@ -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-17)
* Version 1.4 (2014-09-16)
*
*/
@ -75,7 +75,7 @@ public class CssDocument implements OutputFile {
public void read(InputStream is) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8"));
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
String sLine;
while ((sLine=reader.readLine())!=null) {
buf.append(sLine).append('\n');

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.4 (2014-09-07)
* Version 1.4 (2014-09-16)
*
*/
@ -62,7 +62,7 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
*/
public String getStyleDeclarations(String sIndent) {
if (bConvertStyles) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(super.getStyleDeclarations(sIndent));
Enumeration<String> names = styleNames.keys();
while (names.hasMoreElements()) {
@ -267,7 +267,7 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
// Scale the border with while preserving the rest of the attribute
public String borderScale(String sBorder) {
SimpleInputBuffer in = new SimpleInputBuffer(sBorder);
StringBuffer out = new StringBuffer();
StringBuilder out = new StringBuilder();
while (in.peekChar()!='\0') {
// Skip spaces
while(in.peekChar()==' ') { out.append(" "); in.getChar(); }
@ -287,7 +287,7 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
// Must escape certain characters in the url property
private String escapeUrl(String sUrl) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
int nLen = sUrl.length();
for (int i=0; i<nLen; i++) {
char c = sUrl.charAt(i);

View file

@ -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-05-09)
* Version 1.4 (2014-09-16)
*
*/package writer2latex.xhtml;
@ -42,7 +42,7 @@ public class HeadingStyleConverter extends StyleConverterHelper {
@Override
public String getStyleDeclarations(String sIndent) {
if (bConvertStyles) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i=1; i<=6; i++) {
if (ofr.getHeadingStyle(i)!=null) {
CSVList props = new CSVList(";");

View file

@ -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-07)
* Version 1.4 (2014-09-16)
*
*/
@ -86,7 +86,7 @@ public class ListStyleConverter extends StyleConverterHelper {
*/
public String getStyleDeclarations(String sIndent) {
if (bConvertStyles) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
Enumeration<String> names = styleNames.keys();
while (names.hasMoreElements()) {
String sDisplayName = names.nextElement();

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.4 (2014-09-01)
* Version 1.4 (2014-09-16)
*
*/
@ -259,7 +259,7 @@ public class MathConverter extends ConverterHelper {
// with real unicode positions.
private String replacePrivateChars(String s) {
int nLen = s.length();
StringBuffer buf = new StringBuffer(nLen);
StringBuilder buf = new StringBuilder(nLen);
for (int i=0; i<nLen; i++) {
buf.append(replacePrivateChar(s.charAt(i)));
}

View file

@ -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-03-21)
* Version 1.4 (2014-09-16)
*
*/
@ -130,7 +130,7 @@ public class PageStyleConverter extends StyleConverterHelper {
* @param sIndent a String of spaces to add before each line
*/
public String getStyleDeclarations(String sIndent) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
// This will be master pages for presentations only
Enumeration<String> names = styleNames.keys();

View file

@ -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-03-01)
* Version 1.4 (2014-09-16)
*
*/
@ -85,7 +85,7 @@ public class PresentationStyleConverter extends FrameStyleConverter {
*/
public String getStyleDeclarations(String sIndent) {
if (bConvertStyles) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(super.getStyleDeclarations(sIndent));
Enumeration<String> names = outlineStyleNames.keys();
while (names.hasMoreElements()) {

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.4 (2014-08-13)
* Version 1.4 (2014-09-16)
*
*/
@ -123,7 +123,7 @@ class StyleConverter extends ConverterHelper {
public String exportStyles(boolean bIndent) {
String sIndent = bIndent ? " " : "";
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
// Export default style
if (config.xhtmlCustomStylesheet().length()==0 &&

View file

@ -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-07)
* Version 1.4 (2014-09-16)
*
*/
@ -94,7 +94,7 @@ public abstract class StyleWithPropertiesConverterHelper
*/
public String getStyleDeclarations(String sIndent) {
if (bConvertStyles) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
Enumeration<String> names = styleNames.keys();
while (names.hasMoreElements()) {
String sDisplayName = names.nextElement();

View file

@ -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-12-29)
* Version 1.4 (2014-09-16)
*
*/
@ -136,7 +136,7 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
* @param sIndent a String of spaces to add before each line
*/
public String getStyleDeclarations(String sIndent) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(super.getStyleDeclarations(sIndent));
if (bConvertStyles) {
// Export anchor styles