ASF Bugzilla – Attachment 26706 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 06/20
0006-Store-new-structure-tree-in-area-tree.patch (text/plain), 3.84 KB, created by
Martin K
on 2011-03-02 07:00:38 UTC
(
hide
)
Description:
Patch 06/20
Filename:
MIME Type:
Creator:
Martin K
Created:
2011-03-02 07:00:38 UTC
Size:
3.84 KB
patch
obsolete
>Subject: [PATCH 06/20] Store new structure tree in area tree > >--- > .../org/apache/fop/fo/pagination/PageSequence.java | 22 +++++++++++++++++++- > .../fop/layoutmgr/PageSequenceLayoutManager.java | 1 + > 2 files changed, 22 insertions(+), 1 deletions(-) > >diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java >index a22894e..58e0378 100644 >--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java >+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java >@@ -20,10 +20,13 @@ > package org.apache.fop.fo.pagination; > > // Java >+import java.util.Iterator; >+import java.util.List; > import java.util.Map; > > import org.xml.sax.Locator; > >+import org.apache.fop.accessibility.StructureElement; > import org.apache.fop.apps.FOPException; > import org.apache.fop.fo.FONode; > import org.apache.fop.fo.PropertyList; >@@ -49,6 +52,8 @@ public class PageSequence extends AbstractPageSequence { > > /** Map of flows to their flow name (flow-name, Flow) */ > private Map<String, Flow> flowMap; >+ private List<Flow> flowList; >+ private StructureElement structTree; > > /** > * The currentSimplePageMaster is either the page master for the >@@ -97,6 +102,7 @@ public class PageSequence extends AbstractPageSequence { > protected void startOfNode() throws FOPException { > super.startOfNode(); > flowMap = new java.util.HashMap<String, Flow>(); >+ flowList = new java.util.ArrayList<Flow>(); > > this.simplePageMaster > = getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference); >@@ -116,7 +122,13 @@ public class PageSequence extends AbstractPageSequence { > if (mainFlow == null) { > missingChildElementError("(title?,static-content*,flow)"); > } >- >+ if (getUserAgent().isAccessibilityEnabled()) { >+ structTree = createStructureElement(); >+ for(int i=0;i<flowList.size();i++) >+ flowList.get(i).addStructureElements(structTree); >+ if (mainFlow != null) >+ mainFlow.addStructureElements(structTree); >+ } > getFOEventHandler().endPageSequence(this); > } > >@@ -168,6 +180,7 @@ public class PageSequence extends AbstractPageSequence { > case FO_STATIC_CONTENT: > addFlow((StaticContent)child); > flowMap.put(((Flow)child).getFlowName(), (Flow)child); >+ flowList.add((Flow)child); > break; > default: > super.addChildNode(child); >@@ -328,12 +341,19 @@ public class PageSequence extends AbstractPageSequence { > return this.language; > } > >+ /** {@inheritDoc} */ >+ public StructureElement getStructureTree() { >+ return structTree; >+ } >+ > /** > * Releases a page-sequence's children after the page-sequence has been fully processed. > */ > public void releasePageSequence() { > this.mainFlow = null; > this.flowMap.clear(); >+ this.flowList.clear(); >+ this.structTree = null; > } > > } >diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java >index 40dbfb7..7813464 100644 >--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java >+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java >@@ -95,6 +95,7 @@ public class PageSequenceLayoutManager extends AbstractPageSequenceLayoutManager > transferExtensions(pageSequenceAreaObject); > pageSequenceAreaObject.setLanguage(getPageSequence().getLanguage()); > pageSequenceAreaObject.setCountry(getPageSequence().getCountry()); >+ pageSequenceAreaObject.setStructureTree(getPageSequence().getStructureTree()); > areaTreeModel.startPageSequence(pageSequenceAreaObject); > if (log.isDebugEnabled()) { > log.debug("Starting layout"); >-- >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