From 5ad987ec7a433d5d0948cd6eae807723784e6303 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 10 Aug 2008 12:35:42 +0000 Subject: [PATCH] Bugzilla 45490: Avoid altering the original 'href' if the protocol is other than 'file:' (suggested by Thomas Stieler) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@684491 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/apps/FOURIResolver.java | 19 ++-- status.xml | 96 ++++++++++--------- 2 files changed, 60 insertions(+), 55 deletions(-) diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java index 9a49b28f1..1f4425a95 100644 --- a/src/java/org/apache/fop/apps/FOURIResolver.java +++ b/src/java/org/apache/fop/apps/FOURIResolver.java @@ -108,6 +108,8 @@ public class FOURIResolver implements javax.xml.transform.URIResolver { /** * Handles resolve exceptions appropriately. * + * @param e + * the exception * @param errorStr * error string * @param strict @@ -232,17 +234,16 @@ public class FOURIResolver implements javax.xml.transform.URIResolver { * The URL class does not implement this work around, so we * do. */ + assert (baseURL != null); String scheme = baseURL.getProtocol() + ":"; - if (href.startsWith(scheme)) { + if (href.startsWith(scheme) && "file:".equals(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 - } + 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 { diff --git a/status.xml b/status.xml index 71218e3d2..39a96a1f2 100644 --- a/status.xml +++ b/status.xml @@ -50,10 +50,14 @@ - + - + + Fixed a slight error when resolving non-file URLs: avoid + altering the original 'href' if the protocol is other than 'file:' + + Added LayoutManagerMapping.registerMaker() to make registration of custom layout managers easier. @@ -74,10 +78,10 @@ when the page bpd is not the same for all pages. - Changed FONode.addCharacters() parameter to closer match the signature of + Changed FONode.addCharacters() parameter to closer match the signature of the standard SAX characters() event (reduces confusion and computations). - !! Implementors of extensions that subclass FONode directly, and - offer an implementation for addCharacters() should take care to make + !! Implementors of extensions that subclass FONode directly, and + offer an implementation for addCharacters() should take care to make similar modifications in their code !! - Added a PCL-specific extension attribute on simple-page-master for controlling + Added a PCL-specific extension attribute on simple-page-master for controlling the simplex/duplex mode. @@ -99,7 +103,7 @@ Support character-by-character font-selection strategy on fo:character element. - Added support for page-number-citation and page-number-citation-last + Added support for page-number-citation and page-number-citation-last of fo:inline. Corrected behavior for page-number-citation-last of fo:block: forward references now properly resolved. @@ -229,7 +233,7 @@ for building the FOP distribution but it is optional for normal builds and at run-time.

- This final 0.95 release also includes all of the + This final 0.95 release also includes all of the changes made for Apache FOP 0.95beta. @@ -498,7 +502,7 @@ will make up an entire page. See the documentation for details. - Added minimal support for the .minimum/.maximum components of block/inline-progression-dimension + Added minimal support for the .minimum/.maximum components of block/inline-progression-dimension on fo:external-graphic and fo:instream-foreign-object. @@ -627,7 +631,7 @@ Fix to avoid a ClassCastException in renderer configuration. - Fixed the restoration of the TLE values from the intermediate format + Fixed the restoration of the TLE values from the intermediate format for the AFP extension elements. @@ -643,9 +647,9 @@ PropertyCache phase 2:
• improvement of the PropertyCache itself should now guarantee acceptable - performance of the static caches in multi-session environments, which is + performance of the static caches in multi-session environments, which is a possible problem with synchronizedMap.
- • changed CommonFont to use the cache: + • changed CommonFont to use the cache: added CachedCommonFont to contain the properties that are always cacheable CommonFont itself is only cached if the remaining properties are absolutes.
• changed CommonHyphenation, KeepProperty, ColorProperty and FontFamilyProperty to use the cache.
@@ -660,7 +664,7 @@ Fixed erroneous usage of inherited color-values in SVG. -
+ AFP Renderer: Bugfix for 1 bit images where the width is not a multiple of 8. @@ -693,7 +697,7 @@ -> changed implementations of FObj.addChildNode(), .removeChild() and .getChildNodes() - Code cleanup and restructuring: + Code cleanup and restructuring: Refactoring of PageSequenceLayoutManager and provide common FObj id property use @@ -782,7 +786,7 @@ the available ipd, causing a restart. - Fix for PDF corruption when a TrueType font with spaces in its name is embedded and no + Fix for PDF corruption when a TrueType font with spaces in its name is embedded and no XML font metrics file for that font is used. @@ -805,7 +809,7 @@ Added support for UAX#14 type line breaking. Support does not extend across nested fo:inline elements. - +
@@ -846,10 +850,10 @@ Enabled Copy/Paste from PDF content in Acrobat Reader for text using embedded TrueType fonts. - Commented out unused properties, in order to minimize memory usage. + Commented out unused properties, in order to minimize memory usage. - Removed unused attributes from TableCell. + Removed unused attributes from TableCell. Added initial support for loading fonts without a pre-created XML font metric @@ -857,7 +861,7 @@ Support for the rgb-icc() function and for a proprietary cmyk() function (for device CMYK - colors only through the PDF renderer so far). + colors only through the PDF renderer so far). Minor fixes and improvements for the AWT Preview (keyboard shortcuts, scrolling, windows @@ -887,7 +891,7 @@ white background in order to produce bitmap output with transparency. - Split up FOText instances larger than 32K characters to avoid + Split up FOText instances larger than 32K characters to avoid integer overflow during layout. @@ -905,7 +909,7 @@ Added relaxed validation for empty list-item-*, as suggested by Gary Reed. - Modified proportional-column-width() function to log an error if used + Modified proportional-column-width() function to log an error if used with table-layout=auto @@ -925,7 +929,7 @@ Bugfix: Table headers and footers were swallowed when a table was nested in a list-block. - Fixed a bug with indent handling when margins are used on a surrounding block and + Fixed a bug with indent handling when margins are used on a surrounding block and not start/end-indent. @@ -948,7 +952,7 @@ (Note: the use of pixels in XSL-FO is discouraged!) - Bugfix: Potential multi-threading issue (ConcurrentModificationException) + Bugfix: Potential multi-threading issue (ConcurrentModificationException) eliminated for ElementMapping classes. @@ -996,7 +1000,7 @@ Bugfix: All fonts names were converted unnecessarily to lower case in RTF output. - Bugfix: The combination of hyphenation and kerning resulted in slightly ragged + Bugfix: The combination of hyphenation and kerning resulted in slightly ragged right ends for right-aligned and justified text. @@ -1008,7 +1012,7 @@ table-columns. - Bugfix: NullPointerException in RTF library when there are no borders on + Bugfix: NullPointerException in RTF library when there are no borders on the parent table. @@ -1047,7 +1051,7 @@ in a block-container. - Bugfix: basic-links with internal destinations in documents with multiple + Bugfix: basic-links with internal destinations in documents with multiple page-sequences sometimes pointed at the wrong page. @@ -1059,14 +1063,14 @@ Bugfix: Fixed OutOfMemoryException with long data URLs (RFC 2397). - Initial support for page-number-citation-last (XSL 1.1). Works without problems + Initial support for page-number-citation-last (XSL 1.1). Works without problems only for page-sequence so far. Bugfix: The generation of the PDF "d" (setdash) command was assuming that - only integer values can be used but that isn't the case. Dash patterns + only integer values can be used but that isn't the case. Dash patterns PDFGraphics2D would be wrong in the process. @@ -1100,7 +1104,7 @@ FOP 0.20.5. (See "hyphenation-base" option in the user configuration) - Bugfix: Certain filter combinations in PDF could lead to invalid PDFs. + Bugfix: Certain filter combinations in PDF could lead to invalid PDFs. DecodeParams were not properly handled. @@ -1166,19 +1170,19 @@ Added support for the from-table-column() function. - Bugfix: Spanned cells could lead to an false error message about overlapping + Bugfix: Spanned cells could lead to an false error message about overlapping cells and ultimately a NullPointerException. - Bugfix: Regions with non-standard names got ignored in RTF output leading to + Bugfix: Regions with non-standard names got ignored in RTF output leading to missing headers and footers. - The RTF output now properly generates the "\landscape" flag for documents in + The RTF output now properly generates the "\landscape" flag for documents in landscape orientation. - Following a clarification by the XSL FO SG, space traits are only set on the + Following a clarification by the XSL FO SG, space traits are only set on the first and last area generated by an FO, and not on every area anymore. @@ -1289,7 +1293,7 @@ was not rendered at all. - Fixed a bug where the area for a finished cell that is broken over pages was + Fixed a bug where the area for a finished cell that is broken over pages was created once for each row it was spanned over instead of only once. @@ -1340,7 +1344,7 @@ Added an alternative set of rules for calculating text indents which tries to mimic the behaviour of many commercial FO implementations that chose to break the rules - in the FO specification in order to better meet the natural expectations of + in the FO specification in order to better meet the natural expectations of inexperienced FO users. @@ -1360,14 +1364,14 @@ font-family list still not fully supported but a comma-separated list is now properly tokenized. - FOP will now go through all fonts in the list to find one that is available, but it doesn't - do so per character, yet. + FOP will now go through all fonts in the list to find one that is available, but it doesn't + do so per character, yet. Implemented "Overconstrained Geometry" rules (5.3.4, XSL 1.0) for the most important cases. - Bugfix: Relatively positioned BlockViewports (from block-containers) caused the paint + Bugfix: Relatively positioned BlockViewports (from block-containers) caused the paint cursor not be be properly advanced when space-before or space-after were present. @@ -1375,12 +1379,12 @@ didn't get removed. - The validation check for non-zero borders and padding on a region-* and for empty static-content - elements is now turned off when relaxed validation is active to improve compatibility with + The validation check for non-zero borders and padding on a region-* and for empty static-content + elements is now turned off when relaxed validation is active to improve compatibility with FO documents written for other FO implementations. - Bugfix for "/ by zero" ArithmeticExceptions when an URL to a non-existing image is used + Bugfix for "/ by zero" ArithmeticExceptions when an URL to a non-existing image is used and content-width and/or content-height is used. @@ -1403,15 +1407,15 @@ - Complete redesign of the FOP codebase in the period between Dec 2001 and Nov 2005. - There are just too many changes to list here. If you like to know details, run + Complete redesign of the FOP codebase in the period between Dec 2001 and Nov 2005. + There are just too many changes to list here. If you like to know details, run "svn log --verbose http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/". - For the change log for the maintenance branch - (where FOP 0.20.5 came from), please see the "CHANGES" file in the distribution, or + For the change log for the maintenance branch + (where FOP 0.20.5 came from), please see the "CHANGES" file in the distribution, or the CHANGES file in the SVN repository. @@ -1425,5 +1429,5 @@ - + -- 2.39.5