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 ac...@apache.org on 2008/09/26 13:27:36 UTC
svn commit: r699279 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./
conf/ lib/ src/documentation/content/xdocs/0.94/
src/documentation/content/xdocs/0.95/
src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/fo/
src/java/org/apache/f...
Author: acumiskey
Date: Fri Sep 26 04:27:35 2008
New Revision: 699279
URL: http://svn.apache.org/viewvc?rev=699279&view=rev
Log:
Merged revisions 693433,693462,693720,693742,693781,693784,693841,695491,695500,695776,696365,697140,697152,698280,698322,698670 via svnmerge from
https://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r693433 | acumiskey | 2008-09-09 12:00:58 +0100 (Tue, 09 Sep 2008) | 1 line
Make PFM string parsing a little more robust
........
r693462 | acumiskey | 2008-09-09 14:35:13 +0100 (Tue, 09 Sep 2008) | 1 line
This is a better fix which will cater for the case where the first character encountered is the EOF (-1) character. EOF test now only occurs when loop is exit so this should execute more efficiently.
........
r693720 | jeremias | 2008-09-10 08:46:23 +0100 (Wed, 10 Sep 2008) | 1 line
Some older TTF fonts have shorter OS/2 tables. This fixes potential EOFExceptions.
........
r693742 | jeremias | 2008-09-10 10:00:16 +0100 (Wed, 10 Sep 2008) | 3 lines
Bugzilla #45616:
Fix for table handling in RTF output, so the output works with OpenOffice and AbiWord, too.
Submitted by: Pavel Kysilka <goldenfish.at.linuxsoft.cz>
........
r693781 | jeremias | 2008-09-10 11:52:45 +0100 (Wed, 10 Sep 2008) | 3 lines
Bugzilla #45734:
Fix for PFMReader after bug #43089 (r567078) changed the behavior of PFMFile. Fixes baseline problems when Type 1 fonts are used in conjunction with XML font metric files.
Submitted by: J. Frantzius <jfrantzius.at.web.de>
........
r693784 | jeremias | 2008-09-10 11:59:27 +0100 (Wed, 10 Sep 2008) | 1 line
Credits where credits are due. I only noticed afterwards that there was a patch attached to the issue.
........
r693841 | adelmelle | 2008-09-10 14:24:00 +0100 (Wed, 10 Sep 2008) | 1 line
Minor fix: avoid attempts at converting a default namespace declaration as a FO property, if the parser reports it as a regular attribute
........
r695491 | jeremias | 2008-09-15 16:06:28 +0100 (Mon, 15 Sep 2008) | 1 line
PDF Output: Made sure the XMP Metadata stream is never compressed.
........
r695500 | jeremias | 2008-09-15 16:15:44 +0100 (Mon, 15 Sep 2008) | 2 lines
Bugzilla #45755:
Removed ALv2 license header as this file does not have a "creativity" value and only serves as an example.
........
r695776 | maxberger | 2008-09-16 09:56:12 +0100 (Tue, 16 Sep 2008) | 4 lines
Re-enabled image loader testcases
Made sure SVG converters use SVG flavor (updated in commons)
Added new ImageLoaderTest which tests JPGs embedded in SVG
........
r696365 | jeremias | 2008-09-17 17:41:14 +0100 (Wed, 17 Sep 2008) | 3 lines
Bugzilla #45795:
PDF Output: Added support for handling 16-bit alpha channel. They are currently converted to 8 bits.
........
r697140 | jeremias | 2008-09-19 16:57:54 +0100 (Fri, 19 Sep 2008) | 1 line
Fixed stray "xml.apache.org".
........
r697152 | adelmelle | 2008-09-19 18:01:03 +0100 (Fri, 19 Sep 2008) | 1 line
Bugzilla 45842: Use FOP_OPTS environment variable in fop.bat and fop.cmd (patch submitted by Carsten Siedentop)
........
r698280 | adelmelle | 2008-09-23 19:48:34 +0100 (Tue, 23 Sep 2008) | 3 lines
Bugzilla 40798: A conditional-page-master-reference with page-position="last" is also eligible for an only page (first as well as last)
Additionally: added support for page-position="only"
........
r698322 | adelmelle | 2008-09-23 20:55:02 +0100 (Tue, 23 Sep 2008) | 1 line
Cleanup firstWhiteSpaceInSeq at end of block too...
........
r698670 | adelmelle | 2008-09-24 18:45:51 +0100 (Wed, 24 Sep 2008) | 1 line
Added two missing files from r698280
........
Added:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/standard-testcases/page-position_last_bug40798.xml
- copied unchanged from r698670, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/page-position_last_bug40798.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/standard-testcases/page-position_only.xml
- copied unchanged from r698670, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/page-position_only.xml
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/ (props changed)
xmlgraphics/fop/branches/Temp_AFPGOCAResources/conf/fop.xconf
xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.bat
xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.cmd
xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.94/extensions.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.95/extensions.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/trunk/extensions.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/PropertyList.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/apps/PFMReader.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/type1/PFMInputStream.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/PageProvider.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/AlphaRasterImage.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/PDFFilterList.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/RTFHandler.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/StandardTestSuite.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java
Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 26 04:27:35 2008
@@ -1 +1,2 @@
/xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
+/xmlgraphics/fop/trunk:693433-698670
Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Sep 26 04:27:35 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-690930
+/xmlgraphics/fop/trunk:1-699270
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/conf/fop.xconf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/conf/fop.xconf?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/conf/fop.xconf (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/conf/fop.xconf Fri Sep 26 04:27:35 2008
@@ -1,20 +1,4 @@
<?xml version="1.0"?>
-<!--
- 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$ -->
<!--
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.bat
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.bat?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.bat (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.bat Fri Sep 26 04:27:35 2008
@@ -81,4 +81,4 @@
:runFop
rem ECHO "%JAVACMD%"
-"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
+"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.cmd
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.cmd?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.cmd (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/fop.cmd Fri Sep 26 04:27:35 2008
@@ -70,6 +70,6 @@
:runFop
rem echo "%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
-"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
+"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
ENDLOCAL
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.94/extensions.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.94/extensions.xml?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.94/extensions.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.94/extensions.xml Fri Sep 26 04:27:35 2008
@@ -48,7 +48,7 @@
<p>
By convention, FO extensions in FOP use the "fox" namespace prefix.
To use any of the FO extensions, add a namespace entry for
- <code>http://xml.apache.org/fop/extensions</code> to the root element:
+ <code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
</p>
<source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.95/extensions.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.95/extensions.xml?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.95/extensions.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/0.95/extensions.xml Fri Sep 26 04:27:35 2008
@@ -48,7 +48,7 @@
<p>
By convention, FO extensions in FOP use the "fox" namespace prefix.
To use any of the FO extensions, add a namespace entry for
- <code>http://xml.apache.org/fop/extensions</code> to the root element:
+ <code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
</p>
<source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/trunk/extensions.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/trunk/extensions.xml?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/trunk/extensions.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/trunk/extensions.xml Fri Sep 26 04:27:35 2008
@@ -48,7 +48,7 @@
<p>
By convention, FO extensions in FOP use the "fox" namespace prefix.
To use any of the FO extensions, add a namespace entry for
- <code>http://xml.apache.org/fop/extensions</code> to the root element:
+ <code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
</p>
<source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/PropertyList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/PropertyList.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/PropertyList.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/PropertyList.java Fri Sep 26 04:27:35 2008
@@ -370,8 +370,10 @@
if (attributeValue != null) {
- if (attributeName.startsWith("xmlns:")) {
- //Ignore namespace declarations
+ if (attributeName.startsWith("xmlns:")
+ || "xmlns".equals(attributeName)) {
+ //Ignore namespace declarations if the XML parser/XSLT processor
+ //reports them as 'regular' attributes
return;
}
@@ -519,7 +521,7 @@
}
/**
- * @param propID ID of property
+ * @param propId ID of property
* @return new Property object
* @throws PropertyException if there's a problem while processing the property
*/
@@ -638,7 +640,6 @@
return new CommonAbsolutePosition(this);
}
-
/**
* Constructs a CommonFont object.
*
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java Fri Sep 26 04:27:35 2008
@@ -228,6 +228,7 @@
nestedBlockStack.pop();
}
charIter = null;
+ firstWhiteSpaceInSeq = null;
}
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java Fri Sep 26 04:27:35 2008
@@ -94,61 +94,33 @@
* @param isFirstPage True if page is first page
* @param isLastPage True if page is last page
* @param isBlankPage True if page is blank
- * @param isOnlyPage True if page is the only page
* @return True if the conditions for this reference are met
*/
protected boolean isValid(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
boolean isBlankPage) {
- // page-position
- if (isOnlyPage) {
- if (pagePosition != EN_ONLY) {
- return false;
- }
- } else if (isFirstPage) {
- if (pagePosition == EN_REST) {
- return false;
- } else if (pagePosition == EN_LAST) {
- return false;
- }
- } else if (isLastPage) {
- if (pagePosition == EN_REST) {
- return false;
- } else if (pagePosition == EN_FIRST) {
- return false;
- }
- } else {
- if (pagePosition == EN_FIRST) {
- return false;
- } else if (pagePosition == EN_LAST) {
- return false;
- }
- }
-
- // odd-or-even
- if (isOddPage) {
- if (oddOrEven == EN_EVEN) {
- return false;
- }
- } else {
- if (oddOrEven == EN_ODD) {
- return false;
- }
- }
-
- // blank-or-not-blank
- if (isBlankPage) {
- if (blankOrNotBlank == EN_NOT_BLANK) {
- return false;
- }
- } else {
- if (blankOrNotBlank == EN_BLANK) {
- return false;
- }
- }
- return true;
+
+ return (
+ // page-position
+ (pagePosition == EN_ANY
+ || (pagePosition == EN_FIRST && isFirstPage)
+ || (pagePosition == EN_LAST && isLastPage)
+ || (pagePosition == EN_ONLY && (isFirstPage && isLastPage))
+ || (pagePosition == EN_REST && !(isFirstPage || isLastPage))
+ )
+ // odd-or-even
+ && (oddOrEven == EN_ANY
+ || (oddOrEven == EN_ODD && isOddPage)
+ || (oddOrEven == EN_EVEN && !isOddPage)
+ )
+ // blank-or-not-blank
+ && (blankOrNotBlank == EN_ANY
+ || (blankOrNotBlank == EN_BLANK && isBlankPage)
+ || (blankOrNotBlank == EN_NOT_BLANK && !isBlankPage)
+ ));
+
+
}
/**
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequence.java Fri Sep 26 04:27:35 2008
@@ -127,19 +127,19 @@
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (localName.equals("title")) {
+ if ("title".equals(localName)) {
if (titleFO != null) {
tooManyNodesError(loc, "fo:title");
- } else if (flowMap.size() > 0) {
+ } else if (!flowMap.isEmpty()) {
nodesOutOfOrderError(loc, "fo:title", "fo:static-content");
} else if (mainFlow != null) {
nodesOutOfOrderError(loc, "fo:title", "fo:flow");
}
- } else if (localName.equals("static-content")) {
+ } else if ("static-content".equals(localName)) {
if (mainFlow != null) {
nodesOutOfOrderError(loc, "fo:static-content", "fo:flow");
}
- } else if (localName.equals("flow")) {
+ } else if ("flow".equals(localName)) {
if (mainFlow != null) {
tooManyNodesError(loc, "fo:flow");
}
@@ -157,15 +157,20 @@
public void addChildNode(FONode child) throws FOPException {
int childId = child.getNameId();
- if (childId == FO_TITLE) {
- this.titleFO = (Title) child;
- } else if (childId == FO_FLOW) {
- this.mainFlow = (Flow) child;
+ switch (childId) {
+ case FO_TITLE:
+ this.titleFO = (Title)child;
+ break;
+ case FO_FLOW:
+ this.mainFlow = (Flow)child;
addFlow(mainFlow);
- } else if (childId == FO_STATIC_CONTENT) {
- addFlow((StaticContent) child);
- String flowName = ((StaticContent) child).getFlowName();
- flowMap.put(flowName, child);
+ break;
+ case FO_STATIC_CONTENT:
+ addFlow((StaticContent)child);
+ flowMap.put(((StaticContent)child).getFlowName(), child);
+ break;
+ default:
+ assert false;
}
}
@@ -245,17 +250,14 @@
* page sequence
* @param isLastPage indicator whether this page is the last page of the
* page sequence
- * @param isOnlyPage indicator whether this page is the only page of the
- * page sequence
* @param isBlank indicator whether the page will be blank
* @return the SimplePageMaster to use for this page
* @throws PageProductionException if there's a problem determining the page master
*/
public SimplePageMaster getNextSimplePageMaster(int page,
- boolean isFirstPage,
- boolean isLastPage,
- boolean isOnlyPage,
- boolean isBlank) throws PageProductionException {
+ boolean isFirstPage,
+ boolean isLastPage,
+ boolean isBlank) throws PageProductionException {
if (pageSequenceMaster == null) {
return simplePageMaster;
@@ -266,11 +268,10 @@
+ " isOdd=" + isOddPage
+ " isFirst=" + isFirstPage
+ " isLast=" + isLastPage
- + " isOnly=" + isOnlyPage
+ " isBlank=" + isBlank + ")");
}
return pageSequenceMaster.getNextSimplePageMaster(isOddPage,
- isFirstPage, isLastPage, isOnlyPage, isBlank);
+ isFirstPage, isLastPage, isBlank);
}
/**
@@ -278,29 +279,17 @@
* @return true if there is a previous item, false if the current one was the first one.
*/
public boolean goToPreviousSimplePageMaster() {
- if (pageSequenceMaster == null) {
- return true;
- } else {
- return pageSequenceMaster.goToPreviousSimplePageMaster();
- }
+ return pageSequenceMaster == null || pageSequenceMaster.goToPreviousSimplePageMaster();
}
/** @return true if the page-sequence has a page-master with page-position="last" */
public boolean hasPagePositionLast() {
- if (pageSequenceMaster == null) {
- return false;
- } else {
- return pageSequenceMaster.hasPagePositionLast();
- }
+ return pageSequenceMaster != null && pageSequenceMaster.hasPagePositionLast();
}
/** @return true if the page-sequence has a page-master with page-position="only" */
public boolean hasPagePositionOnly() {
- if (pageSequenceMaster == null) {
- return false;
- } else {
- return pageSequenceMaster.hasPagePositionOnly();
- }
+ return pageSequenceMaster != null && pageSequenceMaster.hasPagePositionOnly();
}
/**
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Fri Sep 26 04:27:35 2008
@@ -177,7 +177,6 @@
* @param isOddPage True if the next page number is odd
* @param isFirstPage True if the next page is the first
* @param isLastPage True if the next page is the last
- * @param isOnlyPage True if the next page is the only page
* @param isBlankPage True if the next page is blank
* @return the requested page master
* @throws PageProductionException if there's a problem determining the next page master
@@ -185,7 +184,6 @@
public SimplePageMaster getNextSimplePageMaster(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
boolean isBlankPage)
throws PageProductionException {
if (currentSubSequence == null) {
@@ -198,7 +196,7 @@
}
}
String pageMasterName = currentSubSequence
- .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage);
+ .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
boolean canRecover = true;
while (pageMasterName == null) {
SubSequenceSpecifier nextSubSequence = getNextSubSequence();
@@ -213,7 +211,7 @@
currentSubSequence = nextSubSequence;
}
pageMasterName = currentSubSequence
- .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage);
+ .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
}
SimplePageMaster pageMaster = this.layoutMasterSet
.getSimplePageMaster(pageMasterName);
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java Fri Sep 26 04:27:35 2008
@@ -117,7 +117,6 @@
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
boolean isBlankPage) {
if (getMaximumRepeats() != INFINITE) {
if (numberConsumed < getMaximumRepeats()) {
@@ -132,7 +131,7 @@
for (int i = 0; i < conditionalPageMasterRefs.size(); i++) {
ConditionalPageMasterReference cpmr
= (ConditionalPageMasterReference)conditionalPageMasterRefs.get(i);
- if (cpmr.isValid(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage)) {
+ if (cpmr.isValid(isOddPage, isFirstPage, isLastPage, isBlankPage)) {
return cpmr.getMasterReference();
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java Fri Sep 26 04:27:35 2008
@@ -90,7 +90,6 @@
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
boolean isEmptyPage) {
if (getMaximumRepeats() != INFINITE) {
if (numberConsumed < getMaximumRepeats()) {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java Fri Sep 26 04:27:35 2008
@@ -86,8 +86,7 @@
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
- boolean isEmptyPage) {
+ boolean isBlankPage) {
if (this.state == FIRST) {
this.state = DONE;
return masterReference;
@@ -101,8 +100,6 @@
this.state = FIRST;
}
-
-
/** {@inheritDoc} */
public boolean goToPrevious() {
if (state == FIRST) {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java Fri Sep 26 04:27:35 2008
@@ -31,7 +31,6 @@
* @param isOddPage True if the next page number is odd
* @param isFirstPage True if the next page is the first
* @param isLastPage True if the next page is the last
- * @param isOnlyPage True if the next page is the only page
* @param isBlankPage True if the next page is blank
* @return the page master name
* @throws PageProductionException if there's a problem determining the next page master
@@ -39,7 +38,6 @@
String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isLastPage,
- boolean isOnlyPage,
boolean isBlankPage)
throws PageProductionException;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/apps/PFMReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/apps/PFMReader.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/apps/PFMReader.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/apps/PFMReader.java Fri Sep 26 04:27:35 2008
@@ -26,12 +26,14 @@
import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.Version;
import org.apache.fop.fonts.type1.PFMFile;
import org.apache.fop.util.CommandLineLogger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/**
* A tool which reads PFM files from Adobe Type 1 fonts and creates
@@ -256,7 +258,7 @@
el = doc.createElement("descender");
root.appendChild(el);
- value = new Integer(-pfm.getLowerCaseDescent());
+ value = new Integer(pfm.getLowerCaseDescent());
el.appendChild(doc.createTextNode(value.toString()));
Element bbox = doc.createElement("bbox");
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java Fri Sep 26 04:27:35 2008
@@ -983,10 +983,17 @@
/**
* Read the "OS/2" table
*/
- private final void readOS2(FontFileReader in) throws IOException {
+ private void readOS2(FontFileReader in) throws IOException {
// Check if font is embeddable
- if (dirTabs.get("OS/2") != null) {
- seekTab(in, "OS/2", 2 * 2);
+ TTFDirTabEntry os2Entry = (TTFDirTabEntry)dirTabs.get("OS/2");
+ if (os2Entry != null) {
+ seekTab(in, "OS/2", 0);
+ int version = in.readTTFUShort();
+ if (log.isDebugEnabled()) {
+ log.debug("OS/2 table: version=" + version
+ + ", offset=" + os2Entry.getOffset() + ", len=" + os2Entry.getLength());
+ }
+ in.skip(2); //xAvgCharWidth
this.usWeightClass = in.readTTFUShort();
// usWidthClass
@@ -1005,22 +1012,30 @@
in.skip(3 * 2);
int v;
os2Ascender = in.readTTFShort(); //sTypoAscender
- log.debug("sTypoAscender: " + os2Ascender
- + " " + convertTTFUnit2PDFUnit(os2Ascender));
os2Descender = in.readTTFShort(); //sTypoDescender
- log.debug("sTypoDescender: " + os2Descender
- + " " + convertTTFUnit2PDFUnit(os2Descender));
v = in.readTTFShort(); //sTypoLineGap
- log.debug("sTypoLineGap: " + v);
v = in.readTTFUShort(); //usWinAscent
- log.debug("usWinAscent: " + v + " " + convertTTFUnit2PDFUnit(v));
v = in.readTTFUShort(); //usWinDescent
- log.debug("usWinDescent: " + v + " " + convertTTFUnit2PDFUnit(v));
- in.skip(2 * 4);
- this.os2xHeight = in.readTTFShort(); //sxHeight
- log.debug("sxHeight: " + this.os2xHeight);
- this.os2CapHeight = in.readTTFShort(); //sCapHeight
- log.debug("sCapHeight: " + this.os2CapHeight);
+ if (log.isDebugEnabled()) {
+ log.debug("sTypoAscender: " + os2Ascender
+ + " " + convertTTFUnit2PDFUnit(os2Ascender));
+ log.debug("sTypoDescender: " + os2Descender
+ + " " + convertTTFUnit2PDFUnit(os2Descender));
+ log.debug("sTypoLineGap: " + v);
+ log.debug("usWinAscent: " + v + " " + convertTTFUnit2PDFUnit(v));
+ log.debug("usWinDescent: " + v + " " + convertTTFUnit2PDFUnit(v));
+ }
+
+ //version 1 OS/2 table might end here
+ if (os2Entry.getLength() >= 78 + (2 * 4) + (2 * 2)) {
+ in.skip(2 * 4);
+ this.os2xHeight = in.readTTFShort(); //sxHeight
+ this.os2CapHeight = in.readTTFShort(); //sCapHeight
+ if (log.isDebugEnabled()) {
+ log.debug("sxHeight: " + this.os2xHeight);
+ log.debug("sCapHeight: " + this.os2CapHeight);
+ }
+ }
} else {
isEmbeddable = true;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/type1/PFMInputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/type1/PFMInputStream.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/type1/PFMInputStream.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/type1/PFMInputStream.java Fri Sep 26 04:27:35 2008
@@ -19,6 +19,7 @@
package org.apache.fop.fonts.type1;
+import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.DataInputStream;
@@ -30,7 +31,7 @@
*/
public class PFMInputStream extends java.io.FilterInputStream {
- private DataInputStream datain;
+ private final DataInputStream datain;
/**
* Constructs a PFMInputStream based on an InputStream representing the
@@ -97,11 +98,15 @@
public String readString() throws IOException {
InputStreamReader reader = new InputStreamReader(in, "ISO-8859-1");
StringBuffer buf = new StringBuffer();
+
int ch = reader.read();
- while (ch != 0) {
+ while (ch > 0) {
buf.append((char)ch);
ch = reader.read();
}
+ if (ch == -1) {
+ throw new EOFException("Unexpected end of stream reached");
+ }
return buf.toString();
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java Fri Sep 26 04:27:35 2008
@@ -32,19 +32,18 @@
import org.apache.batik.gvt.GraphicsNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
+import org.apache.fop.svg.SimpleSVGUserAgent;
import org.apache.xmlgraphics.image.loader.Image;
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.ImageProcessingHints;
+import org.apache.xmlgraphics.image.loader.XMLNamespaceEnabledImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter;
import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
import org.apache.xmlgraphics.util.UnitConv;
-import org.apache.fop.svg.SimpleSVGUserAgent;
-
/**
* This ImageConverter converts SVG images to Java2D.
* <p>
@@ -132,7 +131,7 @@
/** {@inheritDoc} */
public ImageFlavor getSourceFlavor() {
- return ImageFlavor.XML_DOM;
+ return XMLNamespaceEnabledImageFlavor.SVG_DOM;
}
/** {@inheritDoc} */
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderFactorySVG.java Fri Sep 26 04:27:35 2008
@@ -20,6 +20,7 @@
package org.apache.fop.image.loader.batik;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.XMLNamespaceEnabledImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageLoaderFactory;
import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
import org.apache.xmlgraphics.util.MimeConstants;
@@ -30,7 +31,7 @@
public class ImageLoaderFactorySVG extends AbstractImageLoaderFactory {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
- ImageFlavor.XML_DOM};
+ XMLNamespaceEnabledImageFlavor.SVG_DOM};
private static final String[] MIMES = new String[] {
MimeConstants.MIME_SVG};
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageLoaderSVG.java Fri Sep 26 04:27:35 2008
@@ -23,12 +23,12 @@
import java.util.Map;
import org.apache.batik.dom.svg.SVGDOMImplementation;
-
import org.apache.xmlgraphics.image.loader.Image;
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.XMLNamespaceEnabledImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageLoader;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
import org.apache.xmlgraphics.util.MimeConstants;
@@ -45,7 +45,7 @@
* @param targetFlavor the target flavor
*/
public ImageLoaderSVG(ImageFlavor targetFlavor) {
- if (!(ImageFlavor.XML_DOM.equals(targetFlavor))) {
+ if (!(XMLNamespaceEnabledImageFlavor.SVG_DOM.equals(targetFlavor))) {
throw new IllegalArgumentException("Unsupported target ImageFlavor: " + targetFlavor);
}
this.targetFlavor = targetFlavor;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/PageProvider.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/PageProvider.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/PageProvider.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/PageProvider.java Fri Sep 26 04:27:35 2008
@@ -234,13 +234,13 @@
indexOfCachedLastPage = (isLastPage ? intIndex : -1);
}
if (replace) {
- disardCacheStartingWith(intIndex);
+ discardCacheStartingWith(intIndex);
page = cacheNextPage(index, isBlank, isLastPage);
}
return page;
}
- private void disardCacheStartingWith(int index) {
+ private void discardCacheStartingWith(int index) {
while (index < cachedPages.size()) {
this.cachedPages.remove(cachedPages.size() - 1);
if (!pageSeq.goToPreviousSimplePageMaster()) {
@@ -251,8 +251,9 @@
private Page cacheNextPage(int index, boolean isBlank, boolean isLastPage) {
String pageNumberString = pageSeq.makeFormattedPageNumber(index);
+ boolean isFirstPage = (startPageOfPageSequence == index);
SimplePageMaster spm = pageSeq.getNextSimplePageMaster(
- index, (startPageOfPageSequence == index), isLastPage, false, isBlank);
+ index, isFirstPage, isLastPage, isBlank);
Region body = spm.getRegion(FO_REGION_BODY);
if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/AlphaRasterImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/AlphaRasterImage.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/AlphaRasterImage.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/AlphaRasterImage.java Fri Sep 26 04:27:35 2008
@@ -48,6 +48,9 @@
*/
public AlphaRasterImage(String k, Raster alpha) {
this.key = k;
+ //Enable the commented line below if 16-bit alpha channels are desired.
+ //Otherwise, we compress the alpha channel to 8 bit which should be sufficient.
+ //this.bitsPerComponent = alpha.getSampleModel().getSampleSize(0);
this.bitsPerComponent = 8;
this.colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_GRAY);
if (alpha == null) {
@@ -148,6 +151,18 @@
alpha.getDataElements(0, y, w, 1, line);
out.write(line);
}
+ } else if (dataType == DataBuffer.TYPE_USHORT) {
+ short[] sline = new short[nbands * w];
+ byte[] line = new byte[nbands * w];
+ for (int y = 0; y < h; y++) {
+ alpha.getDataElements(0, y, w, 1, sline);
+ for (int i = 0; i < w; i++) {
+ //this compresses a 16-bit alpha channel to 8 bits!
+ //we probably don't ever need a 16-bit channel
+ line[i] = (byte)(sline[i] >> 8);
+ }
+ out.write(line);
+ }
} else if (dataType == DataBuffer.TYPE_INT) {
//Is there an better way to get a 8bit raster from a TYPE_INT raster?
int shift = 24;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/PDFFilterList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/PDFFilterList.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/PDFFilterList.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/pdf/PDFFilterList.java Fri Sep 26 04:27:35 2008
@@ -163,6 +163,11 @@
* @param type which filter list to modify
*/
public void addDefaultFilters(Map filters, String type) {
+ if (METADATA_FILTER.equals(type)) {
+ //XMP metadata should not be embedded in clear-text
+ addFilter(new NullFilter());
+ return;
+ }
List filterset = null;
if (filters != null) {
filterset = (List)filters.get(type);
@@ -171,10 +176,7 @@
}
}
if (filterset == null || filterset.size() == 0) {
- if (METADATA_FILTER.equals(type)) {
- //XMP metadata should not be embedded in clear-text
- addFilter(new NullFilter());
- } else if (JPEG_FILTER.equals(type)) {
+ if (JPEG_FILTER.equals(type)) {
//JPEG is already well compressed
addFilter(new NullFilter());
} else if (TIFF_FILTER.equals(type)) {
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/RTFHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/RTFHandler.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/RTFHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/RTFHandler.java Fri Sep 26 04:27:35 2008
@@ -222,7 +222,7 @@
PageSequenceMaster master
= pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(reference);
this.pagemaster = master.getNextSimplePageMaster(
- false, false, false, false, false);
+ false, false, false, false);
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java Fri Sep 26 04:27:35 2008
@@ -26,8 +26,8 @@
* the FOP project.
*/
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
import java.util.Iterator;
/** A cell in an RTF table, container for paragraphs, lists, etc.
@@ -237,12 +237,12 @@
// Reach the column index in table context corresponding to the current column cell
// id is the index of the current cell (it begins at 1)
// getColumnIndex() is the index of the current column in table context (it begins at 0)
- // => so we must widthdraw 1 when comparing these two variables.
+ // => so we must withdraw 1 when comparing these two variables.
while ((this.id - 1) != tableColumnsInfo.getColumnIndex()) {
tableColumnsInfo.selectNextColumn();
}
- // We widthdraw one cell because the first cell is already created
+ // We withdraw one cell because the first cell is already created
// (it's the current cell) !
int i = nbMergedCells - 1;
while (i > 0) {
@@ -255,21 +255,18 @@
final int xPos = offset + iCurrentWidth;
//these lines added by Chris Scott, Westinghouse
- //some attributes need to be writting before opening block
+ //some attributes need to be written before opening block
if (setCenter) {
- writeControlWord("qc");
+ writeControlWord("trqc");
} else if (setRight) {
- writeControlWord("qr");
+ writeControlWord("trqr");
} else {
- writeControlWord("ql");
+ writeControlWord("trql");
}
writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);
writeControlWord("cellx" + xPos);
- //TODO Why is this here, right after an alignment command is written (see above)?
- writeControlWord("ql");
-
return xPos;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml Fri Sep 26 04:27:35 2008
@@ -53,6 +53,28 @@
<changes>
<release version="FOP Trunk" date="TBD">
+ <action context="Layout" dev="AD" type="fix" fixes-bug="40798">
+ Bugzilla 40798: A conditional-page-master-reference with page-position="last" qualifies
+ for a first page, if it is also the last. Additionally: also added support for
+ page-position="only".
+ </action>
+ <action context="Code" dev="AD" type="fix" fixes-bug="45842" due-to="Carsten Siedentop">
+ Make fop.bat and fop.cmd use the %FOP_OPTS% environment variable.
+ </action>
+ <action context="Renderers" dev="JM" type="add" fixes-bug="45795">
+ PDF Output: Added support for handling 16-bit alpha channel. They are currently
+ converted to 8 bits.
+ </action>
+ <action context="Renderers" dev="JM" type="fix">
+ PDF Output: Made sure the XMP Metadata stream is never compressed.
+ </action>
+ <action context="Fonts" dev="JM" type="fix" fixes-bug="45734" due-to="J. Frantzius">
+ Fix for PFMReader after bug #43089 changed the behavior of PFMFile. Fixes baseline
+ problems when Type 1 fonts are used in conjunction with XML font metric files.
+ </action>
+ <action context="Renderers" dev="JM" type="fix" fixes-bug="45616" due-to="Pavel Kysilka">
+ Fix for table handling in RTF output, so the output works with OpenOffice and AbiWord, too.
+ </action>
<action context="Code" dev="AD" type="fix" fixes-bug="45667">
Quick-fix to avoid a possible NullPointerException when using
empty inlines and hyphenation.
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/StandardTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/StandardTestSuite.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/StandardTestSuite.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/StandardTestSuite.java Fri Sep 26 04:27:35 2008
@@ -23,6 +23,8 @@
import junit.framework.TestSuite;
import org.apache.fop.fonts.TrueTypeAnsiTestCase;
+import org.apache.fop.image.loader.batik.ImageLoaderTestCase;
+import org.apache.fop.image.loader.batik.ImagePreloaderTestCase;
import org.apache.fop.render.pdf.PDFAConformanceTestCase;
import org.apache.fop.render.pdf.PDFCMapTestCase;
import org.apache.fop.render.pdf.PDFEncodingTestCase;
@@ -50,6 +52,8 @@
suite.addTest(new TestSuite(PDFsRGBSettingsTestCase.class));
suite.addTest(new TestSuite(TrueTypeAnsiTestCase.class));
suite.addTest(RichTextFormatTestSuite.suite());
+ suite.addTest(new TestSuite(ImageLoaderTestCase.class));
+ suite.addTest(new TestSuite(ImagePreloaderTestCase.class));
//$JUnit-END$
return suite;
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java?rev=699279&r1=699278&r2=699279&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java Fri Sep 26 04:27:35 2008
@@ -19,21 +19,23 @@
package org.apache.fop.image.loader.batik;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
import java.io.File;
import junit.framework.TestCase;
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.FopFactory;
import org.apache.xmlgraphics.image.loader.Image;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.XMLNamespaceEnabledImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
import org.apache.xmlgraphics.image.writer.ImageWriterUtil;
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.FopFactory;
-
/**
* Tests for bundled ImageLoader implementations.
*/
@@ -59,10 +61,10 @@
ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
assertNotNull("ImageInfo must not be null", info);
- Image img = manager.getImage(info, ImageFlavor.XML_DOM,
+ Image img = manager.getImage(info, XMLNamespaceEnabledImageFlavor.SVG_DOM,
userAgent.getImageSessionContext());
assertNotNull("Image must not be null", img);
- assertEquals(ImageFlavor.XML_DOM, img.getFlavor());
+ assertEquals(XMLNamespaceEnabledImageFlavor.SVG_DOM, img.getFlavor());
ImageXMLDOM imgDom = (ImageXMLDOM)img;
assertNotNull(imgDom.getDocument());
assertEquals("http://www.w3.org/2000/svg", imgDom.getRootNamespace());
@@ -101,10 +103,10 @@
ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
assertNotNull("ImageInfo must not be null", info);
- Image img = manager.getImage(info, ImageFlavor.XML_DOM,
+ Image img = manager.getImage(info, XMLNamespaceEnabledImageFlavor.SVG_DOM,
userAgent.getImageSessionContext());
assertNotNull("Image must not be null", img);
- assertEquals(ImageFlavor.XML_DOM, img.getFlavor());
+ assertEquals(XMLNamespaceEnabledImageFlavor.SVG_DOM, img.getFlavor());
ImageXMLDOM imgDom = (ImageXMLDOM)img;
assertNotNull(imgDom.getDocument());
assertEquals("http://www.w3.org/2000/svg", imgDom.getRootNamespace());
@@ -160,4 +162,58 @@
assertEquals(612000, info.getSize().getHeightMpt());
}
+ public void testSVGWithReferences() throws Exception {
+ String uri = "test/resources/fop/svg/images.svg";
+ FopFactory ff = FopFactory.newInstance();
+ FOUserAgent userAgent = ff.newFOUserAgent();
+
+ ImageManager manager = ff.getImageManager();
+ ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+ assertNotNull("ImageInfo must not be null", info);
+
+ Image img = manager.getImage(info, XMLNamespaceEnabledImageFlavor.SVG_DOM,
+ userAgent.getImageSessionContext());
+ assertNotNull("Image must not be null", img);
+ assertEquals(XMLNamespaceEnabledImageFlavor.SVG_DOM, img.getFlavor());
+ ImageXMLDOM imgDom = (ImageXMLDOM)img;
+ assertNotNull(imgDom.getDocument());
+ assertEquals("http://www.w3.org/2000/svg", imgDom.getRootNamespace());
+ info = imgDom.getInfo(); //Switch to the ImageInfo returned by the image
+ assertEquals(400000, info.getSize().getWidthMpt());
+ assertEquals(400000, info.getSize().getHeightMpt());
+ assertEquals(400, info.getSize().getWidthPx());
+ assertEquals(400, info.getSize().getHeightPx());
+
+ img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE,
+ userAgent.getImageSessionContext());
+ assertNotNull("Image must not be null", img);
+ assertEquals(ImageFlavor.RENDERED_IMAGE, img.getFlavor());
+ ImageRendered imgRed = (ImageRendered)img;
+ RenderedImage renImg = imgRed.getRenderedImage();
+ assertNotNull(renImg);
+ if (DEBUG_TARGET_DIR != null) {
+ ImageWriterUtil.saveAsPNG(renImg,
+ (int)userAgent.getTargetResolution(),
+ new File(DEBUG_TARGET_DIR, "images.svg.png"));
+ }
+ assertEquals(400, renImg.getWidth());
+ assertEquals(400, renImg.getHeight());
+ info = imgRed.getInfo(); //Switch to the ImageInfo returned by the image
+ assertEquals(400000, info.getSize().getWidthMpt());
+ assertEquals(400000, info.getSize().getHeightMpt());
+ Raster raster = renImg.getData();
+ // This pixel is white
+ int[] pixel1 = raster.getPixel(1, 1, (int[] )null);
+ // This pixel is from the embedded JPG and is not white
+ int[] pixel80 = raster.getPixel(80, 80, (int[]) null);
+ assertEquals(pixel1.length, pixel80.length);
+ boolean same = true;
+ for (int i = 0; i < pixel1.length; i++) {
+ same &= (pixel1[i] == pixel80[i]);
+ }
+ assertFalse("Embedding JPG into SVG failed", same);
+ }
+
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org