aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorManuel Mall <manuel@apache.org>2005-12-28 03:08:49 +0000
committerManuel Mall <manuel@apache.org>2005-12-28 03:08:49 +0000
commitc815699e2399a1d47ef678c157bad84e62cfa830 (patch)
tree3dd75bf59b27a5a3510d6132ca502e594676f378 /src/java/org/apache/fop
parent9c2840ebeb812fa66d1c1318d0e74bc2f970506d (diff)
downloadxmlgraphics-fop-c815699e2399a1d47ef678c157bad84e62cfa830.tar.gz
xmlgraphics-fop-c815699e2399a1d47ef678c157bad84e62cfa830.zip
LineArea had a finalize method which caused a NPE when called from the garbage collector. I assume it was never intended for this method to be an override of the Java Object finalize method. Renamed the method to finalise.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@359364 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/area/LineArea.java4
-rw-r--r--src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java13
2 files changed, 14 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java
index 4f13ad65f..15d22548f 100644
--- a/src/java/org/apache/fop/area/LineArea.java
+++ b/src/java/org/apache/fop/area/LineArea.java
@@ -190,7 +190,7 @@ public class LineArea extends Area {
// if the LineArea has already been added to the area tree,
// call finalize(); otherwise, wait for the LineLM to call it
if (adjustingInfo.bAddedToAreaTree) {
- finalize();
+ finalise();
}
break;
default:
@@ -203,7 +203,7 @@ public class LineArea extends Area {
* and destroy the AdjustingInfo object if there are
* no UnresolvedAreas left
*/
- public void finalize() {
+ public void finalise() {
if (adjustingInfo.lineAlignment == Constants.EN_JUSTIFY) {
// justified line: apply the variation factor
boolean bUnresolvedAreasPresent = false;
diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
index 788339790..efe3e28ce 100644
--- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
@@ -105,7 +105,18 @@ public class InlineKnuthSequence extends KnuthSequence {
}
public void addALetterSpace() {
- KnuthBox prevBox = (KnuthBox) removeLast();
+ KnuthBox prevBox = (KnuthBox) getLast();
+ if (prevBox.isAuxiliary()
+ && (size() < 4
+ || !getElement(size()-2).isGlue()
+ || !getElement(size()-3).isPenalty()
+ || !getElement(size()-4).isBox()
+ )
+ ) {
+ // Not the sequence we are expecting
+ return;
+ }
+ removeLast();
LinkedList oldList = new LinkedList();
// if there are two consecutive KnuthBoxes the
// first one does not represent a whole word,