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 ph...@apache.org on 2012/10/04 16:46:06 UTC
svn commit: r1394098 [4/4] - in
/xmlgraphics/fop/branches/Temp_RoundedCorners: ./
examples/plan/src/org/apache/fop/plan/ lib/
src/documentation/content/xdocs/ src/documentation/content/xdocs/dev/
src/documentation/content/xdocs/trunk/ src/java/org/apac...
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java Thu Oct 4 14:46:01 2012
@@ -21,24 +21,266 @@ package org.apache.fop.render.pdf;
import java.util.LinkedList;
import java.util.Locale;
+import java.util.Map;
import org.xml.sax.Attributes;
+import org.xml.sax.helpers.AttributesImpl;
import org.apache.fop.accessibility.StructureTreeElement;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
+import org.apache.fop.fo.extensions.InternalElementMapping;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.pdf.PDFFactory;
-import org.apache.fop.pdf.PDFObject;
import org.apache.fop.pdf.PDFParentTree;
import org.apache.fop.pdf.PDFStructElem;
import org.apache.fop.pdf.PDFStructTreeRoot;
import org.apache.fop.pdf.StandardStructureAttributes.Table.Scope;
+import org.apache.fop.pdf.StandardStructureTypes;
+import org.apache.fop.pdf.StandardStructureTypes.Grouping;
import org.apache.fop.pdf.StandardStructureTypes.Table;
+import org.apache.fop.pdf.StructureHierarchyMember;
import org.apache.fop.pdf.StructureType;
+import org.apache.fop.util.XMLUtil;
class PDFStructureTreeBuilder implements StructureTreeEventHandler {
+ private static final String ROLE = "role";
+
+ private static final Map<String, StructureElementBuilder> BUILDERS
+ = new java.util.HashMap<String, StructureElementBuilder>();
+
+ private static final StructureElementBuilder DEFAULT_BUILDER
+ = new DefaultStructureElementBuilder(Grouping.NON_STRUCT);
+
+ static {
+ // Declarations and Pagination and Layout Formatting Objects
+ StructureElementBuilder regionBuilder = new RegionBuilder();
+ addBuilder("root", StandardStructureTypes.Grouping.DOCUMENT);
+ addBuilder("page-sequence", new PageSequenceBuilder());
+ addBuilder("static-content", regionBuilder);
+ addBuilder("flow", regionBuilder);
+ // Block-level Formatting Objects
+ addBuilder("block", StandardStructureTypes.Paragraphlike.P);
+ addBuilder("block-container", StandardStructureTypes.Grouping.DIV);
+ // Inline-level Formatting Objects
+ addBuilder("character", StandardStructureTypes.InlineLevelStructure.SPAN);
+ addBuilder("external-graphic", new ImageBuilder());
+ addBuilder("instream-foreign-object", new ImageBuilder());
+ addBuilder("inline", StandardStructureTypes.InlineLevelStructure.SPAN);
+ addBuilder("inline-container", StandardStructureTypes.Grouping.DIV);
+ addBuilder("page-number", StandardStructureTypes.InlineLevelStructure.QUOTE);
+ addBuilder("page-number-citation", StandardStructureTypes.InlineLevelStructure.QUOTE);
+ addBuilder("page-number-citation-last", StandardStructureTypes.InlineLevelStructure.QUOTE);
+ // Formatting Objects for Tables
+ addBuilder("table-and-caption", StandardStructureTypes.Grouping.DIV);
+ addBuilder("table", new TableBuilder());
+ addBuilder("table-caption", StandardStructureTypes.Grouping.CAPTION);
+ addBuilder("table-header", StandardStructureTypes.Table.THEAD);
+ addBuilder("table-footer", new TableFooterBuilder());
+ addBuilder("table-body", StandardStructureTypes.Table.TBODY);
+ addBuilder("table-row", StandardStructureTypes.Table.TR);
+ addBuilder("table-cell", new TableCellBuilder());
+ // Formatting Objects for Lists
+ addBuilder("list-block", StandardStructureTypes.List.L);
+ addBuilder("list-item", StandardStructureTypes.List.LI);
+ addBuilder("list-item-body", StandardStructureTypes.List.LBODY);
+ addBuilder("list-item-label", StandardStructureTypes.List.LBL);
+ // Dynamic Effects: Link and Multi Formatting Objects
+ addBuilder("basic-link", StandardStructureTypes.InlineLevelStructure.LINK);
+ // Out-of-Line Formatting Objects
+ addBuilder("float", StandardStructureTypes.Grouping.DIV);
+ addBuilder("footnote", StandardStructureTypes.InlineLevelStructure.NOTE);
+ addBuilder("footnote-body", StandardStructureTypes.Grouping.SECT);
+ addBuilder("wrapper", StandardStructureTypes.InlineLevelStructure.SPAN);
+ addBuilder("marker", StandardStructureTypes.Grouping.PRIVATE);
+
+ addBuilder("#PCDATA", new PlaceholderBuilder());
+ }
+
+ private static void addBuilder(String fo, StructureType structureType) {
+ addBuilder(fo, new DefaultStructureElementBuilder(structureType));
+ }
+
+ private static void addBuilder(String fo, StructureElementBuilder mapper) {
+ BUILDERS.put(fo, mapper);
+ }
+
+ private interface StructureElementBuilder {
+
+ PDFStructElem build(StructureHierarchyMember parent, Attributes attributes, PDFFactory pdfFactory,
+ EventBroadcaster eventBroadcaster);
+
+ }
+
+ private static class DefaultStructureElementBuilder implements StructureElementBuilder {
+
+ private final StructureType defaultStructureType;
+
+ DefaultStructureElementBuilder(StructureType structureType) {
+ this.defaultStructureType = structureType;
+ }
+
+ public final PDFStructElem build(StructureHierarchyMember parent, Attributes attributes,
+ PDFFactory pdfFactory, EventBroadcaster eventBroadcaster) {
+ String role = attributes.getValue(ROLE);
+ StructureType structureType;
+ if (role == null) {
+ structureType = defaultStructureType;
+ } else {
+ structureType = StandardStructureTypes.get(role);
+ if (structureType == null) {
+ structureType = defaultStructureType;
+ PDFEventProducer.Provider.get(eventBroadcaster).nonStandardStructureType(role, role,
+ structureType.toString());
+ }
+ }
+ PDFStructElem structElem = createStructureElement(parent, structureType);
+ setAttributes(structElem, attributes);
+ addKidToParent(structElem, parent, attributes);
+ registerStructureElement(structElem, pdfFactory, attributes);
+ return structElem;
+ }
+
+ protected PDFStructElem createStructureElement(StructureHierarchyMember parent,
+ StructureType structureType) {
+ return new PDFStructElem(parent, structureType);
+ }
+
+ protected void setAttributes(PDFStructElem structElem, Attributes attributes) {
+ }
+
+ protected void addKidToParent(PDFStructElem kid, StructureHierarchyMember parent,
+ Attributes attributes) {
+ parent.addKid(kid);
+ }
+
+ protected void registerStructureElement(PDFStructElem structureElement, PDFFactory pdfFactory,
+ Attributes attributes) {
+ pdfFactory.getDocument().registerStructureElement(structureElement);
+ }
+
+ }
+
+ private static class PageSequenceBuilder extends DefaultStructureElementBuilder {
+
+ PageSequenceBuilder() {
+ super(StandardStructureTypes.Grouping.PART);
+ }
+
+ @Override
+ protected PDFStructElem createStructureElement(StructureHierarchyMember parent,
+ StructureType structureType) {
+ return new PageSequenceStructElem(parent, structureType);
+ }
+
+ }
+
+ private static class RegionBuilder extends DefaultStructureElementBuilder {
+
+ RegionBuilder() {
+ super(StandardStructureTypes.Grouping.SECT);
+ }
+
+ @Override
+ protected void addKidToParent(PDFStructElem kid, StructureHierarchyMember parent,
+ Attributes attributes) {
+ String flowName = attributes.getValue(Flow.FLOW_NAME);
+ ((PageSequenceStructElem) parent).addContent(flowName, kid);
+ }
+
+ }
+
+ private static class ImageBuilder extends DefaultStructureElementBuilder {
+
+ ImageBuilder() {
+ super(StandardStructureTypes.Illustration.FIGURE);
+ }
+
+ @Override
+ protected void setAttributes(PDFStructElem structElem, Attributes attributes) {
+ String altTextNode = attributes.getValue(ExtensionElementMapping.URI, "alt-text");
+ if (altTextNode == null) {
+ altTextNode = "No alternate text specified";
+ }
+ structElem.put("Alt", altTextNode);
+ }
+
+ }
+
+ private static class TableBuilder extends DefaultStructureElementBuilder {
+
+ TableBuilder() {
+ super(StandardStructureTypes.Table.TABLE);
+ }
+
+ @Override
+ protected PDFStructElem createStructureElement(StructureHierarchyMember parent,
+ StructureType structureType) {
+ return new TableStructElem(parent, structureType);
+ }
+ }
+
+ private static class TableFooterBuilder extends DefaultStructureElementBuilder {
+
+ public TableFooterBuilder() {
+ super(StandardStructureTypes.Table.TFOOT);
+ }
+
+ @Override
+ protected void addKidToParent(PDFStructElem kid, StructureHierarchyMember parent,
+ Attributes attributes) {
+ ((TableStructElem) parent).addTableFooter(kid);
+ }
+ }
+
+ private static class TableCellBuilder extends DefaultStructureElementBuilder {
+
+ TableCellBuilder() {
+ super(StandardStructureTypes.Table.TD);
+ }
+
+ @Override
+ protected void registerStructureElement(PDFStructElem structureElement, PDFFactory pdfFactory,
+ Attributes attributes) {
+ if (structureElement.getStructureType() == Table.TH) {
+ String scopeAttribute = attributes.getValue(InternalElementMapping.URI,
+ InternalElementMapping.SCOPE);
+ Scope scope = (scopeAttribute == null)
+ ? Scope.COLUMN
+ : Scope.valueOf(scopeAttribute.toUpperCase(Locale.ENGLISH));
+ pdfFactory.getDocument().registerStructureElement(structureElement, scope);
+ } else {
+ pdfFactory.getDocument().registerStructureElement(structureElement);
+ }
+ }
+
+ @Override
+ protected void setAttributes(PDFStructElem structElem, Attributes attributes) {
+ String columnSpan = attributes.getValue("number-columns-spanned");
+ if (columnSpan != null) {
+ structElem.setTableAttributeColSpan(Integer.parseInt(columnSpan));
+ }
+ String rowSpan = attributes.getValue("number-rows-spanned");
+ if (rowSpan != null) {
+ structElem.setTableAttributeRowSpan(Integer.parseInt(rowSpan));
+ }
+ }
+
+ }
+
+ private static class PlaceholderBuilder implements StructureElementBuilder {
+
+ public PDFStructElem build(StructureHierarchyMember parent, Attributes attributes,
+ PDFFactory pdfFactory, EventBroadcaster eventBroadcaster) {
+ PDFStructElem elem = new PDFStructElem.Placeholder(parent);
+ parent.addKid(elem);
+ return elem;
+ }
+
+ }
+
private PDFFactory pdfFactory;
private EventBroadcaster eventBroadcaster;
@@ -51,6 +293,10 @@ class PDFStructureTreeBuilder implements
this.pdfFactory = pdfFactory;
}
+ void setEventBroadcaster(EventBroadcaster eventBroadcaster) {
+ this.eventBroadcaster = eventBroadcaster;
+ }
+
void setLogicalStructureHandler(PDFLogicalStructureHandler logicalStructureHandler) {
createRootStructureElement(logicalStructureHandler);
}
@@ -59,93 +305,53 @@ class PDFStructureTreeBuilder implements
assert rootStructureElement == null;
PDFParentTree parentTree = logicalStructureHandler.getParentTree();
PDFStructTreeRoot structTreeRoot = pdfFactory.getDocument().makeStructTreeRoot(parentTree);
- rootStructureElement = createStructureElement("root", structTreeRoot, null);
- structTreeRoot.addKid(rootStructureElement);
+ rootStructureElement = createStructureElement("root", structTreeRoot,
+ new AttributesImpl(), pdfFactory, eventBroadcaster);
}
- void setEventBroadcaster(EventBroadcaster eventBroadcaster) {
- this.eventBroadcaster = eventBroadcaster;
- }
+ private static PDFStructElem createStructureElement(String name, StructureHierarchyMember parent,
+ Attributes attributes, PDFFactory pdfFactory, EventBroadcaster eventBroadcaster) {
+ StructureElementBuilder builder = BUILDERS.get(name);
+ if (builder == null) {
+ // TODO is a fallback really necessary?
+ builder = DEFAULT_BUILDER;
+ }
+ return builder.build(parent, attributes, pdfFactory, eventBroadcaster);
+ }
public void startPageSequence(Locale language, String role) {
ancestors = new LinkedList<PDFStructElem>();
- PDFStructElem structElem = createStructureElement("page-sequence", rootStructureElement, role);
+ AttributesImpl attributes = new AttributesImpl();
+ attributes.addAttribute("", ROLE, ROLE, XMLUtil.CDATA, role);
+ PDFStructElem structElem = createStructureElement("page-sequence",
+ rootStructureElement, attributes, pdfFactory, eventBroadcaster);
if (language != null) {
structElem.setLanguage(language);
}
- rootStructureElement.addKid(structElem);
ancestors.add(structElem);
}
- private PDFStructElem createStructureElement(String name, PDFObject parent, String role) {
- StructureType structureType = FOToPDFRoleMap.mapFormattingObject(name, role, parent,
- eventBroadcaster);
- if (structureType == Table.TH) {
- return pdfFactory.getDocument().makeStructureElement(structureType, parent, Scope.COLUMN);
- } else {
- return pdfFactory.getDocument().makeStructureElement(structureType, parent);
- }
- }
-
public void endPageSequence() {
}
public StructureTreeElement startNode(String name, Attributes attributes) {
PDFStructElem parent = ancestors.getFirst();
- String role = attributes.getValue("role");
- PDFStructElem structElem = createStructureElement(name, parent, role);
- setSpanAttributes(structElem, attributes);
- parent.addKid(structElem);
+ PDFStructElem structElem = createStructureElement(name, parent, attributes,
+ pdfFactory, eventBroadcaster);
ancestors.addFirst(structElem);
return structElem;
}
- private void setSpanAttributes(PDFStructElem structElem, Attributes attributes) {
- String columnSpan = attributes.getValue("number-columns-spanned");
- if (columnSpan != null) {
- structElem.setTableAttributeColSpan(Integer.parseInt(columnSpan));
- }
- String rowSpan = attributes.getValue("number-rows-spanned");
- if (rowSpan != null) {
- structElem.setTableAttributeRowSpan(Integer.parseInt(rowSpan));
- }
- }
-
public void endNode(String name) {
- removeFirstAncestor();
- }
-
- private void removeFirstAncestor() {
ancestors.removeFirst();
}
public StructureTreeElement startImageNode(String name, Attributes attributes) {
- PDFStructElem parent = ancestors.getFirst();
- String role = attributes.getValue("role");
- PDFStructElem structElem = createStructureElement(name, parent, role);
- parent.addKid(structElem);
- String altTextNode = attributes.getValue(ExtensionElementMapping.URI, "alt-text");
- if (altTextNode != null) {
- structElem.put("Alt", altTextNode);
- } else {
- structElem.put("Alt", "No alternate text specified");
- }
- ancestors.addFirst(structElem);
- return structElem;
+ return startNode(name, attributes);
}
public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
- PDFStructElem parent = ancestors.getFirst();
- String role = attributes.getValue("role");
- PDFStructElem structElem;
- if ("#PCDATA".equals(name)) {
- structElem = new PDFStructElem.Placeholder(parent);
- } else {
- structElem = createStructureElement(name, parent, role);
- }
- parent.addKid(structElem);
- ancestors.addFirst(structElem);
- return structElem;
+ return startNode(name, attributes);
}
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSDocumentHandler.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSDocumentHandler.java Thu Oct 4 14:46:01 2012
@@ -39,6 +39,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xmlgraphics.io.TempResourceURIGenerator;
import org.apache.xmlgraphics.java2d.Dimension2DDouble;
import org.apache.xmlgraphics.ps.DSCConstants;
import org.apache.xmlgraphics.ps.PSDictionary;
@@ -53,7 +54,6 @@ import org.apache.xmlgraphics.ps.dsc.eve
import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox;
import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.io.TempResourceURIGenerator;
import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler;
import org.apache.fop.render.intermediate.IFContext;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSFontUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSFontUtils.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSFontUtils.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/ps/PSFontUtils.java Thu Oct 4 14:46:01 2012
@@ -38,7 +38,7 @@ import org.apache.xmlgraphics.ps.dsc.Res
import org.apache.fop.fonts.Base14Font;
import org.apache.fop.fonts.CIDFontType;
-import org.apache.fop.fonts.CIDSubset;
+import org.apache.fop.fonts.CIDSet;
import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.CustomFont;
import org.apache.fop.fonts.EmbeddingMode;
@@ -457,15 +457,17 @@ public class PSFontUtils extends org.apa
// TODO /FontInfo
gen.write("/CIDCount ");
- CIDSubset cidSubset = font.getCIDSubset();
- int subsetSize = cidSubset.getSubsetSize();
- gen.write(subsetSize);
+ CIDSet cidSet = font.getCIDSet();
+ int numberOfGlyphs = cidSet.getNumberOfGlyphs();
+ gen.write(numberOfGlyphs);
gen.writeln(" def");
gen.writeln("/GDBytes 2 def"); // TODO always 2?
gen.writeln("/CIDMap [<");
int colCount = 0;
int lineCount = 1;
- for (int cid = 0; cid < subsetSize; cid++) {
+ int nextBitSet = 0;
+ int previousBitSet = 0;
+ for (int cid = 0; cid < numberOfGlyphs; cid++) {
if (colCount++ == 20) {
gen.newLine();
colCount = 1;
@@ -478,7 +480,23 @@ public class PSFontUtils extends org.apa
if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
gid = HexEncoder.encode(cid, 4);
} else {
- gid = HexEncoder.encode(cidSubset.getGlyphIndexForSubsetIndex(cid), 4);
+ previousBitSet = nextBitSet;
+ nextBitSet = cidSet.getGlyphIndices().nextSetBit(nextBitSet);
+ while (previousBitSet++ < nextBitSet) {
+ // if there are gaps in the indices we pad them with zeros
+ gen.write("0000");
+ cid++;
+ if (colCount++ == 20) {
+ gen.newLine();
+ colCount = 1;
+ if (lineCount++ == 800) {
+ gen.writeln("> <");
+ lineCount = 1;
+ }
+ }
+ }
+ gid = HexEncoder.encode(nextBitSet, 4);
+ nextBitSet++;
}
gen.write(gid);
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/servlet/FopServlet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/servlet/FopServlet.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/servlet/FopServlet.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/servlet/FopServlet.java Thu Oct 4 14:46:01 2012
@@ -41,14 +41,15 @@ import javax.xml.transform.stream.Stream
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder;
import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.io.Resource;
-import org.apache.fop.apps.io.ResourceResolver;
/**
* Example servlet to generate a PDF from a servlet.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/status.xml?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/status.xml Thu Oct 4 14:46:01 2012
@@ -62,6 +62,51 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Layout" dev="MH" type="add" fixes-bug="53924" due-to="Luis Bernardo">
+ Support for retrieve-table-markers
+ </action>
+ <action context="Renderers" dev="VH" type="add" fixes-bug="53902">
+ Added possibility to define âheaderâ table columns (the same way as fo:table-header allows
+ to define header rows). When accessibility is enabled, this allows to set the appropriate
+ Scope attribute on the corresponding TH cells.
+ </action>
+ <action context="Fonts" dev="MH" type="add" fixes-bug="53868" importance="low" due-to="Luis Bernardo">
+ Full font embedding in PDF
+ </action>
+ <action context="Renderers" dev="PH" type="add" fixes-bug="53865" importance="low">
+ Added configuration for RowPerStrip configuration in the Tiff renderer.
+ RowsPerStrip can be configured to 1 or to the total # of rows.
+ See docs for fop.xconf configuration details.
+ </action>
+ <action context="Layout" dev="VH" type="fix" fixes-bug="53598" due-to="Robert Meyer">
+ Always set the breakClass field to a legal value in BreakElement, so as to avoid
+ IllegalArgumentExceptions in other parts of the code.
+ </action>
+ <action context="Layout" dev="VH" type="fix" fixes-bug="45715" due-to="Luis Bernardo">
+ Restored support for break-before on fo:table.
+ </action>
+ <action context="Layout" dev="VH" type="fix" fixes-bug="53827">
+ When an fo:block has a non-zero value for its text-indent property and is broken over two
+ pages of different widths, then the first line on the second page is missing one word and
+ appears indented.
+ </action>
+ <action context="Renderers" dev="MH" type="fix" fixes-bug="53790">
+ Prevented the TIFF configurator from overriding the Bitmap configurator unless CCITT
+ compression is enabled.
+ </action>
+ <action context="Renderers" dev="MH" type="fix" fixes-bug="53786">
+ Removed the Attribute Qualifier on TLEs as they aren't used.
+ </action>
+ <action context="Renderers" dev="MH" type="fix" fixes-bug="48954" due-to="PH">
+ Support for character encoding of TLEs in AFP output
+ </action>
+ <action context="Renderers" dev="VH" type="fix" fixes-bug="53778">
+ When PDF accessibility is enabled, the contents for the different regions must appear in the
+ proper order in the structure tree.
+ </action>
+ <action context="Renderers" dev="MH" type="fix" fixes-bug="53766" due-to="Robert Meyer">
+ Remove StandardEncoding as the encoding type from fonts used in the PDF renderer
+ </action>
<action context="Fonts" dev="MH" type="fix" fixes-bug="53685">
Cached AFP charactersets have more unique keys preventing the two characters with
but different binaries conflicting.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/URIResolutionTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/URIResolutionTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/URIResolutionTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/URIResolutionTestCase.java Thu Oct 4 14:46:01 2012
@@ -46,14 +46,15 @@ import org.apache.commons.io.output.Byte
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder;
import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.io.Resource;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.render.xml.XMLRenderer;
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java Thu Oct 4 14:46:01 2012
@@ -19,8 +19,6 @@
package org.apache.fop.accessibility.fo;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -34,7 +32,6 @@ import javax.xml.transform.TransformerFa
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.custommonkey.xmlunit.Diff;
@@ -57,9 +54,17 @@ import org.apache.fop.fotreetest.DummyFO
public class FO2StructureTreeConverterTestCase {
- private interface FOLoader {
+ private static class FOLoader {
- InputStream getFoInputStream();
+ private final String resourceName;
+
+ FOLoader(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ public InputStream getFoInputStream() {
+ return getResource(resourceName);
+ }
}
private static final String STRUCTURE_TREE_SEQUENCE_NAME = "structure-tree-sequence";
@@ -68,62 +73,35 @@ public class FO2StructureTreeConverterTe
@Test
public void testCompleteDocument() throws Exception {
- foLoader = new FOLoader() {
- public InputStream getFoInputStream() {
- return getResource("/org/apache/fop/fo/complete_document.fo");
- }
- };
- testConverter();
+ testConverter("/org/apache/fop/fo/complete_document.fo");
}
@Test
public void testTableFooters() throws Exception {
- foLoader = new FOLoader() {
- public InputStream getFoInputStream() {
- return getResource("table-footers.fo");
- }
- };
- testConverter();
+ testConverter("table-footers.fo");
}
@Test
- public void testCompleteContentWrappedInTableFooter() throws Exception {
- Source xslt = new StreamSource(getResource("wrapCompleteDocumentInTableFooter.xsl"));
- Transformer transformer = createTransformer(xslt);
- InputStream originalFO = getResource("/org/apache/fop/fo/complete_document.fo");
- ByteArrayOutputStream transformedFoOutput = new ByteArrayOutputStream();
- transformer.transform(new StreamSource(originalFO), new StreamResult(transformedFoOutput));
- final byte[] transformedFoOutputBytes = transformedFoOutput.toByteArray();
- foLoader = new FOLoader() {
- public InputStream getFoInputStream() {
- return new ByteArrayInputStream(transformedFoOutputBytes);
- }
- };
- testConverter();
+ public void testArtifact() throws Exception {
+ testConverter("artifact.fo");
}
@Test
- public void testArtifact() throws Exception {
- foLoader = new FOLoader() {
-
- public InputStream getFoInputStream() {
- return getResource("artifact.fo");
- }
- };
- testConverter();
+ public void testSideRegions() throws Exception {
+ testConverter("/org/apache/fop/fo/pagination/side-regions.fo");
}
- private Transformer createTransformer(Source xslt) throws TransformerFactoryConfigurationError,
- TransformerConfigurationException {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- return transformerFactory.newTransformer(xslt);
+ @Test
+ public void headerTableCellMustPropagateScope() throws Exception {
+ testConverter("table-header_scope.fo");
}
private static InputStream getResource(String name) {
return FO2StructureTreeConverterTestCase.class.getResourceAsStream(name);
}
- private void testConverter() throws Exception {
+ private void testConverter(String foResourceName) throws Exception {
+ foLoader = new FOLoader(foResourceName);
DOMResult expectedStructureTree = loadExpectedStructureTree();
DOMResult actualStructureTree = buildActualStructureTree();
final Diff diff = createDiff(expectedStructureTree, actualStructureTree);
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl Thu Oct 4 14:46:01 2012
@@ -21,7 +21,7 @@
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
xmlns:foi="http://xmlgraphics.apache.org/fop/internal">
- <xsl:output method="xml" indent="no"/>
+ <xsl:output method="xml" indent="yes"/>
<xsl:template name="copy">
<xsl:copy>
@@ -50,6 +50,25 @@
<xsl:call-template name="copy"/>
</xsl:template>
+ <xsl:template match="fo:static-content/@flow-name|fo:flow/@flow-name">
+ <xsl:choose>
+ <xsl:when test=". = 'xsl-region-body' or
+ . = 'xsl-region-before' or
+ . = 'xsl-region-after' or
+ . = 'xsl-region-start' or
+ . = 'xsl-region-end' or
+ . = 'xsl-before-float-separator' or
+ . = 'xsl-footnote-separator'">
+ <xsl:copy/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="concat('xsl-', local-name(//*[@region-name = current()]))"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<!-- Block-level Formatting Objects -->
<xsl:template match="fo:block|fo:block-container">
<xsl:call-template name="copy"/>
@@ -73,16 +92,35 @@
<xsl:call-template name="copy"/>
</xsl:template>
- <xsl:template match="fo:table">
+ <xsl:template match="fo:table|fo:table-header|fo:table-footer|fo:table-body|fo:table-row">
+ <xsl:call-template name="copy"/>
+ </xsl:template>
+
+ <xsl:template name="get.column.header">
+ <xsl:value-of select="ancestor::fo:table/fo:table-column[
+ count(preceding-sibling::fo:table-column) = count(current()/preceding-sibling::fo:table-cell)]/@fox:header"/>
+ </xsl:template>
+
+ <xsl:template match="fo:table-cell">
+ <xsl:variable name="header"><xsl:call-template name="get.column.header"/></xsl:variable>
<xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates select="*[name() != 'fo:table-footer']"/>
- <xsl:apply-templates select="fo:table-footer"/>
+ <xsl:if test="$header = 'true'">
+ <xsl:attribute name="role">TH</xsl:attribute>
+ <xsl:attribute name="scope" namespace="http://xmlgraphics.apache.org/fop/internal">Row</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
- <xsl:template match="fo:table-header|fo:table-footer|fo:table-body|fo:table-row|fo:table-cell">
- <xsl:call-template name="copy"/>
+ <xsl:template match="fo:table-header/fo:table-cell|fo:table-header/fo:table-row/fo:table-cell">
+ <xsl:variable name="header"><xsl:call-template name="get.column.header"/></xsl:variable>
+ <xsl:copy>
+ <xsl:attribute name="role">TH</xsl:attribute>
+ <xsl:if test="$header = 'true'">
+ <xsl:attribute name="scope" namespace="http://xmlgraphics.apache.org/fop/internal">Both</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
</xsl:template>
<!-- Formatting Objects for Lists -->
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java Thu Oct 4 14:46:01 2012
@@ -21,11 +21,12 @@ import java.net.URI;
import org.junit.Test;
-import org.apache.fop.apps.io.ResourceResolver;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
public class EnvironmentalProfileFactoryTestCase {
private final URI testURI = URI.create("this.is.purely.for.test.purposes");
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/MutableConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/MutableConfig.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/MutableConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/MutableConfig.java Thu Oct 4 14:46:01 2012
@@ -24,8 +24,9 @@ import java.util.Set;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
+import org.apache.xmlgraphics.io.ResourceResolver;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;
@@ -130,4 +131,8 @@ public final class MutableConfig impleme
public Map<String, String> getHyphenationPatternNames() {
return delegate.getHyphenationPatternNames();
}
+
+ public FallbackResolver getFallbackResolver() {
+ return delegate.getFallbackResolver();
+ }
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java Thu Oct 4 14:46:01 2012
@@ -20,7 +20,7 @@
package org.apache.fop.apps;
import static org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererOption.COMPRESSION;
-
+import static org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererOption.SINGLE_STRIP;
public class TIFFRendererConfBuilder extends BitmapRendererConfBuilder {
public TIFFRendererConfBuilder() {
@@ -31,4 +31,9 @@ public class TIFFRendererConfBuilder ext
createTextElement(COMPRESSION, mode);
return this;
}
+
+ public TIFFRendererConfBuilder setSingleStrip(boolean single) {
+ createTextElement(SINGLE_STRIP, String.valueOf(single));
+ return this;
+ }
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java Thu Oct 4 14:46:01 2012
@@ -37,6 +37,8 @@ import org.xml.sax.SAXException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/FontURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/FontURIResolver.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/FontURIResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/FontURIResolver.java Thu Oct 4 14:46:01 2012
@@ -39,6 +39,8 @@ import org.apache.fop.apps.PDFRendererCo
import static org.junit.Assert.assertTrue;
+import org.apache.xmlgraphics.io.Resource;
+
public class FontURIResolver extends BaseURIResolutionTest {
public enum Event {
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java Thu Oct 4 14:46:01 2012
@@ -36,6 +36,10 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+import org.apache.xmlgraphics.io.TempResourceResolver;
+
public class ResourceResolverFactoryTestCase {
private static final byte[] DATA = new byte[]{(byte) 0, (byte) 1, (byte) 2};
@@ -193,10 +197,10 @@ public class ResourceResolverFactoryTest
final ResourceResolver sut;
TestCreateSchemaAwareResourceResolverBuilderHelper() {
- ResourceResolverFactory.SchemaAwareResourceResolverBuilder builder
- = ResourceResolverFactory.createSchemaAwareResourceResolverBuilder(
+ ResourceResolverFactory.SchemeAwareResourceResolverBuilder builder
+ = ResourceResolverFactory.createSchemeAwareResourceResolverBuilder(
defaultResourceResolver);
- builder.registerResourceResolverForSchema(SCHEMA, registedResourceResolver);
+ builder.registerResourceResolverForScheme(SCHEMA, registedResourceResolver);
sut = builder.build();
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/TestingResourceResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/TestingResourceResolver.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/TestingResourceResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/TestingResourceResolver.java Thu Oct 4 14:46:01 2012
@@ -24,6 +24,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
abstract class TestingResourceResolver implements ResourceResolver {
private final Map<URI, Object> checker;
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java Thu Oct 4 14:46:01 2012
@@ -35,6 +35,8 @@ import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
public class URIResolverWrapperTestCase {
private static final List<String> BASE_URIS = Collections.unmodifiableList(Arrays.asList(
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/fo/FONodeMocks.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/fo/FONodeMocks.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/fo/FONodeMocks.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/fo/FONodeMocks.java Thu Oct 4 14:46:01 2012
@@ -19,19 +19,22 @@
package org.apache.fop.fo;
+import java.io.IOException;
+
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import java.io.IOException;
-
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
+import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.fo.flow.table.ColumnNumberManager;
+import org.apache.fop.fo.flow.table.ColumnNumberManagerHolder;
/**
* A helper class for creating mocks of {@link FONode} and its descendants.
@@ -51,27 +54,36 @@ public final class FONodeMocks {
public static FONode mockFONode() {
FONode mockFONode = mock(FONode.class);
mockGetFOEventHandler(mockFONode);
+ mockGetImageManager(mockFONode.getFOEventHandler().getUserAgent());
return mockFONode;
}
- private static void mockGetFOEventHandler(FONode mockFONode) {
+ public static FOEventHandler mockGetFOEventHandler(FONode mockFONode) {
FOEventHandler mockFOEventHandler = mock(FOEventHandler.class);
mockGetUserAgent(mockFOEventHandler);
when(mockFONode.getFOEventHandler()).thenReturn(mockFOEventHandler);
+ return mockFOEventHandler;
}
- private static void mockGetUserAgent(FOEventHandler mockFOEventHandler) {
+ public static FOUserAgent mockGetUserAgent(FOEventHandler mockFOEventHandler) {
FOUserAgent mockFOUserAgent = mock(FOUserAgent.class);
- mockGetImageManager(mockFOUserAgent);
when(mockFOEventHandler.getUserAgent()).thenReturn(mockFOUserAgent);
+ return mockFOUserAgent;
}
- private static void mockGetImageManager(FOUserAgent mockFOUserAgent) {
+ public static EventBroadcaster mockGetEventBroadcaster(FOUserAgent mockFOUserAgent) {
+ EventBroadcaster mockBroadcaster = mock(EventBroadcaster.class);
+ when(mockFOUserAgent.getEventBroadcaster()).thenReturn(mockBroadcaster);
+ return mockBroadcaster;
+ }
+
+ public static ImageManager mockGetImageManager(FOUserAgent mockFOUserAgent) {
try {
ImageManager mockImageManager = mock(ImageManager.class);
when(mockImageManager.getImageInfo(anyString(), any(ImageSessionContext.class)))
.thenReturn(null);
when(mockFOUserAgent.getImageManager()).thenReturn(mockImageManager);
+ return mockImageManager;
} catch (ImageException e) {
throw new RuntimeException(e);
} catch (IOException e) {
@@ -79,4 +91,10 @@ public final class FONodeMocks {
}
}
+ public static ColumnNumberManager mockGetColumnNumberManager(ColumnNumberManagerHolder mock) {
+ ColumnNumberManager mockColumnNumberManager = mock(ColumnNumberManager.class);
+ when(mock.getColumnNumberManager()).thenReturn(mockColumnNumberManager);
+ return mockColumnNumberManager;
+ }
+
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/intermediate/TestAssistant.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/intermediate/TestAssistant.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/intermediate/TestAssistant.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/intermediate/TestAssistant.java Thu Oct 4 14:46:01 2012
@@ -42,8 +42,11 @@ import org.w3c.dom.Element;
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
+import org.apache.fop.apps.EnvironmentProfile;
+import org.apache.fop.apps.EnvironmentalProfileFactory;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder;
+import org.apache.fop.apps.io.ResourceResolverFactory;
/**
* Helper class for running FOP tests.
@@ -115,7 +118,10 @@ public class TestAssistant {
public FopFactory getFopFactory(Document testDoc) {
boolean base14KerningEnabled = isBase14KerningEnabled(testDoc);
boolean strictValidation = isStrictValidation(testDoc);
- FopFactoryBuilder builder = new FopFactoryBuilder(testDir.getParentFile().toURI());
+ EnvironmentProfile envProfile = EnvironmentalProfileFactory.createRestrictedIO(
+ testDir.getParentFile().toURI(),
+ ResourceResolverFactory.createDefaultResourceResolver());
+ FopFactoryBuilder builder = new FopFactoryBuilder(envProfile);
builder.setStrictFOValidation(strictValidation);
builder.getFontManager().setBase14KerningEnabled(base14KerningEnabled);
return builder.build();
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/PageSequenceLayoutManagerTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/PageSequenceLayoutManagerTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/PageSequenceLayoutManagerTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/PageSequenceLayoutManagerTestCase.java Thu Oct 4 14:46:01 2012
@@ -19,6 +19,8 @@
package org.apache.fop.layoutmgr;
+import org.junit.Test;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
@@ -31,7 +33,6 @@ import org.apache.fop.fo.pagination.Page
import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.SimplePageMaster;
-import org.junit.Test;
public class PageSequenceLayoutManagerTestCase {
Copied: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java (from r1394086, xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java?p2=xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java&p1=xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java&r1=1394086&r2=1394098&rev=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java Thu Oct 4 14:46:01 2012
@@ -23,10 +23,6 @@ import java.awt.Color;
import org.junit.Test;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
import org.apache.fop.fo.flow.table.PrimaryGridUnit;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableCell;
@@ -41,6 +37,10 @@ import org.apache.fop.layoutmgr.PageSequ
import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.RetrieveTableMarkerLayoutManager;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
public class TableCellLayoutManagerTestCase {
// this test aims to check that the first call to addAreas() calls
@@ -57,7 +57,7 @@ public class TableCellLayoutManagerTestC
CondLengthProperty clp = mock(CondLengthProperty.class);
when(clp.getLengthValue()).thenReturn(0);
// real border info
- BorderInfo bi = BorderInfo.getInstance(0, clp, Color.BLACK);
+ BorderInfo bi = BorderInfo.getInstance(0, clp, Color.BLACK, clp, clp);
// mock column
TableColumn tcol = mock(TableColumn.class);
when(tcol.getCommonBorderPaddingBackground()).thenReturn(cbpb);
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java Thu Oct 4 14:46:01 2012
@@ -24,14 +24,17 @@ import java.net.URI;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.io.InternalResourceResolver;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
+import org.apache.fop.fonts.CIDSet;
import org.apache.fop.fonts.CIDSubset;
+import org.apache.fop.fonts.EmbeddingMode;
import org.apache.fop.fonts.MultiByteFont;
-import static org.junit.Assert.assertEquals;
-
/**
* Test case for {@link PDFFactory}.
*/
@@ -45,7 +48,7 @@ public class PDFFactoryTestCase {
public void testSubsetFontNamePrefix() {
class MockedFont extends MultiByteFont {
public MockedFont(InternalResourceResolver resolver) {
- super(resolver);
+ super(resolver, EmbeddingMode.AUTO);
}
@Override
@@ -54,8 +57,8 @@ public class PDFFactoryTestCase {
}
@Override
- public CIDSubset getCIDSubset() {
- return new CIDSubset();
+ public CIDSet getCIDSet() {
+ return new CIDSubset(this);
}
}
PDFDocument doc = new PDFDocument("Test");
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/TableHeaderScopeTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/TableHeaderScopeTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/TableHeaderScopeTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/pdf/TableHeaderScopeTestCase.java Thu Oct 4 14:46:01 2012
@@ -52,7 +52,8 @@ public class TableHeaderScopeTestCase {
VersionController controller = mock(VersionController.class);
PDFDocument document = new PDFDocument("Test", controller);
document.makeStructTreeRoot(null);
- document.makeStructureElement(Table.TH, null, scope);
+ PDFStructElem th = new PDFStructElem(null, Table.TH);
+ document.registerStructureElement(th, scope);
verify(controller).addTableHeaderScopeAttribute(any(PDFStructElem.class), eq(scope));
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java Thu Oct 4 14:46:01 2012
@@ -26,9 +26,11 @@ import org.apache.fop.apps.TIFFRendererC
import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
public class TIFFRendererConfigParserTestCase
- extends AbstractBitmapRendererConfigParserTester {
+extends AbstractBitmapRendererConfigParserTester {
public TIFFRendererConfigParserTestCase() {
super(new TIFFRendererConfigParser());
@@ -47,9 +49,17 @@ public class TIFFRendererConfigParserTes
@Test
public void testCompression() throws Exception {
- for (TIFFCompressionValues value : TIFFCompressionValues.values()) {
+ for (TIFFCompressionValue value : TIFFCompressionValue.values()) {
parseConfig(createRenderer().setCompressionMode(value.getName()));
assertEquals(value, getConfig().getCompressionType());
}
}
+
+ @Test
+ public void testSingleStrip() throws Exception {
+ parseConfig(createRenderer().setSingleStrip(true));
+ assertTrue(getConfig().isSingleStrip());
+ parseConfig(createRenderer().setSingleStrip(false));
+ assertFalse(getConfig().isSingleStrip());
+ }
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java Thu Oct 4 14:46:01 2012
@@ -23,14 +23,17 @@ import java.awt.image.BufferedImage;
import org.junit.Test;
+
import org.apache.fop.apps.FopConfBuilder;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.apps.TIFFRendererConfBuilder;
import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser;
-import static org.apache.fop.render.bitmap.TIFFCompressionValues.CCITT_T4;
-import static org.apache.fop.render.bitmap.TIFFCompressionValues.CCITT_T6;
+import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T4;
+import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T6;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
public class TIFFRendererConfiguratorTestCase extends AbstractBitmapRendererConfiguratorTest {
@@ -51,7 +54,7 @@ public class TIFFRendererConfiguratorTes
@Test
@Override
public void testColorModes() throws Exception {
- for (TIFFCompressionValues value : TIFFCompressionValues.values()) {
+ for (TIFFCompressionValue value : TIFFCompressionValue.values()) {
parseConfig(createBuilder().setCompressionMode(value.getName()));
if (value == CCITT_T6 || value == CCITT_T4) {
assertEquals(BufferedImage.TYPE_BYTE_BINARY, settings.getBufferedImageType());
@@ -60,4 +63,13 @@ public class TIFFRendererConfiguratorTes
}
}
}
+
+ @Test
+ public void testSingleStrip() throws Exception {
+ parseConfig(createBuilder().setSingleStrip(true));
+ assertTrue(settings.getWriterParams().isSingleStrip());
+ parseConfig(createBuilder().setSingleStrip(false));
+ assertFalse(settings.getWriterParams().isSingleStrip());
+ }
+
}
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/background-image_svg_repeat.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/background-image_svg_repeat.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/background-image_svg_single.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/background-image_svg_single.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/image_svg.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/image_svg.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/image_wmf.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/image_wmf.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/role.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/role.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/role_non-standard.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/role_non-standard.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/text_font-embedding.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/test/pdf/accessibility/pdf/text_font-embedding.pdf?rev=1394098&r1=1394097&r2=1394098&view=diff
==============================================================================
Binary files - no diff available.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org