Bug 50987 - [PATCH] Accessibilty - Incorrect parent tree for links
Summary: [PATCH] Accessibilty - Incorrect parent tree for links
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 11:42 UTC by Martin K
Modified: 2012-04-01 06:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin K 2011-03-28 11:42:47 UTC
FOP puts in the parent tree for links the link itself instead of the related structure element.

diff --git a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java
--- a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java
@@ -314,7 +314,6 @@ class PDFLogicalStructureHandler {
     void addLinkContentItem(PDFLink link, String structurePointer) {
         int structParent = getNextParentTreeKey();
         link.setStructParent(structParent);
-        parentTree.getNums().put(structParent, link);
         PDFDictionary contentItem = new PDFDictionary();
         contentItem.put("Type", OBJR);
         contentItem.put("Pg", this.currentPage);
@@ -322,5 +321,6 @@ class PDFLogicalStructureHandler {
         PDFStructElem parent = (PDFStructElem) structTreeMap.get(structurePointer);
+        parentTree.getNums().put(structParent, parent);
         parent.addKid(contentItem);
     }
Comment 1 Andreas L. Delmelle 2011-04-03 05:58:40 UTC
Fixed in r1088234.

Thanks for the patch!
Comment 2 Glenn Adams 2012-04-01 06:17:20 UTC
batch transition to closed; if someone wishes to restore one of these to resolved in order to perform a verification step, then feel free to do so