aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-10-15 16:25:08 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-10-15 16:25:08 +0000
commit5dd6862ad1eed75fdcc205a228aae7a46a00a46d (patch)
tree9c47118e461a3b69db243b3492eee636e7d2d42d /src
parent113a028123216ba7f6d6c376d0b7b0a9f76986bd (diff)
downloadxmlgraphics-fop-5dd6862ad1eed75fdcc205a228aae7a46a00a46d.tar.gz
xmlgraphics-fop-5dd6862ad1eed75fdcc205a228aae7a46a00a46d.zip
Added mappings for yet unimplemented FOs.
Return /NonStruct instead of null if no mapping is found for a given object, in order to at least generate a valid PDF git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@825555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java b/src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java
index e3122ec39..2c13edca5 100644
--- a/src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java
+++ b/src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java
@@ -28,18 +28,24 @@ import org.apache.fop.pdf.PDFStructElem;
/**
* This class provides the standard mappings from Formatting Objects to PDF structure types.
*/
-public final class FOToPDFRoleMap {
+final class FOToPDFRoleMap {
private static final Map STANDARD_MAPPINGS = new java.util.HashMap();
private static final PDFName TFOOT = new PDFName("TFoot");
private static final PDFName THEAD = new PDFName("THead");
+ private static final PDFName NON_STRUCT = new PDFName("NonStruct");
static {
addMapping("block", "P");
- addMapping("block-container", "Div");
- PDFName st = new PDFName("Span");
+ PDFName st = new PDFName("Div");
+ addMapping("block-container", st);
+ addMapping("inline-container", st);
+ addMapping("table-and-caption", st);
+ addMapping("float", st);
+
+ st = new PDFName("Span");
addMapping("inline", st);
addMapping("wrapper", st);
addMapping("character", st);
@@ -58,6 +64,7 @@ public final class FOToPDFRoleMap {
addMapping("external-graphic", st);
addMapping("instream-foreign-object", st);
+ addMapping("table-caption", "Caption");
addMapping("table", "Table");
addMapping("table-body", "TBody");
addMapping("table-header", THEAD);
@@ -98,8 +105,9 @@ public final class FOToPDFRoleMap {
Mapper mapper = (Mapper)STANDARD_MAPPINGS.get(fo);
if (mapper != null) {
return mapper.getStructureType(parent);
+ } else {
+ return NON_STRUCT;
}
- return null;
}
private interface Mapper {