You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ma...@apache.org on 2005/12/28 04:08:53 UTC

svn commit: r359364 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: area/LineArea.java layoutmgr/InlineKnuthSequence.java

Author: manuel
Date: Tue Dec 27 19:08:49 2005
New Revision: 359364

URL: http://svn.apache.org/viewcvs?rev=359364&view=rev
Log:
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.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java?rev=359364&r1=359363&r2=359364&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/LineArea.java Tue Dec 27 19:08:49 2005
@@ -190,7 +190,7 @@
                 // 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 @@
      * 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;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java?rev=359364&r1=359363&r2=359364&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java Tue Dec 27 19:08:49 2005
@@ -105,7 +105,18 @@
     }
 
     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,



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org