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/07/10 18:10:14 UTC
svn commit: r675630 - in /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign:
./ examples/fo/ src/documentation/content/xdocs/
src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/area/
src/java/org/apache/fop/fo/flow/table/ src/java/org/apache/...
Author: acumiskey
Date: Thu Jul 10 09:10:13 2008
New Revision: 675630
URL: http://svn.apache.org/viewvc?rev=675630&view=rev
Log:
Merged revisions 674489,674540,674561,674564,674599,674602,675231,675246,675253,675258,675501,675590,675604 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r674489 | lfurini | 2008-07-07 14:52:36 +0100 (Mon, 07 Jul 2008) | 1 line
Fixing absolute positioning of block-containers: bottom and right distances were not taken into account
........
r674540 | adelmelle | 2008-07-07 17:24:54 +0100 (Mon, 07 Jul 2008) | 1 line
Correct indentation
........
r674561 | adelmelle | 2008-07-07 18:31:12 +0100 (Mon, 07 Jul 2008) | 1 line
Added the change to the FONode interface committed in r670341
........
r674564 | adelmelle | 2008-07-07 18:46:09 +0100 (Mon, 07 Jul 2008) | 1 line
Fixed typo
........
r674599 | clay | 2008-07-07 20:15:34 +0100 (Mon, 07 Jul 2008) | 1 line
updated info.
........
r674602 | clay | 2008-07-07 20:19:00 +0100 (Mon, 07 Jul 2008) | 1 line
One more minor update.
........
r675231 | acumiskey | 2008-07-09 16:34:01 +0100 (Wed, 09 Jul 2008) | 2 lines
Minor javadoc cleanup.
........
r675246 | acumiskey | 2008-07-09 17:10:33 +0100 (Wed, 09 Jul 2008) | 2 lines
Added newAFP target for producing a set of AFP files from the examples.
........
r675253 | acumiskey | 2008-07-09 17:53:01 +0100 (Wed, 09 Jul 2008) | 2 lines
Added throwexceptions attribute to FOP ant task. This works around the problem with executing examples/fo/build.xml.
........
r675258 | acumiskey | 2008-07-09 18:05:27 +0100 (Wed, 09 Jul 2008) | 2 lines
Whoops.. default value should be true :).
........
r675501 | acumiskey | 2008-07-10 11:23:54 +0100 (Thu, 10 Jul 2008) | 2 lines
Duplicated operation scaleX and scaleY replaced simply with scale.
........
r675590 | vhennebert | 2008-07-10 15:31:52 +0100 (Thu, 10 Jul 2008) | 2 lines
Bugzilla #45369: footnotes were rendered at the top of the region-body when using the intermediate format
........
r675604 | jeremias | 2008-07-10 16:02:15 +0100 (Thu, 10 Jul 2008) | 1 line
Beware! An evil tab character! But it's been eliminated. ;-)
........
Added:
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
- copied unchanged from r675604, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
Modified:
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/ (props changed)
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/examples/fo/build.xml
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/team.xml
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/trunk/anttask.xml
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/area/AreaTreeParser.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/flow/table/TableFObj.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderer.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/xml/XMLRenderer.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/status.xml
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/footnote_basic.xml
Propchange: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jul 10 09:10:13 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-674487
+/xmlgraphics/fop/trunk:1-675627
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/examples/fo/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/examples/fo/build.xml?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/examples/fo/build.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/examples/fo/build.xml Thu Jul 10 09:10:13 2008
@@ -45,7 +45,7 @@
<!-- Produces new test files (function) -->
<!-- =================================================================== -->
<target name="newTestFiles">
- <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true">
+ <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true" throwexceptions="false">
<fileset dir="basic">
<include name="**/*.fo"/>
</fileset>
@@ -96,7 +96,7 @@
</antcall>
</target>
<!-- =================================================================== -->
- <!-- Produces new test ps files -->
+ <!-- Produces new test PS files -->
<!-- =================================================================== -->
<target name="newPS" depends="init" description="Creates a new set of PostScript test files">
<antcall target="newTestFiles">
@@ -106,6 +106,16 @@
</antcall>
</target>
<!-- =================================================================== -->
+ <!-- Produces new test AFP files -->
+ <!-- =================================================================== -->
+ <target name="newAFP" depends="init" description="Creates a new set of AFP test files">
+ <antcall target="newTestFiles">
+ <param name="mimetype" value="application/x-afp"/>
+ <param name="msglevel" value="warn"/>
+ <param name="outDir" value="${testDir}"/>
+ </antcall>
+ </target>
+ <!-- =================================================================== -->
<!-- Produces new test areatree files -->
<!-- =================================================================== -->
<target name="newAT" depends="init" description="Creates a new set of AreaTree XML test files">
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/team.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/team.xml?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/team.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/team.xml Thu Jul 10 09:10:13 2008
@@ -54,7 +54,7 @@
is a web/WAP/Palm developer from Laguna Beach, California, USA. A
recent XML/XSL-FO convert, he has been nit-picking FAQs & assorted web
pages since his first webmaster position @brain.com in 1996. Most
- important creation? His li'l Jeremy was born June 18, 2002.</li>
+ important creation? He's got a couple of cool kids.</li>
<li id="mm"><link href="mailto:manuel@apache.org">Manuel Mall</link> (MM)
is an independant software engineer resident in Perth, Australia. Born a long time
ago in Germany he has been involved in Software Engineering (Informatik) since the
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/trunk/anttask.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/trunk/anttask.xml?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/trunk/anttask.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/documentation/content/xdocs/trunk/anttask.xml Thu Jul 10 09:10:13 2008
@@ -148,6 +148,11 @@
(<code>true</code>) or not (<code>false</code>). <strong>Currently doesn't work in FOP Trunk!!!</strong></td>
<td>No, default is <code>true</code></td>
</tr>
+ <tr>
+ <td>throwexceptions</td>
+ <td>Controls whether or not an exception is thrown if an error occurs during rendering.</strong></td>
+ <td>Default is <code>true</code></td>
+ </tr>
</table>
<p/>
<table><caption>Parameters specified as nested elements</caption>
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/area/AreaTreeParser.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/area/AreaTreeParser.java Thu Jul 10 09:10:13 2008
@@ -21,12 +21,11 @@
import java.awt.Color;
import java.awt.geom.Rectangle2D;
+import java.nio.CharBuffer;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
-import java.util.StringTokenizer;
-import java.nio.CharBuffer;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
@@ -37,22 +36,8 @@
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import org.apache.xmlgraphics.image.loader.ImageInfo;
-import org.apache.xmlgraphics.image.loader.ImageManager;
-import org.apache.xmlgraphics.image.loader.ImageSessionContext;
-import org.apache.xmlgraphics.util.QName;
-
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.area.Trait.Background;
import org.apache.fop.area.Trait.InternalLink;
@@ -80,6 +65,16 @@
import org.apache.fop.util.ContentHandlerFactoryRegistry;
import org.apache.fop.util.ConversionUtils;
import org.apache.fop.util.DefaultErrorListener;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.util.QName;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* This is a parser for the area tree XML (intermediate format) which is used to reread an area
@@ -559,6 +554,7 @@
public void startElement(Attributes attributes) {
Footnote fn = getCurrentBodyRegion().getFootnote();
transferForeignObjects(attributes, fn);
+ fn.setTop(getAttributeAsInteger(attributes, "top-offset", 0));
areaStack.push(fn);
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/flow/table/TableFObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/flow/table/TableFObj.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/flow/table/TableFObj.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/flow/table/TableFObj.java Thu Jul 10 09:10:13 2008
@@ -256,19 +256,19 @@
BorderSpecification borderSpec = new BorderSpecification(
getCommonBorderPaddingBackground().getBorderInfo(side), getNameId());
switch (side) {
- case CommonBorderPaddingBackground.BEFORE:
- borderBefore = new ConditionalBorder(borderSpec, collapsingBorderModel);
- break;
- case CommonBorderPaddingBackground.AFTER:
- borderAfter = new ConditionalBorder(borderSpec, collapsingBorderModel);
- break;
- case CommonBorderPaddingBackground.START:
- borderStart = borderSpec;
- break;
- case CommonBorderPaddingBackground.END:
- borderEnd = borderSpec;
- break;
- default: assert false;
+ case CommonBorderPaddingBackground.BEFORE:
+ borderBefore = new ConditionalBorder(borderSpec, collapsingBorderModel);
+ break;
+ case CommonBorderPaddingBackground.AFTER:
+ borderAfter = new ConditionalBorder(borderSpec, collapsingBorderModel);
+ break;
+ case CommonBorderPaddingBackground.START:
+ borderStart = borderSpec;
+ break;
+ case CommonBorderPaddingBackground.END:
+ borderEnd = borderSpec;
+ break;
+ default: assert false;
}
}
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Thu Jul 10 09:10:13 2008
@@ -694,9 +694,17 @@
int y = 0;
if (abProps.left.getEnum() != EN_AUTO) {
x = abProps.left.getValue(this);
+ } else if (abProps.right.getEnum() != EN_AUTO
+ && width.getEnum() != EN_AUTO) {
+ x = getReferenceAreaIPD()
+ - abProps.right.getValue(this) - width.getValue(this);
}
if (abProps.top.getEnum() != EN_AUTO) {
y = abProps.top.getValue(this);
+ } else if (abProps.bottom.getEnum() != EN_AUTO
+ && height.getEnum() != EN_AUTO) {
+ y = getReferenceAreaBPD()
+ - abProps.bottom.getValue(this) - height.getValue(this);
}
return new Point(x, y);
}
@@ -1085,3 +1093,4 @@
}
+
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Thu Jul 10 09:10:13 2008
@@ -189,12 +189,12 @@
* @param newScaleFactor ]0 ; 1]
*/
public void setScaleFactor(double newScaleFactor) {
- scaleFactor = newScaleFactor;
+ this.scaleFactor = newScaleFactor;
}
/** @return the scale factor */
public double getScaleFactor() {
- return scaleFactor;
+ return this.scaleFactor;
}
/** {@inheritDoc} */
@@ -292,22 +292,19 @@
this.currentPageViewport = pageViewport;
try {
Rectangle2D bounds = pageViewport.getViewArea();
- pageWidth = (int) Math.round(bounds.getWidth() / 1000f);
- pageHeight = (int) Math.round(bounds.getHeight() / 1000f);
+ this.pageWidth = (int) Math.round(bounds.getWidth() / 1000f);
+ this.pageHeight = (int) Math.round(bounds.getHeight() / 1000f);
log.info(
"Rendering Page " + pageViewport.getPageNumberString()
+ " (pageWidth " + pageWidth + ", pageHeight "
+ pageHeight + ")");
- double scaleX = scaleFactor
- * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
+ double scale = scaleFactor
+ * (25.4f / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
/ userAgent.getTargetPixelUnitToMillimeter();
- double scaleY = scaleFactor
- * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
- / userAgent.getTargetPixelUnitToMillimeter();
- int bitmapWidth = (int) ((pageWidth * scaleX) + 0.5);
- int bitmapHeight = (int) ((pageHeight * scaleY) + 0.5);
+ int bitmapWidth = (int) ((pageWidth * scale) + 0.5);
+ int bitmapHeight = (int) ((pageHeight * scale) + 0.5);
BufferedImage currentPageImage = getBufferedImage(bitmapWidth, bitmapHeight);
@@ -330,7 +327,7 @@
// transform page based on scale factor supplied
AffineTransform at = graphics.getTransform();
- at.scale(scaleX, scaleY);
+ at.scale(scale, scale);
graphics.setTransform(at);
// draw page frame
@@ -466,11 +463,11 @@
protected void restoreStateStackAfterBreakOut(List breakOutList) {
log.debug("Block.FIXED --> restoring context after break-out");
- Iterator i = breakOutList.iterator();
- while (i.hasNext()) {
- Java2DGraphicsState s = (Java2DGraphicsState)i.next();
+ Iterator it = breakOutList.iterator();
+ while (it.hasNext()) {
+ Java2DGraphicsState s = (Java2DGraphicsState)it.next();
stateStack.push(state);
- state = s;
+ this.state = s;
}
}
@@ -1015,5 +1012,4 @@
public void setTransparentPageBackground(boolean transparentPageBackground) {
this.transparentPageBackground = transparentPageBackground;
}
-
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderer.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderer.java Thu Jul 10 09:10:13 2008
@@ -734,8 +734,7 @@
gen.useColor(col);
}
- /** {@inheritDoc}
- * Area, float, float, float, float) */
+ /** {@inheritDoc} */
protected void drawBackAndBorders(Area area, float startx, float starty,
float width, float height) {
if (area.hasTrait(Trait.BACKGROUND)
@@ -904,9 +903,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startRenderer(OutputStream outputStream)
throws IOException {
log.debug("Rendering areas to PostScript...");
@@ -980,9 +977,7 @@
gen.writeDSCComment(DSCConstants.END_SETUP);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void stopRenderer() throws IOException {
//Notify resource usage for font which are not supplied
/* done in useFont now
@@ -1134,9 +1129,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void renderPage(PageViewport page)
throws IOException, FOPException {
log.debug("renderPage(): " + page);
@@ -1313,9 +1306,7 @@
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void renderText(TextArea area) {
renderInlineAreaBackAndBorders(area);
String fontkey = getInternalFontNameForArea(area);
@@ -1346,17 +1337,13 @@
renderTextDecoration(tf, fontsize, area, bl, rx);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void renderWord(WordArea word) {
renderText((TextArea)word.getParentArea(), word.getWord(), word.getLetterAdjustArray());
super.renderWord(word);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void renderSpace(SpaceArea space) {
AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
String s = space.getSpace();
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/xml/XMLRenderer.java Thu Jul 10 09:10:13 2008
@@ -544,7 +544,9 @@
* {@inheritDoc}
*/
protected void renderFootnote(Footnote footnote) {
- startElement("footnote");
+ atts.clear();
+ addAttribute("top-offset", footnote.getTop());
+ startElement("footnote", atts);
super.renderFootnote(footnote);
endElement("footnote");
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java Thu Jul 10 09:10:13 2008
@@ -5,9 +5,9 @@
* 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.
@@ -54,7 +54,7 @@
* <li>format -> MIME type of the format to generate ex. "application/pdf"</li>
* <li>outfile -> output filename</li>
* <li>baseDir -> directory to work from</li>
- * <li>relativebase -> (true | false) control whether to use each FO's
+ * <li>relativebase -> (true | false) control whether to use each FO's
* directory as base directory. false uses the baseDir parameter.</li>
* <li>userconfig -> file with user configuration (same as the "-c" command
* line option)</li>
@@ -77,6 +77,7 @@
private boolean logFiles = true;
private boolean force = false;
private boolean relativebase = false;
+ private boolean throwExceptions = true;
/**
* Sets the filename for the userconfig.xml.
@@ -136,7 +137,7 @@
public void setRelativebase(boolean relbase) {
this.relativebase = relbase;
}
-
+
/**
* Gets the relative base attribute
* @return the relative base attribute
@@ -212,6 +213,24 @@
}
/**
+ * Set whether exceptions are thrown.
+ * default is false.
+ *
+ * @param force true if always generate.
+ */
+ public void setThrowexceptions(boolean throwExceptions) {
+ this.throwExceptions = throwExceptions;
+ }
+
+ /**
+ * Gets the throw exceptions attribute
+ * @return the throw exceptions attribute
+ */
+ public boolean getThrowexceptions() {
+ return this.throwExceptions;
+ }
+
+ /**
* Sets the message level to be used while processing.
* @param messageLevel (error | warn| info | verbose | debug)
*/
@@ -275,7 +294,7 @@
public boolean getLogFiles() {
return this.logFiles;
}
-
+
/**
* {@inheritDoc}
*/
@@ -311,7 +330,7 @@
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
private Fop task;
private String baseURL = null;
@@ -392,13 +411,13 @@
{MimeConstants.MIME_AFP_ALT, ".afp"},
{MimeConstants.MIME_XSL_FO, ".fo"}
};
-
+
private String determineExtension(String outputFormat) {
for (int i = 0; i < EXTENSIONS.length; i++) {
if (EXTENSIONS[i][0].equals(outputFormat)) {
String ext = EXTENSIONS[i][1];
if (ext == null) {
- throw new RuntimeException("Output format '"
+ throw new RuntimeException("Output format '"
+ outputFormat + "' does not produce a file.");
} else {
return ext;
@@ -448,7 +467,7 @@
// actioncount = # of fofiles actually processed through FOP
int actioncount = 0;
// skippedcount = # of fofiles which haven't changed (force = "false")
- int skippedcount = 0;
+ int skippedcount = 0;
// deal with single source file
if (task.getFofile() != null) {
@@ -460,14 +479,14 @@
if (task.getOutdir() != null) {
outf = new File(task.getOutdir(), outf.getName());
}
- // Render if "force" flag is set OR
+ // Render if "force" flag is set OR
// OR output file doesn't exist OR
// output file is older than input file
- if (task.getForce() || !outf.exists()
+ if (task.getForce() || !outf.exists()
|| (task.getFofile().lastModified() > outf.lastModified() )) {
render(task.getFofile(), outf, outputFormat);
actioncount++;
- } else if (outf.exists()
+ } else if (outf.exists()
&& (task.getFofile().lastModified() <= outf.lastModified() )) {
skippedcount++;
}
@@ -512,10 +531,10 @@
task.log("Error setting base URL", Project.MSG_DEBUG);
}
- // Render if "force" flag is set OR
+ // Render if "force" flag is set OR
// OR output file doesn't exist OR
// output file is older than input file
- if (task.getForce() || !outf.exists()
+ if (task.getForce() || !outf.exists()
|| (f.lastModified() > outf.lastModified() )) {
render(f, outf, outputFormat);
actioncount++;
@@ -524,11 +543,11 @@
}
}
}
-
+
if (actioncount + skippedcount == 0) {
task.log("No files processed. No files were selected by the filesets "
+ "and no fofile was set." , Project.MSG_WARN);
- } else if (skippedcount > 0) {
+ } else if (skippedcount > 0) {
task.log(skippedcount + " xslfo file(s) skipped (no change found"
+ " since last generation; set force=\"true\" to override)."
, Project.MSG_INFO);
@@ -558,7 +577,10 @@
inputHandler.renderTo(userAgent, outputFormat, out);
success = true;
} catch (Exception ex) {
- throw new BuildException(ex);
+ if (task.getThrowexceptions()) {
+ throw new BuildException(ex);
+ }
+ logger.error("Error rendering fo file: " + foFile, ex);
} finally {
try {
out.close();
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/status.xml?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/status.xml Thu Jul 10 09:10:13 2008
@@ -53,6 +53,10 @@
<changes>
<release version="FOP Trunk" date="TBD">
+ <action context="Layout" dev="LF" type="fix">
+ Fixed absolute positioning of block-containers when specified
+ using right and bottom instead of left and top.
+ </action>
<action context="Renderers" dev="AC" type="add">
Added PDF encryption parameter support in configuration.
</action>
@@ -65,6 +69,13 @@
empty areas in pages whose last normal line contains footnotes
when the page bpd is not the same for all pages.
</action>
+ <action context="Code" dev="AD" type="update" importance="high">
+ Changed FONode.addCharacters() parameter to closer match the signature of
+ the standard SAX characters() event (reduces confusion and computations).
+ <em>!! Implementors of extensions that subclass FONode directly, and
+ offer an implementation for addCharacters() should take care to make
+ similar modifications in their code !!</em>
+ </action>
<!-- change reverted, to be added back later
<action context="Renderers" dev="AC" importance="high" type="add">
Added SVG support for AFP (GOCA).
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/footnote_basic.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/footnote_basic.xml?rev=675630&r1=675629&r2=675630&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/footnote_basic.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/footnote_basic.xml Thu Jul 10 09:10:13 2008
@@ -68,6 +68,7 @@
<eval expected="6000" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent/text/@font-size"/>
<eval expected=" in it." xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[2]"/>
<!-- the footnote -->
+ <eval expected="201600" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/@top-offset"/>
<eval expected="360000" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@ipd"/>
<eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@bpd"/>
<eval expected="11100" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/@bpd"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org