diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2012-07-24 16:39:04 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2012-07-24 16:39:04 +0000 |
commit | 6c6183d35af7ed373ac3c9613ea4e35e77ae3afc (patch) | |
tree | bd5bd0569162b8b4deef8230e3dd4888e6cfcc7d /src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java | |
parent | 22d7da60355a19d132deb696dcdc45d8ae1f5f2d (diff) | |
download | xmlgraphics-fop-6c6183d35af7ed373ac3c9613ea4e35e77ae3afc.tar.gz xmlgraphics-fop-6c6183d35af7ed373ac3c9613ea4e35e77ae3afc.zip |
Bugzilla #53596: When PDF accessibility is enabled, the structure tree must contain information about the number of columns or rows spanned by a table cell.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1365162 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java index 3839d47bc..0f8e74515 100644 --- a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java +++ b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java @@ -90,11 +90,23 @@ class PDFStructureTreeBuilder implements StructureTreeEventHandler { PDFStructElem parent = ancestors.getFirst(); String role = attributes.getValue("role"); PDFStructElem structElem = createStructureElement(name, parent, role); + setSpanAttributes(structElem, attributes); parent.addKid(structElem); 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(); } |