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 sp...@apache.org on 2007/09/25 14:44:22 UTC

svn commit: r579224 [1/2] - in /xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking: ./ src/documentation/content/xdocs/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/flow/ src/java/org/apache/fop/fo/prop...

Author: spepping
Date: Tue Sep 25 05:44:20 2007
New Revision: 579224

URL: http://svn.apache.org/viewvc?rev=579224&view=rev
Log:
Merged revisions 550001-554093 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r550098 | adelmelle | 2007-06-23 22:31:59 +0200 (Sat, 23 Jun 2007) | 1 line
  
  Bugzilla 42703: white-space incorrectly handled in retrieved markers
........
  r551603 | vhennebert | 2007-06-28 17:52:45 +0200 (Thu, 28 Jun 2007) | 3 lines
  
  Additional testcases for tables with spanning cells and collapsing-border model.
  TODO the checks in table_border-collapse_collapse_spans_2.xml need to updated once bugs #42768 and #42769 are fixed
........
  r551874 | jeremias | 2007-06-29 14:46:14 +0200 (Fri, 29 Jun 2007) | 9 lines
  
  Bugzilla #42278:
  Refactoring of color map cache and uri/fo resolution from FopFactory
  Submitted by: Adrian Cumiskey <fo...@cumiskey.com>
  
  Changes in addition to the patch by jeremias:
  - Moved the color map cache to the util package so it doesn't clutter the API (apps) package.
  - Factored out the data URL resolution into its own URIResolver class which can now be used separately.
  - Added a utility class for generating RFC2397 data URLs.
  - Added a unit test for data URL handling.
........
  r551972 | spepping | 2007-06-29 19:39:01 +0200 (Fri, 29 Jun 2007) | 4 lines
  
  Applied fix suggested by Arno Peters to the fop shell script. This fix
  makes the script work with a FOP_HOME path containing spaces. This
  solves bug 42616.
........
  r553612 | adelmelle | 2007-07-05 21:01:14 +0200 (Thu, 05 Jul 2007) | 1 line
  
  Fix for a tiny but very nasty bug...
........
  r553627 | adelmelle | 2007-07-05 22:40:24 +0200 (Thu, 05 Jul 2007) | 1 line
  
  Fix a broken link
........
  r553790 | vhennebert | 2007-07-06 10:41:46 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  First step towards using a list of active cells for computing steps
........
  r553792 | vhennebert | 2007-07-06 10:43:51 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Organize imports and remove no longer used methods
........
  r553809 | vhennebert | 2007-07-06 11:24:06 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Remove decrease of activeRowIndex when backtracking
........
  r553824 | vhennebert | 2007-07-06 12:01:58 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Add a testcase for a bug in TableStepper spotted during the refactoring. The border-before of the primary grid unit was taken into account instead of the whole cell border. If the cell is spanning over two columns and the border-before for the second grid unit is bigger, this was leading to a wrong step computation.
........
  r553859 | jeremias | 2007-07-06 14:22:20 +0200 (Fri, 06 Jul 2007) | 1 line
  
  Clarification about the status of fo:bookmark support.
........
  r553876 | vhennebert | 2007-07-06 15:34:41 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Move the getNextStep method into ActiveCell
........
  r553878 | vhennebert | 2007-07-06 15:49:12 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Add a signalMinStep method in ActiveCell
........
  r553895 | vhennebert | 2007-07-06 16:29:10 +0200 (Fri, 06 Jul 2007) | 2 lines
  
  Cleaner way to handle border-separation in ActiveCell
........
  r554087 | adelmelle | 2007-07-07 01:29:26 +0200 (Sat, 07 Jul 2007) | 1 line
  
  Improvement in handling relative font-weights
........
  r554088 | adelmelle | 2007-07-07 01:30:14 +0200 (Sat, 07 Jul 2007) | 1 line
  
  Improvement in handling relative font-weights
........
  r554091 | adelmelle | 2007-07-07 01:44:57 +0200 (Sat, 07 Jul 2007) | 1 line
  
  Tweak: allow control over usage of Locators
........
  r554092 | adelmelle | 2007-07-07 01:49:30 +0200 (Sat, 07 Jul 2007) | 1 line
  
  Removal of unused classes ?
........

Added:
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorSpaceCache.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorSpaceCache.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DataURIResolver.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/DataURIResolver.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DataURLUtil.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/DataURLUtil.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/WriterOutputStream.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/WriterOutputStream.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/fotree/testcases/font-weight_relative2.fo
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/fotree/testcases/font-weight_relative2.fo
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/java/org/apache/fop/util/DataURIResolverTestCase.java
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/java/org/apache/fop/util/DataURIResolverTestCase.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/layoutengine/standard-testcases/marker_inline_white-space.xml
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/marker_inline_white-space.xml
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_2.xml
      - copied unchanged from r554092, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_2.xml
