Kaydet (Commit) 0439c518 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Stephan Bergmann

Java cleanup - remove unused local fields and variables and parameters

Change-Id: I5114bf2e390f3f5052819710329a789fc78c60f2
üst 59c05d03
...@@ -62,17 +62,8 @@ final class PocketExcelDecoder extends SpreadsheetDecoder { ...@@ -62,17 +62,8 @@ final class PocketExcelDecoder extends SpreadsheetDecoder {
/** /**
* Constructor creates a Pocket Excel WorkBook. * Constructor creates a Pocket Excel WorkBook.
*
* @param name The name of the WorkBook.
* @param worksheetNames set of Strings equivalent to the worksheets
* contained in the workbook
* @param password The password for the workBook.
*
* @throws IOException If any I/O error occurs.
*/ */
PocketExcelDecoder(String name, String[] worksheetNames, String password) throws IOException { PocketExcelDecoder() {
super(name, password);
fmt = new Format(); fmt = new Format();
} }
......
...@@ -43,15 +43,11 @@ final class PocketExcelEncoder extends SpreadsheetEncoder { ...@@ -43,15 +43,11 @@ final class PocketExcelEncoder extends SpreadsheetEncoder {
* Constructor creates a Pocket Excel WorkBook. * Constructor creates a Pocket Excel WorkBook.
* *
* @param name The name of the WorkBook. * @param name The name of the WorkBook.
* @param password The password for the WorkBook.
* *
* @throws IOException If any I/O error occurs. * @throws IOException If any I/O error occurs.
*/ */
PocketExcelEncoder(String name, String password) throws IOException { PocketExcelEncoder(String name) throws IOException {
super(name, password);
wb = new Workbook(name); wb = new Workbook(name);
} }
......
...@@ -63,8 +63,7 @@ public final class SxcDocumentDeserializerImpl extends SxcDocumentDeserializer { ...@@ -63,8 +63,7 @@ public final class SxcDocumentDeserializerImpl extends SxcDocumentDeserializer {
*/ */
public SpreadsheetDecoder createDecoder(String workbook, public SpreadsheetDecoder createDecoder(String workbook,
String[] worksheetNames, String password) throws IOException { String[] worksheetNames, String password) throws IOException {
return new PocketExcelDecoder();
return new PocketExcelDecoder(workbook, worksheetNames, password);
} }
......
...@@ -60,11 +60,11 @@ public final class SxcDocumentSerializerImpl extends SxcDocumentSerializer { ...@@ -60,11 +60,11 @@ public final class SxcDocumentSerializerImpl extends SxcDocumentSerializer {
// contain a path or the file extension. // contain a path or the file extension.
String docName = sxcDoc.getName(); String docName = sxcDoc.getName();
// TODO - get real values for password when implemnted in XML // TODO - get real values for password when implemented in XML
// Passwords are not currently stored in StarCalc XML format. // Passwords are not currently stored in StarCalc XML format.
String password = null; String password = null;
encoder = new PocketExcelEncoder(docName, password); encoder = new PocketExcelEncoder(docName);
// get dom document // get dom document
org.w3c.dom.Document domDoc = sxcDoc.getContentDOM(); org.w3c.dom.Document domDoc = sxcDoc.getContentDOM();
......
...@@ -140,7 +140,7 @@ final class WSDecoder implements DOCConstants { ...@@ -140,7 +140,7 @@ final class WSDecoder implements DOCConstants {
while (curIndex < rawData.length) { while (curIndex < rawData.length) {
if (WsePara.isValid(rawData, curIndex)) { if (WsePara.isValid(rawData, curIndex)) {
v.add(new WsePara(rawData, curIndex)); v.add(new WsePara(rawData, curIndex));
curIndex = WsePara.computeNewIndex(rawData, curIndex); curIndex = WsePara.computeNewIndex(curIndex);
} else if (WseTextRun.isValid(rawData, curIndex)) { } else if (WseTextRun.isValid(rawData, curIndex)) {
v.add(new WseTextRun(rawData, curIndex, fontTable, colorTable)); v.add(new WseTextRun(rawData, curIndex, fontTable, colorTable));
curIndex = WseTextRun.computeNewIndex(rawData, curIndex); curIndex = WseTextRun.computeNewIndex(rawData, curIndex);
......
...@@ -51,7 +51,6 @@ final class WSEncoder { ...@@ -51,7 +51,6 @@ final class WSEncoder {
private short version; private short version;
private int textLen; private int textLen;
private short maxRecSize; private short maxRecSize;
private int textRecCount = 0;
/* WordSmith document elements. */ /* WordSmith document elements. */
......
...@@ -28,37 +28,6 @@ package org.openoffice.xmerge.converter.xml.sxw.wordsmith; ...@@ -28,37 +28,6 @@ package org.openoffice.xmerge.converter.xml.sxw.wordsmith;
*/ */
abstract class Wse { abstract class Wse {
/**
* Return true if <code>dataArray[startIndex]</code> is the start
* of a valid element of this type.
*
* @param dataArray <code>byte</code> array.
* @param startIndex The start index.
*
* @return true if <code>dataArray[startIndex]</code> is the
* start of a valid element of this type, false otherwise.
*/
static boolean isValid(byte dataArray[], int startIndex) {
return false;
}
/**
* Compute and return the index of the first <code>byte</code>
* following this element. It is assumed that the element
* starting at <code>dataArray[startIndex]</code> is valid.
*
* @param dataArray <code>byte</code> array.
* @param startIndex The start index.
*
* @return The index of the first <code>byte</code> following
* this element.
*/
static int computeNewIndex(byte dataArray[], int startIndex) {
return 0;
}
/** /**
* Return the total number of bytes needed to represent this * Return the total number of bytes needed to represent this
* object. * object.
......
...@@ -84,12 +84,11 @@ class WseHeader extends Wse { ...@@ -84,12 +84,11 @@ class WseHeader extends Wse {
* following this element. It is assumed that the element * following this element. It is assumed that the element
* starting at <code>dataArray[startIndex]</code> is valid. * starting at <code>dataArray[startIndex]</code> is valid.
* *
* @param dataArray <code>byte</code> array.
* @param startIndex The start index. * @param startIndex The start index.
* *
* @return The first <code>byte</code> following this element. * @return The first <code>byte</code> following this element.
*/ */
static int computeNewIndex(byte dataArray[], int startIndex) { static int computeNewIndex(int startIndex) {
return startIndex + 18; return startIndex + 18;
} }
......
...@@ -155,13 +155,12 @@ class WsePara extends Wse { ...@@ -155,13 +155,12 @@ class WsePara extends Wse {
* <code>dataArray[startIndex]</code> is the beginning of a valid * <code>dataArray[startIndex]</code> is the beginning of a valid
* paragraph descriptor. * paragraph descriptor.
* *
* @param dataArray <code>byte</code> array.
* @param startIndex The start index. * @param startIndex The start index.
* *
* @return The index of the first <code>byte</code> following the * @return The index of the first <code>byte</code> following the
* paragraph description. * paragraph description.
*/ */
static int computeNewIndex(byte dataArray[], int startIndex) { static int computeNewIndex(int startIndex) {
return startIndex + 13; return startIndex + 13;
} }
......
...@@ -27,14 +27,12 @@ import org.openoffice.xmerge.util.Debug; ...@@ -27,14 +27,12 @@ import org.openoffice.xmerge.util.Debug;
abstract class conversionAlgorithm { abstract class conversionAlgorithm {
int I(String val) { abstract int I(String val);
return 0;
}
} }
/* /**
* This algorithm expects only values in millimeters, e.g. "20.3mm". * This algorithm expects only values in millimeters, e.g. "20.3mm".
*/ */
class horizSize extends conversionAlgorithm { class horizSize extends conversionAlgorithm {
int I(String value) { int I(String value) {
if (value.endsWith("mm")) { if (value.endsWith("mm")) {
......
...@@ -31,12 +31,6 @@ import org.openoffice.xmerge.ConvertData; ...@@ -31,12 +31,6 @@ import org.openoffice.xmerge.ConvertData;
*/ */
public abstract class SpreadsheetDecoder { public abstract class SpreadsheetDecoder {
/**
* Constructor for creating new <code>SpreadsheetDecoder</code>.
*/
public SpreadsheetDecoder(String name, String password) throws IOException {
}
/** /**
* Returns the total number of sheets in the WorkBook. * Returns the total number of sheets in the WorkBook.
* *
......
...@@ -32,17 +32,6 @@ import java.util.ArrayList; ...@@ -32,17 +32,6 @@ import java.util.ArrayList;
public abstract class SpreadsheetEncoder { public abstract class SpreadsheetEncoder {
/**
* Creates new SpreadsheetEncoder.
*
* @param name The name of the WorkBook to be created.
* @param password An optional password for the WorkBook.
*
* @throws IOException If any I/O error occurs.
*/
public SpreadsheetEncoder(String name, String password) throws IOException { }
/** /**
* Create a new WorkSheet within the WorkBook. * Create a new WorkSheet within the WorkBook.
* *
......
...@@ -130,14 +130,14 @@ public final class CharacterBaseParagraphMerge ...@@ -130,14 +130,14 @@ public final class CharacterBaseParagraphMerge
orgTextNode.endChar() + ">"); orgTextNode.endChar() + ">");
Debug.log(Debug.INFO, " extraChar value <" + extraChar + ">"); Debug.log(Debug.INFO, " extraChar value <" + extraChar + ">");
coreMerge(orgDiffCount, diffCount, diffs, orgParser, coreMerge(orgDiffCount, diffCount, diffs,
modParser, orgTextNode, extraChar); modParser, orgTextNode, extraChar);
} }
} }
} }
private void coreMerge(int startDiffNum, int endDiffNum, Difference[] diffs, private void coreMerge(int startDiffNum, int endDiffNum, Difference[] diffs,
CharacterParser orgParser, CharacterParser modParser, CharacterParser modParser,
TextNodeEntry orgTextNode, int extraChar) { TextNodeEntry orgTextNode, int extraChar) {
Node orgNode = orgTextNode.node(); Node orgNode = orgTextNode.node();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment