From: Glenn Adams Date: Wed, 25 Apr 2012 13:54:22 +0000 (+0000) Subject: Bugzilla #51484: Don't write final /sect suffix in RTF if section is last section. X-Git-Tag: fop-1_1rc1old~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c3bc9e8b04ee93dc3e3cc421ee7b52861b04dc16;p=xmlgraphics-fop.git Bugzilla #51484: Don't write final /sect suffix in RTF if section is last section. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1330296 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java index e85da98af..424ad2215 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java @@ -28,6 +28,7 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; import java.io.IOException; import java.io.Writer; +import java.util.List; /** *

Models a section in an RTF document

@@ -192,7 +193,11 @@ implements * @throws IOException for I/O problems */ protected void writeRtfSuffix() throws IOException { - writeControlWord("sect"); + List siblings = parent.getChildren(); + // write suffix /sect only if this section is not last section (see bug #51484) + if ( siblings.listIterator ( siblings.indexOf ( this ) ) . hasNext() ) { + writeControlWord("sect"); + } } private void closeCurrentTable() throws IOException { diff --git a/status.xml b/status.xml index 4b68a6494..acfc01b73 100644 --- a/status.xml +++ b/status.xml @@ -63,6 +63,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Don't write final /sect suffix in RTF if section is last section. + Ensure fonts are not loaded twice (redundantly).