[FOray-commit] SF.net SVN: foray: [8274] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-10-03 02:48:51
|
Revision: 8274
http://svn.sourceforge.net/foray/?rev=8274&view=rev
Author: victormote
Date: 2006-10-02 19:48:40 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -524,21 +524,21 @@
/**
* Indicates whether this font description matches a given style.
- * @param desiredStyle The style to match.
+ * @param inputDesiredStyle The style to match.
* @param considerSimulated Indicates whether simulated features should be
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean styleMatches(int desiredStyle,
+ public boolean styleMatches(final int inputDesiredStyle,
final boolean considerSimulated) {
- if (desiredStyle == FOrayFont.FONT_STYLE_ANY) {
+ if (inputDesiredStyle == FOrayFont.FONT_STYLE_ANY) {
return true;
}
if (considerSimulated) {
if (this.simulateOblique != Float.NaN) {
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
- switch (desiredStyle) {
+ switch (inputDesiredStyle) {
case FOrayFont.FONT_STYLE_NORMAL:
case FOrayFont.FONT_STYLE_ITALIC:
case FOrayFont.FONT_STYLE_OBLIQUE: {
@@ -550,7 +550,7 @@
int actualStyle = getFontStyle();
/* Check the easy case first. */
- if (actualStyle == desiredStyle) {
+ if (actualStyle == inputDesiredStyle) {
return true;
}
/* If they are not equal, we need to treat "oblique" and "italic" as
@@ -558,7 +558,8 @@
if (actualStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
actualStyle = FOrayFont.FONT_STYLE_ITALIC;
}
- if (desiredStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
+ int desiredStyle = inputDesiredStyle;
+ if (inputDesiredStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
desiredStyle = FOrayFont.FONT_STYLE_ITALIC;
}
/* Test it again. */
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -331,22 +331,22 @@
/**
* Converts a String representing a percentage to its decimal value.
- * @param input A String representing a percentage. It must end with the
- * "%" symbol.
+ * @param inputString A String representing a percentage. It must end with
+ * the "%" symbol.
* @return The converted percentage, or {@link Float#NaN} if the input is
* not valid. An input value of "98%" will return 98.0.
*/
- public static float convertPercent(String input) {
+ public static float convertPercent(final String inputString) {
float output = Float.NaN;
- if (input == null) {
+ if (inputString == null) {
return output;
}
// The percent sign is required
- final int index = input.indexOf('%');
+ final int index = inputString.indexOf('%');
if (index < 0) {
return output;
}
- input = input.substring(0, index);
+ final String input = inputString.substring(0, index);
output = Float.parseFloat(input);
return output;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -92,13 +92,14 @@
* created. Setting this value to the proper amount will improve
* performance.
*/
- public Kerning(int expectedPairs) {
- if (expectedPairs < 1) {
- expectedPairs = 1;
+ public Kerning(final int expectedPairs) {
+ int pairs = expectedPairs;
+ if (pairs < 1) {
+ pairs = 1;
}
- this.firstChars32 = new int[expectedPairs];
- this.secondChars32 = new int[expectedPairs];
- this.kernAmount32 = new short[expectedPairs];
+ this.firstChars32 = new int[pairs];
+ this.secondChars32 = new int[pairs];
+ this.kernAmount32 = new short[pairs];
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -849,12 +849,12 @@
* Compute the checksum for a portion of a given byte array.
* @param byteArray The byte array containing the content.
* @param start Index to the first byte to be considered in the computation.
- * @param size The number of bytes from the array to be considered in the
- * computation.
+ * @param inputSize The number of bytes from the array to be considered in
+ * the computation.
* @return The computed checksum.
*/
private long getCheckSum(final byte[] byteArray, final int start,
- int size) {
+ final int inputSize) {
// All the tables here are aligned on four byte boundaries
// Add remainder to size if it's not a multiple of 4
@@ -862,7 +862,7 @@
* to throw an exception if anything passed here is not on a 4-byte
* boundary.
*/
- size += getPadSize(size);
+ final int size = inputSize + getPadSize(inputSize);
long sum = 0;
@@ -884,10 +884,11 @@
/**
* Adjust the checksum to a maximum.
- * @param sum The tentative checksum.
+ * @param inputSum The tentative checksum.
* @return The adjusted checksum value.
*/
- private long correctCheckSumForMax(long sum) {
+ private long correctCheckSumForMax(final long inputSum) {
+ long sum = inputSum;
if (sum > 0xffffffff) {
sum = sum - 0xffffffff;
}
@@ -937,12 +938,12 @@
/**
* For a given array size, return an empty byte array for the content,
* adding any needed padding.
- * @param arraySize The size of the original table to be copied.
+ * @param inputArraySize The size of the original table to be copied.
* @return The empty but properly-sized byte array.
*/
- private byte[] createTableByteArray(int arraySize) {
+ private byte[] createTableByteArray(final int inputArraySize) {
/* Align on 4-byte boundary */
- arraySize += getPadSize(arraySize);
+ final int arraySize = inputArraySize + getPadSize(inputArraySize);
/*
* Byte arrays initialize at 0x00, which is what we want, as extra bytes
* in the 4-byte padding scheme should be zero.
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -139,11 +139,12 @@
* @param temp
* @param row
* @param column
- * @param byteInRow The current byteInRow value.
+ * @param inputByteInRow The current byteInRow value.
* @return The new byteInRow value.
*/
private int processRowColor(final int bytesPerRow, final byte[] temp,
- final int row, final int column, int byteInRow) {
+ final int row, final int column, final int inputByteInRow) {
+ int byteInRow = inputByteInRow;
int countr = 2;
while (countr >= 0) {
final int contentIndex = this.colorSpace.getNumComponents()
@@ -159,14 +160,17 @@
/**
* @param row
- * @param column
- * @param p
+ * @param inputColumn
+ * @param inputP
* @return The new column number.
*/
- private int processRowMonochrome(final int row, int column, byte p) {
+ private int processRowMonochrome(final int row, final int inputColumn,
+ final byte inputP) {
/* Each bit represents one column in the image.
* Iterate through each bit and set the content to either "black" or
* "white" for each of the color channels. */
+ int column = inputColumn;
+ byte p = inputP;
for (int countr = 0; countr < WKConstants.BITS_PER_BYTE
&& column < this.pixelWidth; countr++) {
byte color = 0;
@@ -187,12 +191,14 @@
/**
* @param palette
* @param row
- * @param column
- * @param p
+ * @param inputColumn
+ * @param inputP
* @return The new column number.
*/
- private int processRow4Bits(final byte[] palette, final int row, int column,
- byte p) {
+ private int processRow4Bits(final byte[] palette, final int row,
+ final int inputColumn, final byte inputP) {
+ int column = inputColumn;
+ byte p = inputP;
for (int countr = 0; countr < 2 && column < this.pixelWidth;
countr++) {
final int pal = ((p & BIT_8_MASK) >> BITS_PER_NIBBLE)
@@ -217,12 +223,15 @@
* @param bytesPerRow
* @param row
* @param column
- * @param byteInRow
- * @param p
+ * @param inputByteInRow
+ * @param inputP
* @return The new byteInRow value.
*/
private int processRowGrayscale(final byte[] palette, final int bytesPerRow,
- final int row, final int column, int byteInRow, byte p) {
+ final int row, final int column, final int inputByteInRow,
+ final byte inputP) {
+ int byteInRow = inputByteInRow;
+ byte p = inputP;
if (column < this.pixelWidth) {
p *= this.colorSpace.getNumComponents();
this.content[this.colorSpace.getNumComponents()
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -243,7 +243,8 @@
}
private int readBBoxString(final byte[] fileStart, final int bboxIndex,
- int idx) {
+ final int inputIdx) {
+ int idx = inputIdx;
while (idx < fileStart.length && (fileStart[idx] == ' ')) {
idx++;
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -183,9 +183,9 @@
}
private void processRemainder(final ByteArrayOutputStream iccStream,
- int index) {
+ final int inputIndex) {
boolean cont = true;
- index += 2;
+ int index = inputIndex + 2;
while (index < this.content.length && cont) {
cont = processNextChunk(iccStream, index);
if (cont) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|