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 vh...@apache.org on 2009/09/18 19:10:52 UTC

svn commit: r816718 [3/11] - in /xmlgraphics/fop/branches/Temp_Accessibility: ./ examples/fo/advanced/ hyph/ lib/ src/codegen/unicode/java/org/apache/fop/hyphenation/ src/codegen/unicode/java/org/apache/fop/text/linebreak/ src/codegen/unicode/java/org/...

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ObjectContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ObjectContainer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageGroup.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageGroup.java Fri Sep 18 17:10:42 2009
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.List;
 
 import org.apache.fop.afp.Factory;
 
@@ -36,9 +35,6 @@
  */
 public class PageGroup extends AbstractResourceEnvironmentGroupContainer {
 
-    /** The tag logical elements contained within this group */
-    private List tagLogicalElements = null;
-
     /**
      * Sequence number for TLE's.
      */
@@ -56,13 +52,6 @@
         this.tleSequence = tleSequence;
     }
 
-    private List getTagLogicalElements() {
-        if (tagLogicalElements == null) {
-            this.tagLogicalElements = new java.util.ArrayList();
-        }
-        return this.tagLogicalElements;
-    }
-
     /**
      * Creates a TagLogicalElement on the page.
      *
@@ -88,7 +77,7 @@
 
     /** {@inheritDoc} */
     protected void writeContent(OutputStream os) throws IOException {
-        writeObjects(tagLogicalElements, os);
+        writeObjects(tagLogicalElements, os, true);
         super.writeContent(os);
     }
 

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PageSegment.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/Registry.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/ResourceObject.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/TagLogicalElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/TagLogicalElement.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/TagLogicalElement.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/TagLogicalElement.java Fri Sep 18 17:10:42 2009
@@ -64,7 +64,7 @@
 
     /**
      * Construct a tag logical element with the name and value specified.
-     * 
+     *
      * @param name the name of the tag logical element
      * @param value the value of the tag logical element
      * @param tleID unique identifier for TLE within AFP stream
@@ -135,7 +135,7 @@
             data[pos++] = tleByteValue[i];
         }
         // attribute qualifier
-        data[pos++] = 0x10;
+        data[pos++] = 0x0A;
         data[pos++] = (byte)0x80;
         byte[] id = BinaryUtils.convert(tleID, 4);
         for (int i = 0; i < id.length; i++) {

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/AbstractTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/FullyQualifiedNameTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MappingOptionTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MappingOptionTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MappingOptionTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MappingOptionTriplet.java Fri Sep 18 17:10:42 2009
@@ -50,9 +50,14 @@
      */
     public static final byte CENTER_AND_TRIM = 0x30;
 
-//    public static final byte MIGRATION_MAPPING_1 = 0x41;
-//    public static final byte MIGRATION_MAPPING_2 = 0x42;
-//    public static final byte MIGRATION_MAPPING_3 = 0x50;
+    /** Migration mapping option: Image point-to-pel. */
+    public static final byte IMAGE_POINT_TO_PEL = 0x41;
+
+    /** Migration mapping option: Image point-to-pel with double dot. */
+    public static final byte IMAGE_POINT_TO_PEL_DOUBLE_DOT = 0x42;
+
+    /** Migration mapping option: Replicate and trim. */
+    public static final byte REPLICATE_AND_TRIM = 0x50;
 
     /** the data object is centred, aspect ratio is not always preserved */
     public static final byte SCALE_TO_FILL = 0x60;

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/MeasurementUnitsTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectAreaSizeTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.afp.modca.triplets;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/modca/triplets/ResourceObjectTypeTriplet.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java Fri Sep 18 17:10:42 2009
@@ -20,6 +20,7 @@
 package org.apache.fop.afp.ptoca;
 
 import java.awt.Color;
+import java.awt.color.ColorSpace;
 import java.io.IOException;
 import java.io.OutputStream;
 
@@ -314,19 +315,38 @@
             return;
         }
         newControlSequence();
-        writeByte(0x00); // Reserved; must be zero
-        writeByte(0x01); // Color space - 0x01 = RGB
-        writeByte(0x00); // Reserved; must be zero
-        writeByte(0x00); // Reserved; must be zero
-        writeByte(0x00); // Reserved; must be zero
-        writeByte(0x00); // Reserved; must be zero
-        writeByte(8); // Number of bits in component 1
-        writeByte(8); // Number of bits in component 2
-        writeByte(8); // Number of bits in component 3
-        writeByte(0); // Number of bits in component 4
-        writeByte(col.getRed()); // Red intensity
-        writeByte(col.getGreen()); // Green intensity
-        writeByte(col.getBlue()); // Blue intensity
+        if (col.getColorSpace().getType() == ColorSpace.TYPE_CMYK) {
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x04); // Color space - 0x04 = CMYK
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(8); // Number of bits in component 1
+            writeByte(8); // Number of bits in component 2
+            writeByte(8); // Number of bits in component 3
+            writeByte(8); // Number of bits in component 4
+            float[] comps = col.getColorComponents(null);
+            assert comps.length == 4;
+            for (int i = 0; i < 4; i++) {
+                int component = Math.round(comps[i] * 256);
+                writeByte(component);
+            }
+        } else {
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x01); // Color space - 0x01 = RGB
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(8); // Number of bits in component 1
+            writeByte(8); // Number of bits in component 2
+            writeByte(8); // Number of bits in component 3
+            writeByte(0); // Number of bits in component 4
+            writeByte(col.getRed()); // Red intensity
+            writeByte(col.getGreen()); // Green intensity
+            writeByte(col.getBlue()); // Blue intensity
+        }
         commit(chained(SEC));
         this.currentColor = col;
     }

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java Fri Sep 18 17:10:42 2009
@@ -63,8 +63,10 @@
         URI resolved = resolveAgainstBase(uri);
 
         //Step 2: resolve against the user agent --> stream
