ASF Bugzilla – Attachment 26720 Details for
Bug 50852
[PATCH] Improve generation of PDFs with accessibility information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 20/20
0020-Support-role-for-Flow-PageSequence.patch (text/plain), 3.78 KB, created by
Martin K
on 2011-03-02 07:10:00 UTC
(
hide
)
Description:
Patch 20/20
Filename:
MIME Type:
Creator:
Martin K
Created:
2011-03-02 07:10:00 UTC
Size:
3.78 KB
patch
obsolete
>Subject: [PATCH 20/20] Support role for Flow & PageSequence > >--- > src/java/org/apache/fop/fo/pagination/Flow.java | 3 +++ > .../org/apache/fop/fo/pagination/PageSequence.java | 3 +++ > .../fop/render/pdf/PDFLogicalStructureHandler.java | 2 +- > 3 files changed, 7 insertions(+), 1 deletions(-) > >diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java >index e340469..afbf5a9 100644 >--- a/src/java/org/apache/fop/fo/pagination/Flow.java >+++ b/src/java/org/apache/fop/fo/pagination/Flow.java >@@ -36,6 +36,7 @@ import org.apache.fop.fo.ValidationException; > public class Flow extends FObj { > // The value of properties relevant for fo:flow. > private String flowName; >+ private String role; // used for accessibility > // End of property values > > /** used for FO validation */ >@@ -53,6 +54,7 @@ public class Flow extends FObj { > public void bind(PropertyList pList) throws FOPException { > super.bind(pList); > flowName = pList.get(PR_FLOW_NAME).getString(); >+ role = pList.get(PR_ROLE).getString(); // used for accessibility > } > > /** {@inheritDoc} */ >@@ -124,6 +126,7 @@ public class Flow extends FObj { > /** {@inheritDoc} */ > public void addStructureElements(StructureElement parent) { > StructureElement structure = createStructureElement(); >+ structure.setRole(role); > parent.addChild(structure); > super.addStructureElements(structure); > } >diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java >index 58e0378..29710a4 100644 >--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java >+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java >@@ -39,6 +39,7 @@ import org.apache.fop.fo.ValidationException; > public class PageSequence extends AbstractPageSequence { > > // The value of properties relevant for fo:page-sequence. >+ private String role; // used for accessibility > private String country; > private String language; > private String masterReference; >@@ -88,6 +89,7 @@ public class PageSequence extends AbstractPageSequence { > /** {@inheritDoc} */ > public void bind(PropertyList pList) throws FOPException { > super.bind(pList); >+ role = pList.get(PR_ROLE).getString(); // used for accessibility > country = pList.get(PR_COUNTRY).getString(); > language = pList.get(PR_LANGUAGE).getString(); > masterReference = pList.get(PR_MASTER_REFERENCE).getString(); >@@ -124,6 +126,7 @@ public class PageSequence extends AbstractPageSequence { > } > if (getUserAgent().isAccessibilityEnabled()) { > structTree = createStructureElement(); >+ structTree.setRole(role); > for(int i=0;i<flowList.size();i++) > flowList.get(i).addStructureElements(structTree); > if (mainFlow != null) >diff --git a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java >index 6aaabb6..80e1596 100644 >--- a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java >+++ b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java >@@ -131,7 +131,7 @@ class PDFLogicalStructureHandler { > void processStructureTree(StructureElement structureTree, Locale language) { > pdfDoc.enforceLanguageOnRoot(); > PDFStructElem structElemPart = pdfDoc.getFactory().makeStructureElement( >- FOToPDFRoleMap.mapFormattingObject("page-sequence", rootStructureElement), >+ FOToPDFRoleMap.mapFormattingObject(structureTree, rootStructureElement, eventBroadcaster), > rootStructureElement); > rootStructureElement.addKid(structElemPart); > if (language != null) { >-- >1.6.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 50852
:
26701
|
26702
|
26703
|
26704
|
26705
|
26706
|
26707
|
26708
|
26709
|
26710
|
26711
|
26712
|
26713
|
26714
|
26715
|
26716
|
26717
|
26718
|
26719
|
26720
|
27171
|
28824
|
28825
|
28826