]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Reverted changes to PDFStructureTreeBuilder from rev. 1537600
authorVincent Hennebert <vhennebert@apache.org>
Tue, 5 Nov 2013 13:15:21 +0000 (13:15 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 5 Nov 2013 13:15:21 +0000 (13:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1538984 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java

index 3cc7a1017934b9f3c53780e71d8a142a73d127ba..985974b804dd3ad664e22d929e0bb41648f3db2e 100644 (file)
@@ -358,12 +358,8 @@ class PDFStructureTreeBuilder implements StructureTreeEventHandler {
     }
 
     public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
-        PDFStructElem parentElem;
-        if ((parent != null) && (parent instanceof PDFStructElem)) {
-            parentElem = (PDFStructElem) parent;
-        } else {
-            parentElem = ancestors.getFirst();
-        }
+        assert parent == null || parent instanceof PDFStructElem;
+        PDFStructElem parentElem = parent == null ? ancestors.getFirst() : (PDFStructElem) parent;
         PDFStructElem structElem = createStructureElement(name, parentElem, attributes,
                 pdfFactory, eventBroadcaster);
         ancestors.addFirst(structElem);