-        Source src;
-        src = userAgent.resolveURI(resolved.toASCIIString(), this.categoryBaseURI);
+        String base = (this.categoryBaseURI != null
+                ? this.categoryBaseURI
+                : this.userAgent.getBaseURL());
+        Source src = userAgent.resolveURI(resolved.toASCIIString(), base);
 
         if (src == null) {
             throw new FileNotFoundException("Resource not found: " + uri.toASCIIString());

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOURIResolver.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOURIResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/apps/FOURIResolver.java Fri Sep 18 17:10:42 2009
@@ -68,6 +68,8 @@
      * @throws MalformedURLException if there's a problem with a file URL
      */
     public String checkBaseURL(String base) throws MalformedURLException {
+        // replace back slash with forward slash to ensure windows file:/// URLS are supported
+        base = base.replace('\\', '/');
         if (!base.endsWith("/")) {
             // The behavior described by RFC 3986 regarding resolution of relative
             // references may be misleading for normal users:

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/AreaTreeParser.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/AreaTreeParser.java Fri Sep 18 17:10:42 2009
@@ -20,6 +20,7 @@
 package org.apache.fop.area;
 
 import java.awt.Color;
+import java.awt.Rectangle;
 import java.awt.geom.Rectangle2D;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -38,9 +39,10 @@
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TransformerHandler;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Document;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.Locator;
@@ -48,9 +50,6 @@
 import org.xml.sax.helpers.AttributesImpl;
 import org.xml.sax.helpers.DefaultHandler;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import org.apache.xmlgraphics.image.loader.ImageException;
 import org.apache.xmlgraphics.image.loader.ImageInfo;
 import org.apache.xmlgraphics.image.loader.ImageManager;
@@ -404,7 +403,7 @@
                 if (currentPageViewport != null) {
                     throw new IllegalStateException("currentPageViewport must be null");
                 }
-                Rectangle2D viewArea = XMLUtil.getAttributeAsRectangle2D(attributes, "bounds");
+                Rectangle viewArea = XMLUtil.getAttributeAsRectangle(attributes, "bounds");
                 int pageNumber = XMLUtil.getAttributeAsInt(attributes, "nr", -1);
                 String key = attributes.getValue("key");
                 String pageNumberString = attributes.getValue("formatted-nr");

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/PageViewport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/PageViewport.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/PageViewport.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/area/PageViewport.java Fri Sep 18 17:10:42 2009
@@ -20,7 +20,6 @@
 package org.apache.fop.area;
 
 import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -48,7 +47,7 @@
 public class PageViewport extends AreaTreeObject implements Resolvable, Cloneable {
 
     private Page page;
-    private Rectangle2D viewArea;
+    private Rectangle viewArea;
     private String simplePageMasterName;
 
     /**
@@ -100,6 +99,7 @@
     public PageViewport(SimplePageMaster spm, int pageNumber, String pageStr, boolean blank) {
         this.simplePageMasterName = spm.getMasterName();
         setExtensionAttachments(spm.getExtensionAttachments());
+        setForeignAttributes(spm.getForeignAttributes());
         this.blank = blank;
         int pageWidth = spm.getPageWidth().getValue();
         int pageHeight = spm.getPageHeight().getValue();
@@ -118,11 +118,14 @@
         if (original.extensionAttachments != null) {
             setExtensionAttachments(original.extensionAttachments);
         }
+        if (original.foreignAttributes != null) {
+            setForeignAttributes(original.foreignAttributes);
+        }
         this.pageIndex = original.pageIndex;
         this.pageNumber = original.pageNumber;
         this.pageNumberString = original.pageNumberString;
         this.page = (Page)original.page.clone();
-        this.viewArea = (Rectangle2D)original.viewArea.clone();
+        this.viewArea = new Rectangle(original.viewArea);
         this.simplePageMasterName = original.simplePageMasterName;
         this.blank = original.blank;
     }
@@ -135,7 +138,7 @@
      * @param simplePageMasterName name of the original simple-page-master that generated this page
      * @param blank true if this is a blank page
      */
-    public PageViewport(Rectangle2D viewArea, int pageNumber, String pageStr,
+    public PageViewport(Rectangle viewArea, int pageNumber, String pageStr,
             String simplePageMasterName, boolean blank) {
         this.viewArea = viewArea;
         this.pageNumber = pageNumber;
@@ -161,7 +164,7 @@
      * Get the view area rectangle of this viewport.
      * @return the rectangle for this viewport
      */
-    public Rectangle2D getViewArea() {
+    public Rectangle getViewArea() {
         return viewArea;
     }
 

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/cli/CommandLineOptions.java Fri Sep 18 17:10:42 2009
@@ -30,10 +30,9 @@
 
 import javax.swing.UIManager;
 
-import org.xml.sax.SAXException;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.xml.sax.SAXException;
 
 import org.apache.fop.Version;
 import org.apache.fop.accessibility.AccessibilityUtil;
@@ -336,8 +335,8 @@
             } else if (args[i].equals("-a")) {
                 this.renderingOptions.put(AccessibilityUtil.ACCESSIBILITY, Boolean.TRUE);
             } else if (args[i].equals("-v")) {
+                /* Currently just print the version */
                 printVersion();
-                return false;
             } else if (args[i].equals("-param")) {
                   if (i + 2 < args.length) {
                       String name = args[++i];
@@ -360,6 +359,9 @@
                 getPDFEncryptionParams().setAllowEditContent(false);
             } else if (args[i].equals("-noannotations")) {
                 getPDFEncryptionParams().setAllowEditAnnotations(false);
+            } else if (args[i].equals("-version")) {
+                printVersion();
+                return false;
             } else if (!isOption(args[i])) {
                 i = i + parseUnknownOption(args, i);
             } else {
@@ -1122,6 +1124,7 @@
               "\nUSAGE\nfop [options] [-fo|-xml] infile [-xsl file] "
                     + "[-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>\n"
             + " [OPTIONS]  \n"
+            + "  -version          print FOP version and exit\n"
             + "  -d                debug mode   \n"
             + "  -x                dump configuration settings  \n"
             + "  -q                quiet mode  \n"
@@ -1130,7 +1133,7 @@
             + "  -r                relaxed/less strict validation (where available)\n"
             + "  -dpi xxx          target resolution in dots per inch (dpi) where xxx is a number\n"
             + "  -s                for area tree XML, down to block areas only\n"
-            + "  -v                to show FOP version being used\n\n"
+            + "  -v                run in verbose mode (currently simply print FOP version and continue)\n\n"
             + "  -o [password]     PDF file will be encrypted with option owner password\n"
             + "  -u [password]     PDF file will be encrypted with option user password\n"
             + "  -noprint          PDF file will be encrypted without printing permission\n"
@@ -1140,8 +1143,8 @@
             + "  -a                enables accessibility features (Tagged PDF etc., default off)\n"
             + "  -pdfprofile prof  PDF file will be generated with the specified profile\n"
             + "                    (Examples for prof: PDF/A-1b or PDF/X-3:2003)\n\n"
-            + "  -conserve         Enable memory-conservation policy (trades memory-consumption for disk I/O)"
-            + "                    (Note: currently only influences whether the area tree is serialized.)"
+            + "  -conserve         Enable memory-conservation policy (trades memory-consumption for disk I/O)\n"
+            + "                    (Note: currently only influences whether the area tree is serialized.)\n\n"
             + " [INPUT]  \n"
             + "  infile            xsl:fo input file (the same as the next) \n"
             + "                    (use '-' for infile to pipe input from stdin)\n"

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter.xml?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter.xml (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter.xml Fri Sep 18 17:10:42 2009
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
@@ -13,7 +14,9 @@
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
---><!-- $Id$ --><catalogue xml:lang="en">
+-->
+<!-- $Id$ -->
+<catalogue xml:lang="en">
   <message key="locator">[ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]</message>
   <message key="rule.markerDescendantOfFlow">An fo:marker is permitted only as the descendant of an fo:flow.</message>
   <message key="rule.retrieveMarkerDescendantOfStaticContent">An fo:retrieve-marker is permitted only as the descendant of an fo:static-content.</message>
@@ -102,7 +105,4 @@
   <message key="org.apache.fop.fonts.FontEventAdapter.fontSubstituted">Font "{requested}" not found. Substituting with "{effective}".</message>
   <message key="org.apache.fop.fonts.FontEventAdapter.fontLoadingErrorAtAutoDetection">Unable to load font file: {fontURL}.[ Reason: {e}]</message>
   <message key="org.apache.fop.fonts.FontEventAdapter.glyphNotAvailable">Glyph "{ch}" (0x{ch,hex}[, {ch,glyph-name}]) not available in font "{fontName}".</message>
-<message key="org.apache.fop.afp.AFPEventProducer.warnDefaultFontSetup"/>
-<message key="org.apache.fop.afp.AFPEventProducer.warnMissingDefaultFont"/>
-<message key="org.apache.fop.afp.AFPEventProducer.characterSetEncodingError"/>
 </catalogue>

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Fri Sep 18 17:10:42 2009
@@ -1 +1 @@
-Id
+Revision Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml Fri Sep 18 17:10:42 2009
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<!-- $Id$ -->
-<catalogue xml:lang="de">
-  <message key="locator">[ (Siehe Position {loc})| (Siehe {#gatherContextInfo})| (Keine Kontextinformationen verfügbar)]</message>
-  <message key="org.apache.fop.fo.FOValidationEventProducer.tooManyNodes">In "{elementName}" darf nur ein einziges "{offendingNode}" vorkommen!{{locator}}</message>
-  <message key="org.apache.fop.fo.FOValidationEventProducer.missingProperty">Dem Element "{elementName}" fehlt ein verlangtes Property "{propertyName}"!{{locator}}</message>
-</catalogue>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!-- $Id$ -->
+<catalogue xml:lang="de">
+  <message key="locator">[ (Siehe Position {loc})| (Siehe {#gatherContextInfo})| (Keine Kontextinformationen verfügbar)]</message>
+  <message key="org.apache.fop.fo.FOValidationEventProducer.tooManyNodes">In "{elementName}" darf nur ein einziges "{offendingNode}" vorkommen!{{locator}}</message>
+  <message key="org.apache.fop.fo.FOValidationEventProducer.missingProperty">Dem Element "{elementName}" fehlt ein verlangtes Property "{propertyName}"!{{locator}}</message>
+</catalogue>

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/events/EventFormatter_de.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Fri Sep 18 17:10:42 2009
@@ -1 +1 @@
-Id
+Revision Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FONode.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FONode.java Fri Sep 18 17:10:42 2009
@@ -23,13 +23,12 @@
 import java.util.ListIterator;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.helpers.LocatorImpl;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import org.apache.xmlgraphics.util.QName;
 
 import org.apache.fop.apps.FOPException;
@@ -91,23 +90,19 @@
      */
     public FONode clone(FONode cloneparent, boolean removeChildren)
                 throws FOPException {
-        try {
-            FONode foNode = (FONode) clone();
-            foNode.parent = cloneparent;
-            foNode.siblings = null;
-            return foNode;
-        } catch (CloneNotSupportedException cnse) {
-            return null;
-        }
+        FONode foNode = (FONode) clone();
+        foNode.parent = cloneparent;
+        foNode.siblings = null;
+        return foNode;
     }
 
-    /**
-     * Perform a shallow cloning operation
-     *
-     * {@inheritDoc}
-     */
-    protected Object clone() throws CloneNotSupportedException {
-        return super.clone();
+    /** {@inheritDoc} */
+    protected Object clone() {
+        try {
+            return super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new AssertionError(); // Can't happen
+        }
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FOTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FOTreeBuilder.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FOTreeBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FOTreeBuilder.java Fri Sep 18 17:10:42 2009
@@ -288,6 +288,9 @@
                         builderContext.switchMarkerContext(true);
                     }
                 }
+                if (foNode.getNameId() == Constants.FO_PAGE_SEQUENCE) {
+                    builderContext.getXMLWhiteSpaceHandler().reset();
+                }
             } catch (IllegalArgumentException e) {
                 throw new SAXException(e);
             }

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FObj.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/FObj.java Fri Sep 18 17:10:42 2009
@@ -53,7 +53,7 @@
     protected FONode firstChild;
 
     /** The list of extension attachments, null if none */
-    private List extensionAttachments = null;
+    private List/*<ExtensionAttachment>*/ extensionAttachments = null;
 
     /** The map of foreign attributes, null if none */
     private Map foreignAttributes = null;
@@ -554,7 +554,7 @@
                     "Parameter attachment must not be null");
         }
         if (extensionAttachments == null) {
-            extensionAttachments = new java.util.ArrayList();
+            extensionAttachments = new java.util.ArrayList/*<ExtensionAttachment>*/();
         }
         if (log.isDebugEnabled()) {
             log.debug("ExtensionAttachment of category "
@@ -565,7 +565,7 @@
     }
 
     /** @return the extension attachments of this FObj. */
-    public List getExtensionAttachments() {
+    public List/*<ExtensionAttachment>*/ getExtensionAttachments() {
         if (extensionAttachments == null) {
             return Collections.EMPTY_LIST;
         } else {

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java Fri Sep 18 17:10:42 2009
@@ -234,6 +234,18 @@
     }
 
     /**
+     * Reset the handler, release all references
+     */
+    protected final void reset() {
+        if (pendingInlines != null) {
+            pendingInlines.clear();
+        }
+        nestedBlockStack.clear();
+        charIter = null;
+        firstWhiteSpaceInSeq = null;
+    }
+
+    /**
      * Handle white-space for the fo that is passed in, starting at
      * firstTextNode (when a nested FO is encountered)
      * @param fo    the FO for which to handle white-space

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/ICCColorFunction.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/ICCColorFunction.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/ICCColorFunction.java Fri Sep 18 17:10:42 2009
@@ -24,6 +24,7 @@
 import org.apache.fop.fo.pagination.Declarations;
 import org.apache.fop.fo.properties.ColorProperty;
 import org.apache.fop.fo.properties.Property;
+import org.apache.fop.util.ColorUtil;
 
 /**
  * Implements the rgb-icc() function.
@@ -63,13 +64,15 @@
         } else {
             cp = decls.getColorProfile(colorProfileName);
             if (cp == null) {
-                PropertyException pe = new PropertyException("The " + colorProfileName
-                        + " color profile was not declared");
-                pe.setPropertyInfo(pInfo);
-                throw pe;
+                if (!ColorUtil.isPseudoProfile(colorProfileName)) {
+                    PropertyException pe = new PropertyException("The " + colorProfileName
+                            + " color profile was not declared");
+                    pe.setPropertyInfo(pInfo);
+                    throw pe;
+                }
             }
         }
-        String src = cp.getSrc();
+        String src = (cp != null ? cp.getSrc() : "");
 
         float red = 0, green = 0, blue = 0;
         red = args[0].getNumber().floatValue();

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyParser.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyParser.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyParser.java Fri Sep 18 17:10:42 2009
@@ -19,6 +19,12 @@
 
 package org.apache.fop.fo.expr;
 
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xmlgraphics.util.UnitConv;
+
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.Numeric;
@@ -31,10 +37,6 @@
 import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.StringProperty;
 
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-
 /**
  * Class to parse XSL-FO property expressions.
  * This class is heavily based on the epxression parser in James Clark's
@@ -99,7 +101,7 @@
     /**
      * Private constructor. Called by the static parse() method.
      * @param propExpr The specified value (attribute on the xml element).
-     * @param propInfo A PropertyInfo object representing the context in
+     * @param pInfo A PropertyInfo object representing the context in
      * which the property expression is to be evaluated.
      */
     private PropertyParser(String propExpr, PropertyInfo pInfo) {
@@ -310,12 +312,13 @@
                                     propInfo.currentFontSize());
             } else {
                 if ("px".equals(unitPart)) {
-                    //pass the ratio between source-resolution and
+                    //pass the ratio between target-resolution and
                     //the default resolution of 72dpi
+                    float resolution = propInfo.getPropertyList().getFObj()
+                            .getUserAgent().getSourceResolution();
                     prop = FixedLength.getInstance(
                             numPart, unitPart,
-                            propInfo.getPropertyList().getFObj()
-                                    .getUserAgent().getSourceResolution() / 72.0f);
+                             UnitConv.IN2PT / resolution);
                 } else {
                     //use default resolution of 72dpi
                     prop = FixedLength.getInstance(numPart, unitPart);

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java Fri Sep 18 17:10:42 2009
@@ -243,15 +243,20 @@
     }
 
 
-    private void nextColor () throws PropertyException {
+    private void nextColor() throws PropertyException {
         if (exprIndex < exprLength
                 && isHexDigit(expr.charAt(exprIndex))) {
             ++exprIndex;
             scanHexDigits();
-            currentToken = TOK_COLORSPEC;
+            int len = exprIndex - currentTokenStartIndex - 1;
+            if (len % 3 == 0) {
+                currentToken = TOK_COLORSPEC;
+            } else {
+                scanRestOfName();
+                currentToken = TOK_NCNAME;
+            }
             currentTokenValue = expr.substring(currentTokenStartIndex,
                     exprIndex);
-            // Probably should have some multiple of 3 for length!
             return;
         } else {
             throw new PropertyException("illegal character '#'");
@@ -263,11 +268,15 @@
      */
     private void scanName() {
         if (exprIndex < exprLength && isNameStartChar(expr.charAt(exprIndex))) {
-            while (++exprIndex < exprLength
-                   && isNameChar(expr.charAt(exprIndex))) { }
+            scanRestOfName();
         }
     }
 
+    private void scanRestOfName() {
+        while (++exprIndex < exprLength
+               && isNameChar(expr.charAt(exprIndex))) { }
+    }
+
     /**
      * Attempt to recognize a valid sequence of decimal DIGITS in the
      * input expression.

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java Fri Sep 18 17:10:42 2009
@@ -155,11 +155,6 @@
 
     private void cloneFromMarker(Marker marker)
         throws FOPException {
-        // clean up remnants from a possible earlier layout
-        if (firstChild != null) {
-            currentTextNode = null;
-            firstChild = null;
-        }
         cloneSubtree(marker.getChildNodes(), this,
                         marker, propertyList);
         handleWhiteSpaceFor(this, null);
@@ -171,6 +166,11 @@
      * @param marker the marker that is to be cloned
      */
     public void bindMarker(Marker marker) {
+        // clean up remnants from a possible earlier layout
+        if (firstChild != null) {
+            currentTextNode = null;
+            firstChild = null;
+        }
         if (marker.getChildNodes() != null) {
             try {
                 cloneFromMarker(marker);

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/EffRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/EffRow.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/EffRow.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/EffRow.java Fri Sep 18 17:10:42 2009
@@ -23,8 +23,7 @@
 import java.util.List;
 
 import org.apache.fop.fo.Constants;
-import org.apache.fop.layoutmgr.BlockLevelLayoutManager;
-import org.apache.fop.layoutmgr.KeepUtil;
+import org.apache.fop.layoutmgr.Keep;
 import org.apache.fop.layoutmgr.table.TableRowIterator;
 import org.apache.fop.traits.MinOptMax;
 import org.apache.fop.util.BreakUtil;
@@ -170,20 +169,19 @@
      *
      * @return the strength of the keep-with-previous constraint
      */
-    public int getKeepWithPreviousStrength() {
-        int strength = BlockLevelLayoutManager.KEEP_AUTO;
+    public Keep getKeepWithPrevious() {
+        Keep keep = Keep.KEEP_AUTO;
         TableRow row = getTableRow();
         if (row != null) {
-            strength = Math.max(strength,
-                    KeepUtil.getCombinedBlockLevelKeepStrength(row.getKeepWithPrevious()));
+            keep = Keep.getKeep(row.getKeepWithPrevious());
         }
         for (Iterator iter = gridUnits.iterator(); iter.hasNext();) {
             GridUnit gu = (GridUnit) iter.next();
             if (gu.isPrimary()) {
-                strength = Math.max(strength, gu.getPrimary().getKeepWithPreviousStrength());
+                keep = keep.compare(gu.getPrimary().getKeepWithPrevious());
             }
         }
-        return strength;
+        return keep;
     }
 
     /**
@@ -192,20 +190,19 @@
      *
      * @return the strength of the keep-with-next constraint
      */
-    public int getKeepWithNextStrength() {
-        int strength = BlockLevelLayoutManager.KEEP_AUTO;
+    public Keep getKeepWithNext() {
+        Keep keep = Keep.KEEP_AUTO;
         TableRow row = getTableRow();
         if (row != null) {
-            strength = Math.max(strength,
-                    KeepUtil.getCombinedBlockLevelKeepStrength(row.getKeepWithNext()));
+            keep = Keep.getKeep(row.getKeepWithNext());
         }
         for (Iterator iter = gridUnits.iterator(); iter.hasNext();) {
             GridUnit gu = (GridUnit) iter.next();
             if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) {
-                strength = Math.max(strength, gu.getPrimary().getKeepWithNextStrength());
+                keep = keep.compare(gu.getPrimary().getKeepWithNext());
             }
         }
-        return strength;
+        return keep;
     }
 
     /**
@@ -213,16 +210,13 @@
      * not take the parent table's keeps into account!
      * @return the keep-together strength
      */
-    public int getKeepTogetherStrength() {
+    public Keep getKeepTogether() {
         TableRow row = getTableRow();
-        int strength = BlockLevelLayoutManager.KEEP_AUTO;
+        Keep keep = Keep.KEEP_AUTO;
         if (row != null) {
-            strength = Math.max(strength, KeepUtil.getKeepStrength(
-                    row.getKeepTogether().getWithinPage()));
-            strength = Math.max(strength, KeepUtil.getKeepStrength(
-                    row.getKeepTogether().getWithinColumn()));
+            keep = Keep.getKeep(row.getKeepTogether());
         }
-        return strength;
+        return keep;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java Fri Sep 18 17:10:42 2009
@@ -19,14 +19,13 @@
 
 package org.apache.fop.fo.flow.table;
 
-import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
-import org.apache.fop.layoutmgr.BlockLevelLayoutManager;
 import org.apache.fop.layoutmgr.ElementListUtils;
+import org.apache.fop.layoutmgr.Keep;
 import org.apache.fop.layoutmgr.table.TableCellLayoutManager;
 
 /**
@@ -54,8 +53,8 @@
     private boolean isSeparateBorderModel;
     private int halfBorderSeparationBPD;
 
-    private int keepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
-    private int keepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
+    private Keep keepWithPrevious = Keep.KEEP_AUTO;
+    private Keep keepWithNext = Keep.KEEP_AUTO;
     private int breakBefore = Constants.EN_AUTO;
     private int breakAfter = Constants.EN_AUTO;
 
@@ -334,16 +333,16 @@
      *
      * @return the keep-with-previous strength
      */
-    public int getKeepWithPreviousStrength() {
+    public Keep getKeepWithPrevious() {
         return keepWithPrevious;
     }
 
     /**
      * Don't use, reserved for TableCellLM. TODO
-     * @param strength the keep strength
+     * @param keep the keep strength
      */
-    public void setKeepWithPreviousStrength(int strength) {
-        this.keepWithPrevious = strength;
+    public void setKeepWithPrevious(Keep keep) {
+        this.keepWithPrevious = keep;
     }
 
     /**
@@ -352,16 +351,16 @@
      *
      * @return the keep-with-next strength
      */
-    public int getKeepWithNextStrength() {
+    public Keep getKeepWithNext() {
         return keepWithNext;
     }
 
     /**
      * Don't use, reserved for TableCellLM. TODO
-     * @param strength the keep strength
+     * @param keep the keep strength
      */
-    public void setKeepWithNextStrength(int strength) {
-        this.keepWithNext = strength;
+    public void setKeepWithNext(Keep keep) {
+        this.keepWithNext = keep;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.fo.flow.table;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableBody.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: TableBody.java 655614 2008-05-12 19:37:39Z vhennebert $ */
+/* $Id$ */
 
 package org.apache.fop.fo.flow.table;
 
@@ -70,6 +70,13 @@
     }
 
     /** {@inheritDoc} */
+    protected Object clone() {
+        TablePart clone = (TablePart) super.clone();
+        clone.rowGroups = new LinkedList(rowGroups);
+        return clone;
+    }
+
+    /** {@inheritDoc} */
     public void bind(PropertyList pList) throws FOPException {
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         super.bind(pList);
@@ -103,13 +110,13 @@
             pendingSpans = null;
             columnNumberManager = null;
         }
-
         if (!(tableRowsFound || tableCellsFound)) {
             missingChildElementError("marker* (table-row+|table-cell+)", true);
             getParent().removeChild(this);
         } else {
             finishLastRowGroup();
         }
+
     }
 
     /** {@inheritDoc} */
@@ -197,6 +204,9 @@
                 //nop
             }
         }
+        //TODO: possible performance problems in case of large tables...
+        //If the number of children grows significantly large, the default
+        //implementation in FObj will get slower and slower...
         super.addChildNode(child);
     }
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TablePart.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/LengthProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/LengthProperty.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/LengthProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/LengthProperty.java Fri Sep 18 17:10:42 2009
@@ -19,6 +19,8 @@
 
 package org.apache.fop.fo.properties;
 
+import org.apache.xmlgraphics.util.UnitConv;
+
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FObj;
@@ -57,9 +59,10 @@
             }
             if (p instanceof NumberProperty) {
                 //Assume pixels (like in HTML) when there's no unit
+                float resolution = propertyList.getFObj().getUserAgent().getSourceResolution();
                 return FixedLength.getInstance(
                         p.getNumeric().getNumericValue(), "px",
-                        propertyList.getFObj().getUserAgent().getSourceResolution() / 72.0f);
+                        UnitConv.IN2PT / resolution);
             }
             Length val = p.getLength();
             if (val != null) {

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.fonts;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontAdder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.fonts;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontDetector.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java Fri Sep 18 17:10:42 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.fonts;
 

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/SingleByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/SingleByteFont.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/SingleByteFont.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/SingleByteFont.java Fri Sep 18 17:10:42 2009
@@ -94,7 +94,7 @@
     /** {@inheritDoc} */
     public int[] getWidths() {
         int[] arr = new int[width.length];
-        System.arraycopy(width, 0, arr, 0, width.length - 1);
+        System.arraycopy(width, 0, arr, 0, width.length);
         return arr;
     }
 

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/apps/PFMReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/apps/PFMReader.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/apps/PFMReader.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/apps/PFMReader.java Fri Sep 18 17:10:42 2009
@@ -171,7 +171,7 @@
      * @param   pfm The PFM file to preview.
      */
     public void preview(PFMFile pfm) {
-        if (log != null & log.isInfoEnabled()) {
+        if (log != null && log.isInfoEnabled()) {
             log.info("Font: " + pfm.getWindowsName());
             log.info("Name: " + pfm.getPostscriptName());
             log.info("CharSet: " + pfm.getCharSetName());
@@ -219,14 +219,15 @@
         root.appendChild(el);
         el.appendChild(doc.createTextNode(pfm.getPostscriptName()));
 
-        String s = pfm.getPostscriptName();
-        int pos = s.indexOf("-");
-        if (pos >= 0) {
-            char[] sb = new char[s.length() - 1];
-            s.getChars(0, pos, sb, 0);
-            s.getChars(pos + 1, s.length(), sb, pos);
-            s = new String(sb);
-        }
+        // Currently unused.
+        // String s = pfm.getPostscriptName();
+        // int pos = s.indexOf("-");
+        // if (pos >= 0) {
+        // char[] sb = new char[s.length() - 1];
+        // s.getChars(0, pos, sb, 0);
+        // s.getChars(pos + 1, s.length(), sb, pos);
+        // s = new String(sb);
+        // }
 
         el = doc.createElement("embed");
         root.appendChild(el);
@@ -304,8 +305,7 @@
             el = doc.createElement("char");
             widths.appendChild(el);
             el.setAttribute("idx", Integer.toString(i));
-            el.setAttribute("wdt",
-                            new Integer(pfm.getCharWidth(i)).toString());
+            el.setAttribute("wdt", Integer.toString(pfm.getCharWidth(i)));
         }
 
 
@@ -318,13 +318,14 @@
             root.appendChild(el);
             Element el2 = null;
 
-            Map h2 = (Map)pfm.getKerning().get(kpx1);
-            Iterator enum2 = h2.keySet().iterator();
+            Map h2 = (Map) pfm.getKerning().get(kpx1);
+            Iterator enum2 = h2.entrySet().iterator();
             while (enum2.hasNext()) {
-                Integer kpx2 = (Integer)enum2.next();
+                Map.Entry entry = (Map.Entry) enum2.next();
+                Integer kpx2 = (Integer) entry.getKey();
                 el2 = doc.createElement("pair");
                 el2.setAttribute("kpx2", kpx2.toString());
-                Integer val = (Integer)h2.get(kpx2);
+                Integer val = (Integer) entry.getValue();
                 el2.setAttribute("kern", val.toString());
                 el.appendChild(el2);
             }

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java Fri Sep 18 17:10:42 2009
@@ -212,7 +212,8 @@
                 IOUtils.closeQuietly(in);
             }
 
-            List embedFontInfoList = new java.util.ArrayList(); //List<EmbedFontInfo>
+            List/*<EmbedFontInfo>*/ embedFontInfoList
+                = new java.util.ArrayList/*<EmbedFontInfo>*/();
 
             // For each font name ...
             //for (String fontName : ttcNames) {

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/type1/PFMFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/type1/PFMFile.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/type1/PFMFile.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fonts/type1/PFMFile.java Fri Sep 18 17:10:42 2009
@@ -481,7 +481,13 @@
      * @return The width of a character.
      */
     public int getCharWidth(short which) {
-        return extentTable[which - dfFirstChar];
+        if (extentTable != null) {
+            return extentTable[which - dfFirstChar];
+        } else {
+            //Fixed-width font (PFM may have no extent table)
+            //we'll just use the average width
+            return this.dfAvgWidth;
+        }
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/hyphenation/PatternParser.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/hyphenation/PatternParser.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/hyphenation/PatternParser.java Fri Sep 18 17:10:42 2009
@@ -30,7 +30,10 @@
 // Java
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 
@@ -44,13 +47,14 @@
  */
 public class PatternParser extends DefaultHandler implements PatternConsumer {
 
-    XMLReader parser;
-    int currElement;
-    PatternConsumer consumer;
-    StringBuffer token;
-    ArrayList exception;
-    char hyphenChar;
-    String errMsg;
+    private XMLReader parser;
+    private int currElement;
+    private PatternConsumer consumer;
+    private StringBuffer token;
+    private ArrayList exception;
+    private char hyphenChar;
+    private String errMsg;
+    private boolean hasClasses = false;
 
     static final int ELEM_CLASSES = 1;
     static final int ELEM_EXCEPTIONS = 2;
@@ -58,24 +62,19 @@
     static final int ELEM_HYPHEN = 4;
 
     public PatternParser() throws HyphenationException {
+        this.consumer = this;
         token = new StringBuffer();
         parser = createParser();
         parser.setContentHandler(this);
         parser.setErrorHandler(this);
         hyphenChar = '-';    // default
-
     }
 
-    public PatternParser(PatternConsumer consumer)
-            throws HyphenationException {
+    public PatternParser(PatternConsumer consumer) throws HyphenationException {
         this();
         this.consumer = consumer;
     }
 
-    public void setConsumer(PatternConsumer consumer) {
-        this.consumer = consumer;
-    }
-
     /**
      * Parses a hyphenation pattern file.
      * @param filename the filename
@@ -249,15 +248,32 @@
         return il.toString();
     }
 
+    protected void getExternalClasses() throws SAXException {
+        XMLReader mainParser = parser;
+        parser = createParser();
+        parser.setContentHandler(this);
+        parser.setErrorHandler(this);
+        InputStream stream = this.getClass().getResourceAsStream("classes.xml");
+        InputSource source = new InputSource(stream);
+        try {
+            parser.parse(source);
+        } catch (IOException ioe) {
+            throw new SAXException(ioe.getMessage());
+        } finally {
+            parser = mainParser;
+        }
+    }
+    
     //
     // ContentHandler methods
     //
 
     /**
      * {@inheritDoc}
+     * @throws SAXException 
      */
     public void startElement(String uri, String local, String raw,
-                             Attributes attrs) {
+                             Attributes attrs) throws SAXException {
         if (local.equals("hyphen-char")) {
             String h = attrs.getValue("value");
             if (h != null && h.length() == 1) {
@@ -266,8 +282,14 @@
         } else if (local.equals("classes")) {
             currElement = ELEM_CLASSES;
         } else if (local.equals("patterns")) {
+            if (!hasClasses) {
+                getExternalClasses();
+            }
             currElement = ELEM_PATTERNS;
         } else if (local.equals("exceptions")) {
+            if (!hasClasses) {
+                getExternalClasses();
+            }
             currElement = ELEM_EXCEPTIONS;
             exception = new ArrayList();
         } else if (local.equals("hyphen")) {
@@ -311,6 +333,9 @@
                 token.setLength(0);
             }
         }
+        if (currElement == ELEM_CLASSES) {
+            hasClasses = true;
+        }
         if (currElement == ELEM_HYPHEN) {
             currElement = ELEM_EXCEPTIONS;
         } else {
@@ -403,23 +428,46 @@
 
     // PatternConsumer implementation for testing purposes
     public void addClass(String c) {
-        System.out.println("class: " + c);
+        testOut.println("class: " + c);
     }
 
     public void addException(String w, ArrayList e) {
-        System.out.println("exception: " + w + " : " + e.toString());
+        testOut.println("exception: " + w + " : " + e.toString());
     }
 
     public void addPattern(String p, String v) {
-        System.out.println("pattern: " + p + " : " + v);
+        testOut.println("pattern: " + p + " : " + v);
+    }
+    
+    private PrintStream testOut = System.out;
+    
+    /**
+     * @param testOut the testOut to set
+     */
+    public void setTestOut(PrintStream testOut) {
+        this.testOut = testOut;
+    }
+    
+    public void closeTestOut() {
+        testOut.flush();
+        testOut.close();
     }
 
     public static void main(String[] args) throws Exception {
         if (args.length > 0) {
             PatternParser pp = new PatternParser();
-            pp.setConsumer(pp);
+            PrintStream p = null;
+            if (args.length > 1) {
+                FileOutputStream f = new FileOutputStream(args[1]);
+                p = new PrintStream(f, false, "utf-8");
+                pp.setTestOut(p);
+            }
             pp.parse(args[0]);
+            if (pp != null) {
+                pp.closeTestOut();
+            }
         }
     }
 
+ 
 }

Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java?rev=816718&r1=816717&r2=816718&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java Fri Sep 18 17:10:42 2009
@@ -19,8 +19,12 @@
 
 package org.apache.fop.layoutmgr;
 
+import java.util.List;
+import java.util.Stack;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.fo.FObj;
@@ -253,4 +257,20 @@
         return fobj;
     }
 
+    /** {@inheritDoc} */
+    public void reset() {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
+    /** {@inheritDoc} */
+    public boolean isRestartable() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
+            Position positionAtIPDChange, LayoutManager restartAtLM) {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
 }



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