From: Vincent Hennebert Date: Tue, 5 Nov 2013 13:15:21 +0000 (+0000) Subject: Reverted changes to PDFStructureTreeBuilder from rev. 1537600 X-Git-Tag: fop-2_0~163 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa1cca233c52222efbfee2a8e406df7c70daa1ac;p=xmlgraphics-fop.git Reverted changes to PDFStructureTreeBuilder from rev. 1537600 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1538984 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java index 3cc7a1017..985974b80 100644 --- a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java +++ b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java @@ -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);