Removed:
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/render/txt/TXTFOEventHandlerMaker.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/render/txt/TXTHandler.java
Modified:
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/   (props changed)
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/fop
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/compliance.ihtml
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/faq.xml
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOURIResolver.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOUserAgent.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FopFactory.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOTreeBuilder.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/CommonFont.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/java/org/apache/fop/UtilityCodeTestSuite.java
    xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/test/layoutengine/standard-testcases/block_font-weight.xml

Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep 25 05:44:20 2007
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-550000
+/xmlgraphics/fop/trunk:1-554093

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/fop
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/fop?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/fop (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/fop Tue Sep 25 05:44:20 2007
@@ -22,6 +22,8 @@
 no_config=false
 fop_exec_debug=false
 show_help=false
+export IFS="
+"
 for arg in "$@" ; do
   if [ "$arg" = "--noconfig" ] ; then
     no_config=true

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/compliance.ihtml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/compliance.ihtml?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/compliance.ihtml (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/compliance.ihtml Tue Sep 25 05:44:20 2007
@@ -1499,15 +1499,16 @@
       <td class="no">
         no
       </td>
-      <td class="yes">
-        yes
+      <td class="partial">
+        partial
       </td>
-      <td class="yes">
-        yes
+      <td class="partial">
+        partial
       </td>
       <td align="left">
         <ul>
           <li>[0.20.5] Uses the proprietary fox:outline extension.</li>
+          <li>[0.93] color, font-style and font-weight are not supported, yet.</li>
         </ul>
       </td>
     </tr>

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/faq.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/faq.xml?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/faq.xml (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/documentation/content/xdocs/faq.xml Tue Sep 25 05:44:20 2007
@@ -912,9 +912,17 @@
       <question>How do I control the Acrobat bookmark display?</question>
       <answer>
         <p>
-          FOP does not currently support this feature. Possible workarounds
-          include those mentioned in the <link href="#PDF-postprocess">PDF
+          FOP 0.20.5 does not support this feature. Possible workarounds
+          include those mentioned in the <link href="0.93/output.html#pdf-postprocess">PDF
             Post-Processing FAQ</link>.
+        </p>
+        <p>
+          FOP versions 0.93 and later support the starting-state property of the XSL 1.1
+          <link href="http://www.w3.org/TR/xsl11/#fo_bookmark">fo:bookmark</link>
+          element which can be used for this. The color, font-style and 
+          font-weight properties on 
+          <link href="http://www.w3.org/TR/xsl11/#fo_bookmark-title">fo:bookmark-title</link>
+          are not yet supported, though.
         </p>
       </answer>
     </faq>

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOURIResolver.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOURIResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOURIResolver.java Tue Sep 25 05:44:20 2007
@@ -19,7 +19,6 @@
 
 package org.apache.fop.apps;
 
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -30,28 +29,34 @@
 
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
 import javax.xml.transform.stream.StreamSource;
 
 // commons logging
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.fop.util.DataURIResolver;
 
-// base64 support for "data" urls
-import org.apache.xmlgraphics.util.io.Base64DecodeStream;
 import org.apache.xmlgraphics.util.io.Base64EncodeStream;
 
 /**
- * Provides FOP specific URI resolution.
- * This is the default URIResolver {@link FOUserAgent} will use unless overidden.
+ * Provides FOP specific URI resolution. This is the default URIResolver
+ * {@link FOUserAgent} will use unless overidden.
+ * 
  * @see javax.xml.transform.URIResolver
  */
-public class FOURIResolver
-    implements javax.xml.transform.URIResolver {
-    
+public class FOURIResolver implements javax.xml.transform.URIResolver {
+
     // log
     private Log log = LogFactory.getLog("FOP");
 
-    // true if exceptions are to be thrown if the URIs cannot be resolved.
+    /** URIResolver for RFC 2397 data URLs */
+    private URIResolver dataURIResolver = new DataURIResolver();
+    
+    /** A user settable URI Resolver */
+    private URIResolver uriResolver = null;
+
+    /** true if exceptions are to be thrown if the URIs cannot be resolved. */
     private boolean throwExceptions = false;
 
     /**
@@ -60,23 +65,28 @@
     public FOURIResolver() {
         this(false);
     }
-    
+
     /**
      * Additional constructor
-     * @param throwExceptions true if exceptions are to be thrown if the URIs cannot be
-     *              resolved.
+     * 
+     * @param throwExceptions
+     *            true if exceptions are to be thrown if the URIs cannot be
+     *            resolved.
      */
     public FOURIResolver(boolean throwExceptions) {
         this.throwExceptions = throwExceptions;
     }
-    
+
     /**
      * Handles resolve exceptions appropriately.
-     * @param errorStr error string
-     * @param strict strict user config
+     * 
+     * @param errorStr
+     *            error string
+     * @param strict
+     *            strict user config
      */
     private void handleException(Exception e, String errorStr, boolean strict)
-    throws TransformerException {
+            throws TransformerException {
         if (strict) {
             throw new TransformerException(errorStr, e);
         }
@@ -84,182 +94,220 @@
     }
 
     /**
-     * Called by the processor through {@link FOUserAgent} when it encounters an 
-     * uri in an external-graphic element.
-     * (see also {@link javax.xml.transform.URIResolver#resolve(String, String)}
-     * This resolver will allow URLs without a scheme, i.e. it assumes 'file:' as
-     * the default scheme. It also allows relative URLs with scheme, 
-     * e.g. file:../../abc.jpg which is not strictly RFC compliant as long as the 
-     * scheme is the same as the scheme of the base URL. If the base URL is null 
+     * Called by the processor through {@link FOUserAgent} when it encounters an
+     * uri in an external-graphic element. (see also
+     * {@link javax.xml.transform.URIResolver#resolve(String, String)} This
+     * resolver will allow URLs without a scheme, i.e. it assumes 'file:' as the
+     * default scheme. It also allows relative URLs with scheme, e.g.
+     * file:../../abc.jpg which is not strictly RFC compliant as long as the
+     * scheme is the same as the scheme of the base URL. If the base URL is null
      * a 'file:' URL referencing the current directory is used as the base URL.
-     * If the method is successful it will return a Source of type 
-     * {@link javax.xml.transform.stream.StreamSource} with its SystemID set to 
+     * If the method is successful it will return a Source of type
+     * {@link javax.xml.transform.stream.StreamSource} with its SystemID set to
      * the resolved URL used to open the underlying InputStream.
      * 
-     * @param href An href attribute, which may be relative or absolute.
-     * @param base The base URI against which the first argument will be made 
-     * absolute if the absolute URI is required. 
-     * @return A {@link javax.xml.transform.Source} object, or null if the href 
-     * cannot be resolved. 
-     * @throws javax.xml.transform.TransformerException Never thrown by this implementation.
+     * @param href
+     *            An href attribute, which may be relative or absolute.
+     * @param base
+     *            The base URI against which the first argument will be made
+     *            absolute if the absolute URI is required.
+     * @return A {@link javax.xml.transform.Source} object, or null if the href
+     *         cannot be resolved.
+     * @throws javax.xml.transform.TransformerException
+     *             Never thrown by this implementation.
      * @see javax.xml.transform.URIResolver#resolve(String, String)
      */
-    public Source resolve(String href, String base) throws TransformerException {        
-        // data URLs can be quite long so don't try to build a File (can lead to problems)
-        if (href.startsWith("data:")) {
-            return parseDataURI(href);
+    public Source resolve(String href, String base) throws TransformerException {
+        Source source = null;
+        
+        // data URLs can be quite long so evaluate early and don't try to build a File
+        // (can lead to problems)
+        source = dataURIResolver.resolve(href, base);
+        
+        // Custom uri resolution
+        if (source == null && uriResolver != null) {
+            source = uriResolver.resolve(href, base);
         }
 
-        URL absoluteURL = null;
-        File file = new File(href);
-        if (file.canRead() && file.isFile()) {
-            try {
-                absoluteURL = file.toURL();
-            } catch (MalformedURLException mfue) {
-                handleException(mfue,
-                        "Could not convert filename '" + href + "' to URL", throwExceptions);
-            }
-        } else {
-            // no base provided
-            if (base == null) {
-                // We don't have a valid file protocol based URL
+        // Fallback to default resolution mechanism
+        if (source == null) {
+            URL absoluteURL = null;
+            File file = new File(href);
+            if (file.canRead() && file.isFile()) {
                 try {
-                    absoluteURL = new URL(href);
-                } catch (MalformedURLException mue) {
+                    absoluteURL = file.toURL();
+                } catch (MalformedURLException mfue) {
+                    handleException(mfue, "Could not convert filename '" + href
+                            + "' to URL", throwExceptions);
+                }
+            } else {
+                // no base provided
+                if (base == null) {
+                    // We don't have a valid file protocol based URL
                     try {
-                        // the above failed, we give it another go in case
-                        // the href contains only a path then file: is assumed
-                        absoluteURL = new URL("file:" + href);
-                    } catch (MalformedURLException mfue) {
-                        handleException(mfue,
-                                "Error with URL '" + href + "'", throwExceptions);
+                        absoluteURL = new URL(href);
+                    } catch (MalformedURLException mue) {
+                        try {
+                            // the above failed, we give it another go in case
+                            // the href contains only a path then file: is
+                            // assumed
+                            absoluteURL = new URL("file:" + href);
+                        } catch (MalformedURLException mfue) {
+                            handleException(mfue, "Error with URL '" + href
+                                    + "'", throwExceptions);
+                        }
                     }
-                }
 
-            // try and resolve from context of base
-            } else {
-                URL baseURL = null;
-                try {
-                    baseURL = new URL(base);
-                } catch (MalformedURLException mfue) {
-                    handleException(mfue, "Error with base URL '" + base + "'", throwExceptions);
-                }
+                    // try and resolve from context of base
+                } else {
+                    URL baseURL = null;
+                    try {
+                        baseURL = new URL(base);
+                    } catch (MalformedURLException mfue) {
+                        handleException(mfue, "Error with base URL '" + base
+                                + "'", throwExceptions);
+                    }
 
-                /*
-                 * This piece of code is based on the following statement in
-                 * RFC2396 section 5.2:
-                 * 
-                 * 3) If the scheme component is defined, indicating that the
-                 * reference starts with a scheme name, then the reference is
-                 * interpreted as an absolute URI and we are done. Otherwise,
-                 * the reference URI's scheme is inherited from the base URI's
-                 * scheme component.
-                 * 
-                 * Due to a loophole in prior specifications [RFC1630], some
-                 * parsers allow the scheme name to be present in a relative URI
-                 * if it is the same as the base URI scheme. Unfortunately, this
-                 * can conflict with the correct parsing of non-hierarchical
-                 * URI. For backwards compatibility, an implementation may work
-                 * around such references by removing the scheme if it matches
-                 * that of the base URI and the scheme is known to always use
-                 * the <hier_part> syntax.
-                 * 
-                 * The URL class does not implement this work around, so we do.
-                 */
-                String scheme = baseURL.getProtocol() + ":";
-                if (href.startsWith(scheme)) {
-                    href = href.substring(scheme.length());
-                    if ("file:".equals(scheme)) {
-                        int colonPos = href.indexOf(':');
-                        int slashPos = href.indexOf('/');
-                        if (slashPos >= 0 && colonPos >= 0 && colonPos < slashPos) {
-                            href = "/" + href; // Absolute file URL doesn't
-                                                // have a leading slash
+                    /*
+                     * This piece of code is based on the following statement in
+                     * RFC2396 section 5.2:
+                     * 
+                     * 3) If the scheme component is defined, indicating that
+                     * the reference starts with a scheme name, then the
+                     * reference is interpreted as an absolute URI and we are
+                     * done. Otherwise, the reference URI's scheme is inherited
+                     * from the base URI's scheme component.
+                     * 
+                     * Due to a loophole in prior specifications [RFC1630], some
+                     * parsers allow the scheme name to be present in a relative
+                     * URI if it is the same as the base URI scheme.
+                     * Unfortunately, this can conflict with the correct parsing
+                     * of non-hierarchical URI. For backwards compatibility, an
+                     * implementation may work around such references by
+                     * removing the scheme if it matches that of the base URI
+                     * and the scheme is known to always use the <hier_part>
+                     * syntax.
+                     * 
+                     * The URL class does not implement this work around, so we
+                     * do.
+                     */
+                    String scheme = baseURL.getProtocol() + ":";
+                    if (href.startsWith(scheme)) {
+                        href = href.substring(scheme.length());
+                        if ("file:".equals(scheme)) {
+                            int colonPos = href.indexOf(':');
+                            int slashPos = href.indexOf('/');
+                            if (slashPos >= 0 && colonPos >= 0
+                                    && colonPos < slashPos) {
+                                href = "/" + href; // Absolute file URL doesn't
+                                // have a leading slash
+                            }
                         }
                     }
+                    try {
+                        absoluteURL = new URL(baseURL, href);
+                    } catch (MalformedURLException mfue) {
+                        handleException(mfue, "Error with URL; base '" + base
+                                + "' " + "href '" + href + "'", throwExceptions);
+                    }
                 }
+            }
+
+            if (absoluteURL != null) {
+                String effURL = absoluteURL.toExternalForm();
                 try {
-                    absoluteURL = new URL(baseURL, href);
-                } catch (MalformedURLException mfue) {
-                    handleException(mfue,
-                            "Error with URL; base '" + base + "' " + "href '" + href + "'",
-                            throwExceptions);                        
+                    URLConnection connection = absoluteURL.openConnection();
+                    connection.setAllowUserInteraction(false);
+                    connection.setDoInput(true);
+                    updateURLConnection(connection, href);
+                    connection.connect();
+                    return new StreamSource(connection.getInputStream(), effURL);
+                } catch (FileNotFoundException fnfe) {
+                    // Note: This is on "debug" level since the caller is
+                    // supposed to handle this
+                    log.debug("File not found: " + effURL);
+                } catch (java.io.IOException ioe) {
+                    log.error("Error with opening URL '" + effURL + "': "
+                            + ioe.getMessage());
                 }
             }
         }
-        
-        if (absoluteURL != null) {
-            String effURL = absoluteURL.toExternalForm();
-            try {
-                URLConnection connection = absoluteURL.openConnection();
-                connection.setAllowUserInteraction(false);
-                connection.setDoInput(true);
-                updateURLConnection(connection, href);
-                connection.connect();
-                return new StreamSource(connection.getInputStream(), effURL);
-            } catch (FileNotFoundException fnfe) {
-                //Note: This is on "debug" level since the caller is supposed to handle this
-                log.debug("File not found: " + effURL);
-            } catch (java.io.IOException ioe) {
-                log.error("Error with opening URL '" + effURL + "': " + ioe.getMessage());
-            }
-        }
-        return null;
+        return source;
     }
 
     /**
-     * This method allows you to set special values on a URLConnection just before the connect()
-     * method is called. Subclass FOURIResolver and override this method to do things like
-     * adding the user name and password for HTTP basic authentication.
-     * @param connection the URLConnection instance
-     * @param href the original URI
+     * This method allows you to set special values on a URLConnection just
+     * before the connect() method is called. Subclass FOURIResolver and
+     * override this method to do things like adding the user name and password
+     * for HTTP basic authentication.
+     * 
+     * @param connection
+     *            the URLConnection instance
+     * @param href
+     *            the original URI
      */
     protected void updateURLConnection(URLConnection connection, String href) {
-        //nop
+        // nop
     }
-    
+
     /**
-     * This is a convenience method for users who want to override updateURLConnection for
-     * HTTP basic authentication. Simply call it using the right username and password.
-     * @param connection the URLConnection to set up for HTTP basic authentication
-     * @param username the username
-     * @param password the password
+     * This is a convenience method for users who want to override
+     * updateURLConnection for HTTP basic authentication. Simply call it using
+     * the right username and password.
+     * 
+     * @param connection
+     *            the URLConnection to set up for HTTP basic authentication
+     * @param username
+     *            the username
+     * @param password
+     *            the password
      */
-    protected void applyHttpBasicAuthentication(URLConnection connection, 
+    protected void applyHttpBasicAuthentication(URLConnection connection,
             String username, String password) {
         String combined = username + ":" + password;
         try {
-            ByteArrayOutputStream baout = new ByteArrayOutputStream(combined.length() * 2);
+            ByteArrayOutputStream baout = new ByteArrayOutputStream(combined
+                    .length() * 2);
             Base64EncodeStream base64 = new Base64EncodeStream(baout);
-            //TODO Not sure what charset/encoding can be used with basic authentication
+            // TODO Not sure what charset/encoding can be used with basic
+            // authentication
             base64.write(combined.getBytes("UTF-8"));
             base64.close();
-            connection.setRequestProperty("Authorization", 
-                    "Basic " + new String(baout.toByteArray(), "UTF-8"));
+            connection.setRequestProperty("Authorization", "Basic "
+                    + new String(baout.toByteArray(), "UTF-8"));
         } catch (IOException e) {
-            //won't happen. We're operating in-memory.
-            throw new RuntimeException("Error during base64 encodation of username/password");
+            // won't happen. We're operating in-memory.
+            throw new RuntimeException(
+                    "Error during base64 encodation of username/password");
         }
     }
-    
+
     /**
-     * Parses inline data URIs as generated by MS Word's XML export and FO stylesheet.
-     * @see <a href="http://www.ietf.org/rfc/rfc2397">RFC 2397</a>
+     * Sets the custom URI Resolver. It is used for resolving factory-level URIs like
+     * hyphenation patterns and as backup for URI resolution performed during a
+     * rendering run.
+     * 
+     * @param resolver
+     *            the new URI resolver
      */
-    private Source parseDataURI(String href) {
-        int commaPos = href.indexOf(',');
-        // header is of the form data:[<mediatype>][;base64]
-        String header = href.substring(0, commaPos);
-        String data = href.substring(commaPos + 1);
-        if (header.endsWith(";base64")) {
-            byte[] bytes = data.getBytes();
-            ByteArrayInputStream encodedStream = new ByteArrayInputStream(bytes);
-            Base64DecodeStream decodedStream = new Base64DecodeStream(encodedStream);
-            return new StreamSource(decodedStream);
-        } else {
-            //Note that this is not quite the full story here. But since we are only interested
-            //in base64-encoded binary data, the next line will probably never be called.
-            return new StreamSource(new java.io.StringReader(data));
-        }
+    public void setCustomURIResolver(URIResolver resolver) {
+        this.uriResolver = resolver;
+    }
+
+    /**
+     * Returns the custom URI Resolver.
+     * 
+     * @return the URI Resolver or null, if none is set
+     */
+    public URIResolver getCustomURIResolver() {
+        return this.uriResolver;
+    }
+
+    /**
+     * @param throwExceptions
+     *            Whether or not to throw exceptions on resolution error
+     */
+    public void setThrowExceptions(boolean throwExceptions) {
+        this.throwExceptions = throwExceptions;
     }
 }

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOUserAgent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOUserAgent.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOUserAgent.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FOUserAgent.java Tue Sep 25 05:44:20 2007
@@ -86,6 +86,7 @@
     private File outputFile = null;
     private Renderer rendererOverride = null;
     private FOEventHandler foEventHandlerOverride = null;
+    private boolean locatorEnabled = true; // true by default (for error messages).
     
     /** Producer:  Metadata element for the system/software that produces
      * the document. (Some renderers can store this in the document.)
@@ -361,26 +362,27 @@
      * Attempts to resolve the given URI.
      * Will use the configured resolver and if not successful fall back
      * to the default resolver.
-     * @param uri URI to access
+     * @param href URI to access
      * @param base the base URI to resolve against
      * @return A {@link javax.xml.transform.Source} object, or null if the URI
      * cannot be resolved. 
      * @see org.apache.fop.apps.FOURIResolver
      */
-    public Source resolveURI(String uri, String base) {
+    public Source resolveURI(String href, String base) {
         Source source = null;
-        //RFC 2397 data URLs don't need to be resolved, just decode them.
-        boolean bypassURIResolution = uri.startsWith("data:");
+        //RFC 2397 data URLs don't need to be resolved, just decode them through FOP's default
+        //URIResolver.
+        boolean bypassURIResolution = href.startsWith("data:");
         if (!bypassURIResolution && uriResolver != null) {
             try {
-                source = uriResolver.resolve(uri, base);
+                source = uriResolver.resolve(href, base);
             } catch (TransformerException te) {
-                log.error("Attempt to resolve URI '" + uri + "' failed: ", te);
+                log.error("Attempt to resolve URI '" + href + "' failed: ", te);
             }
         }
         if (source == null) {
             // URI Resolver not configured or returned null, use default resolver from the factory
-            source = getFactory().resolveURI(uri, base);
+            source = getFactory().resolveURI(href, base);
         }
         return source;
     }
@@ -516,5 +518,25 @@
     public XMLHandlerRegistry getXMLHandlerRegistry() {
         return getFactory().getXMLHandlerRegistry();
     }
+    
+    /**
+     * Controls the use of SAXLocators to provide location information in error
+     * messages.
+     * 
+     * @param enableLocator <code>false</code> if SAX Locators should be disabled
+     * @return true if context information should be stored on each node in the FO tree.
+     */
+    public void setLocatorEnabled(boolean enableLocator) {
+        locatorEnabled = enableLocator;
+    }
+
+    /**
+     * Checks if the use of Locators is enabled
+     * @return true if context information should be stored on each node in the FO tree.
+     */
+    public boolean isLocatorEnabled() {
+        return locatorEnabled;
+    }
+
 }
 

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FopFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FopFactory.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FopFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/apps/FopFactory.java Tue Sep 25 05:44:20 2007
@@ -15,13 +15,11 @@
  * limitations under the License.
  */
 
-/* $Id$ */
+/* $Id: $ */
 
 package org.apache.fop.apps;
 
 import java.awt.color.ColorSpace;
-import java.awt.color.ICC_ColorSpace;
-import java.awt.color.ICC_Profile;
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -29,13 +27,11 @@
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Map;
 import java.util.Set;
 
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.URIResolver;
-import javax.xml.transform.stream.StreamSource;
 
 import org.xml.sax.SAXException;
 
@@ -52,6 +48,7 @@
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
 import org.apache.fop.render.RendererFactory;
 import org.apache.fop.render.XMLHandlerRegistry;
+import org.apache.fop.util.ColorSpaceCache;
 import org.apache.fop.util.ContentHandlerFactoryRegistry;
 
 /**
@@ -66,10 +63,10 @@
     private static Log log = LogFactory.getLog(FopFactory.class);
     
     /** Factory for Renderers and FOEventHandlers */
-    private RendererFactory rendererFactory = new RendererFactory();
+    private RendererFactory rendererFactory;
     
     /** Registry for XML handlers */
-    private XMLHandlerRegistry xmlHandlers = new XMLHandlerRegistry();
+    private XMLHandlerRegistry xmlHandlers;
     
     /** The registry for ElementMapping instances */
     private ElementMappingRegistry elementMappingRegistry;
@@ -78,17 +75,13 @@
     private ContentHandlerFactoryRegistry contentHandlerFactoryRegistry 
                 = new ContentHandlerFactoryRegistry();
     
-    /** Our default resolver if none is set */
-    private URIResolver foURIResolver = null;
-    
-    /** A user settable URI Resolver */
-    private URIResolver uriResolver = null;
-
     /** The resolver for user-supplied hyphenation patterns */
-    private HyphenationTreeResolver hyphResolver;
+    private HyphenationTreeResolver hyphResolver = null;
+
+    private ColorSpaceCache colorSpaceCache = null;
     
     /** Image factory for creating fop image objects */
-    private ImageFactory imageFactory = new ImageFactory();
+    private ImageFactory imageFactory;
 
     /** Configuration layer used to configure fop */
     private FopFactoryConfigurator config = null;
@@ -145,11 +138,10 @@
     /** Optional overriding LayoutManagerMaker */
     private LayoutManagerMaker lmMakerOverride = null;
 
-    private Set ignoredNamespaces = new java.util.HashSet();
+    private Set ignoredNamespaces;
+
+    private FOURIResolver foURIResolver;
     
-    /** Map with cached ICC based ColorSpace objects. */
-    private Map colorSpaceMap = null;
-        
     /**
      * Main constructor.
      */
@@ -157,8 +149,11 @@
         this.config = new FopFactoryConfigurator(this);
         this.elementMappingRegistry = new ElementMappingRegistry(this);
         this.foURIResolver = new FOURIResolver(validateUserConfigStrictly());
-        // Use a synchronized Map - I am not really sure this is needed, but better safe than sorry.
-        this.colorSpaceMap = Collections.synchronizedMap(new java.util.HashMap());
+        this.colorSpaceCache = new ColorSpaceCache(foURIResolver);
+        this.imageFactory = new ImageFactory();        
+        this.rendererFactory = new RendererFactory();
+        this.xmlHandlers = new XMLHandlerRegistry();
+        this.ignoredNamespaces = new java.util.HashSet();
         setUseCache(FopFactoryConfigurator.DEFAULT_USE_CACHE);
     }
     
@@ -397,11 +392,12 @@
      * */
     public void setHyphenBaseURL(final String hyphenBase) throws MalformedURLException {
         if (hyphenBase != null) {
-            this.hyphResolver = new HyphenationTreeResolver() {
+            setHyphenationTreeResolver(
+            new HyphenationTreeResolver() {
                 public Source resolve(String href) {
                     return resolveURI(href, hyphenBase);
                 }
-            };
+            });
         }
         this.hyphenBase = checkBaseURL(hyphenBase);
     }
@@ -411,8 +407,8 @@
      * patterns and as backup for URI resolution performed during a rendering run. 
      * @param resolver the new URI resolver
      */
-    public void setURIResolver(URIResolver resolver) {
-        this.uriResolver = resolver;
+    public void setURIResolver(URIResolver uriResolver) {
+        foURIResolver.setCustomURIResolver(uriResolver);
     }
 
     /**
@@ -420,7 +416,7 @@
      * @return the URI Resolver
      */
     public URIResolver getURIResolver() {
-        return this.uriResolver;
+        return foURIResolver;
     }
 
     /** @return the HyphenationTreeResolver for resolving user-supplied hyphenation patterns. */
@@ -429,6 +425,14 @@
     }
     
     /**
+     * sets the HyphenationTreeResolver
+     * @param hyphResolver
+     */
+    public void setHyphenationTreeResolver(HyphenationTreeResolver hyphResolver) {
+        this.hyphResolver = hyphResolver;
+    }
+
+    /**
      * Activates strict XSL content model validation for FOP
      * Default is false (FOP will continue processing where it can)
      * @param validateStrictly true to turn on strict validation
@@ -669,6 +673,7 @@
      */
     public void setStrictUserConfigValidation(boolean strictUserConfigValidation) {
         this.strictUserConfigValidation = strictUserConfigValidation;
+        this.foURIResolver.setThrowExceptions(strictUserConfigValidation);
     }
 
     /**
@@ -708,39 +713,22 @@
         return this.fontCache;
     }
     
-    //------------------------------------------- URI resolution
-
     /**
      * Attempts to resolve the given URI.
      * Will use the configured resolver and if not successful fall back
      * to the default resolver.
-     * @param uri URI to access
+     * @param href URI to access
      * @param baseUri the base URI to resolve against
      * @return A {@link javax.xml.transform.Source} object, or null if the URI
      * cannot be resolved. 
      * @see org.apache.fop.apps.FOURIResolver
      */
-    public Source resolveURI(String uri, String baseUri) {
+    public Source resolveURI(String href, String baseUri) {
         Source source = null;
-        //RFC 2397 data URLs don't need to be resolved, just decode them.
-        boolean bypassURIResolution = uri.startsWith("data:");
-        if (!bypassURIResolution && uriResolver != null) {
-            try {
-                source = uriResolver.resolve(uri, baseUri);
-            } catch (TransformerException te) {
-                log.error("Attempt to resolve URI '" + uri + "' failed: ", te);
-                if (validateUserConfigStrictly()) {
-                    return null;
-                }
-            }
-        }
-        if (source == null) {
-            // URI Resolver not configured or returned null, use default resolver
-            try {
-                source = foURIResolver.resolve(uri, baseUri);
-            } catch (TransformerException te) {
-                log.error("Attempt to resolve URI '" + uri + "' failed: ", te);
-            }
+        try {
+            source = foURIResolver.resolve(href, baseUri);
+        } catch (TransformerException e) {
+            log.error("Attempt to resolve URI '" + href + "' failed: ", e);
         }
         return source;
     }
@@ -759,47 +747,6 @@
      * @return ICC ColorSpace object or null if ColorSpace could not be created 
      */
     public ColorSpace getColorSpace(String baseUri, String iccProfileSrc) {
-        ColorSpace colorSpace = null;
-        if (!this.colorSpaceMap.containsKey(baseUri + iccProfileSrc)) {
-            try {
-                ICC_Profile iccProfile = null;
-                // First attempt to use the FOP URI resolver to locate the ICC
-                // profile
-                Source src = this.resolveURI(iccProfileSrc, baseUri);
-                if (src != null && src instanceof StreamSource) {
-                    // FOP URI resolver found ICC profile - create ICC profile
-                    // from the Source
-                    iccProfile = ICC_Profile.getInstance(((StreamSource) src)
-                            .getInputStream());
-                } else {
-                    // TODO - Would it make sense to fall back on VM ICC
-                    // resolution
-                    // Problem is the cache might be more difficult to maintain
-                    // 
-                    // FOP URI resolver did not find ICC profile - perhaps the
-                    // Java VM can find it?
-                    // iccProfile = ICC_Profile.getInstance(iccProfileSrc);
-                }
-                if (iccProfile != null) {
-                    colorSpace = new ICC_ColorSpace(iccProfile);
-                }
-            } catch (IOException e) {
-                // Ignore exception - will be logged a bit further down
-                // (colorSpace == null case)
-            }
-
-            if (colorSpace != null) {
-                // Put in cache (not when VM resolved it as we can't control
-                this.colorSpaceMap.put(baseUri + iccProfileSrc, colorSpace);
-            } else {
-                // TODO To avoid an excessive amount of warnings perhaps
-                // register a null ColorMap in the colorSpaceMap
-                log.warn("Color profile '" + iccProfileSrc + "' not found.");
-            }
-        } else {
-            colorSpace = (ColorSpace) this.colorSpaceMap.get(baseUri
-                    + iccProfileSrc);
-        }
-        return colorSpace;
+        return colorSpaceCache.get(baseUri, iccProfileSrc);
     }    
 }

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/Constants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/Constants.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/Constants.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/Constants.java Tue Sep 25 05:44:20 2007
@@ -1054,39 +1054,39 @@
     /** Enumeration constant */
     int EN_LIGHTER = 168;
     /** Enumeration constant */
-    int EN_100 = 168;
+    int EN_100 = 169;
     /** Enumeration constant */
-    int EN_200 = 169;
+    int EN_200 = 170;
     /** Enumeration constant */
-    int EN_300 = 170;
+    int EN_300 = 171;
     /** Enumeration constant */
-    int EN_400 = 171;
+    int EN_400 = 172;
     /** Enumeration constant */
-    int EN_500 = 172;
+    int EN_500 = 173;
     /** Enumeration constant */
-    int EN_600 = 173;
+    int EN_600 = 174;
     /** Enumeration constant */
-    int EN_700 = 174;
+    int EN_700 = 175;
     /** Enumeration constant */
-    int EN_800 = 175;
+    int EN_800 = 176;
     /** Enumeration constant */
-    int EN_900 = 176;
+    int EN_900 = 177;
     /** Enumeration constant -- page-break-shorthand */
-    int EN_AVOID = 177;
+    int EN_AVOID = 178;
     /** Enumeration constant -- white-space shorthand */
-    int EN_PRE = 178;
+    int EN_PRE = 179;
     /** Enumeration constant -- font shorthand */
-    int EN_CAPTION = 179;
+    int EN_CAPTION = 180;
     /** Enumeration constant -- font shorthand */
-    int EN_ICON = 180;
+    int EN_ICON = 181;
     /** Enumeration constant -- font shorthand */
-    int EN_MENU = 181;
+    int EN_MENU = 182;
     /** Enumeration constant -- font shorthand */
-    int EN_MESSAGE_BOX = 182;
+    int EN_MESSAGE_BOX = 183;
     /** Enumeration constant -- font shorthand */
-    int EN_SMALL_CAPTION = 183;
+    int EN_SMALL_CAPTION = 184;
     /** Enumeration constant -- font shorthand */
-    int EN_STATUS_BAR = 184;
+    int EN_STATUS_BAR = 185;
     /** Number of enumeration constants defined */
-    int ENUM_COUNT = 184;
+    int ENUM_COUNT = 185;
 }

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOPropertyMapping.java Tue Sep 25 05:44:20 2007
@@ -41,6 +41,7 @@
 import org.apache.fop.fo.properties.FontShorthandProperty;
 import org.apache.fop.fo.properties.FontSizePropertyMaker;
 import org.apache.fop.fo.properties.FontStretchPropertyMaker;
+import org.apache.fop.fo.properties.FontWeightPropertyMaker;
 import org.apache.fop.fo.properties.GenericShorthandParser;
 import org.apache.fop.fo.properties.IndentPropertyMaker;
 import org.apache.fop.fo.properties.KeepProperty;
@@ -1032,7 +1033,7 @@
         addPropertyMaker("font-variant", m);
 
         // font-weight
-        m  = new EnumProperty.Maker(PR_FONT_WEIGHT);
+        m  = new FontWeightPropertyMaker(PR_FONT_WEIGHT);
         m.setInherited(true);
         m.addKeyword("normal", "400");
         m.addKeyword("bold", "700");

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOTreeBuilder.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOTreeBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/FOTreeBuilder.java Tue Sep 25 05:44:20 2007
@@ -110,11 +110,10 @@
      * true no Locator is passed to the FO tree nodes which would copy the information into
      * a SAX LocatorImpl instance.
      * @return true if no context information should be stored on each node in the FO tree.
+     * @deprecated Use FOUserAgent.isLocatorEnabled() instead.
      */
     protected boolean isLocatorDisabled() {
-        //TODO make this configurable through the FOUserAgent so people can optimize memory
-        //consumption.
-        return false;
+        return !userAgent.isLocatorEnabled();
     }
     
     /**
@@ -127,7 +126,7 @@
     
     /** @return a Locator instance if it is available and not disabled */
     protected Locator getEffectiveLocator() {
-        return (isLocatorDisabled() ? null : this.locator);
+        return (userAgent.isLocatorEnabled() ? this.locator : null);
     }
     
     /**

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/flow/RetrieveMarker.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/flow/RetrieveMarker.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Tue Sep 25 05:44:20 2007
@@ -19,26 +19,17 @@
 
 package org.apache.fop.fo.flow;
 
-import java.util.HashMap;
 import java.util.Iterator;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FOPropertyMapping;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.StaticPropertyList;
 import org.apache.fop.fo.ValidationException;
-import org.apache.fop.fo.expr.PropertyException;
-import org.apache.fop.fo.properties.Property;
-import org.apache.fop.fo.properties.PropertyMaker;
-import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 
-
-
 /**
  * The retrieve-marker formatting object.
  * This will create a layout manager that will retrieve
@@ -145,14 +136,14 @@
                 }
                 cloneSubtree(child.getChildNodes(), newChild,
                         marker, newPropertyList);
-                if (newChild instanceof FObjMixed) {
-                    handleWhiteSpaceFor((FObjMixed) newChild);
-                }
             } else if (child instanceof FOText) {
                 FOText ft = (FOText) newChild;
                 ft.bind(parentPropertyList);
             }
             addChildTo(newChild, (FObj) newParent);
+            if (newChild instanceof FObjMixed) {
+                handleWhiteSpaceFor((FObjMixed) newChild);
+            }
         }
     }
     

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/CommonFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/CommonFont.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/CommonFont.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/fo/properties/CommonFont.java Tue Sep 25 05:44:20 2007
@@ -132,23 +132,18 @@
         if (fontState == null) {
             /**@todo this is ugly. need to improve. */
 
-            int font_weight = 400;
-            if (fontWeight == Constants.EN_BOLDER) {
-                // +100 from inherited
-            } else if (fontWeight == Constants.EN_LIGHTER) {
-                // -100 from inherited
-            } else {
-                switch (fontWeight) {
-                case Constants.EN_100: font_weight = 100; break;
-                case Constants.EN_200: font_weight = 200; break;
-                case Constants.EN_300: font_weight = 300; break;
-                case Constants.EN_400: font_weight = 400; break;
-                case Constants.EN_500: font_weight = 500; break;
-                case Constants.EN_600: font_weight = 600; break;
-                case Constants.EN_700: font_weight = 700; break;
-                case Constants.EN_800: font_weight = 800; break;
-                case Constants.EN_900: font_weight = 900; break;
-                }
+            int font_weight;
+            switch (fontWeight) {
+            case Constants.EN_100: font_weight = 100; break;
+            case Constants.EN_200: font_weight = 200; break;
+            case Constants.EN_300: font_weight = 300; break;
+            case Constants.EN_400: font_weight = 400; break;
+            case Constants.EN_500: font_weight = 500; break;
+            case Constants.EN_600: font_weight = 600; break;
+            case Constants.EN_700: font_weight = 700; break;
+            case Constants.EN_800: font_weight = 800; break;
+            case Constants.EN_900: font_weight = 900; break;
+            default: font_weight = 400;
             }
 
             String style;

Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java?rev=579224&r1=579223&r2=579224&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java Tue Sep 25 05:44:20 2007
@@ -111,14 +111,17 @@
         return penalty == -KnuthElement.INFINITE;
     }
     
-    /** @return the break class of this penalty (one of the break-* constants) */
+    /**
+     * @return the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE,
+     * EN_ODD_PAGE)
+     */
     public int getBreakClass() {
         return breakClass;
     }
     
     /**
      * Sets the break class for this penalty.
-     * @param cl the break class (one of the break-* constants)
+     * @param cl the break class (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, EN_ODD_PAGE)
      */
     public void setBreakClass(int cl) {
         this.breakClass = cl;



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