diff options
author | Glenn Adams <gadams@apache.org> | 2012-04-25 13:54:22 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2012-04-25 13:54:22 +0000 |
commit | c3bc9e8b04ee93dc3e3cc421ee7b52861b04dc16 (patch) | |
tree | 211ba768a6d3f9681b5bc44566b527039099cb51 /src/java/org/apache/fop | |
parent | 6d5a9a834dd6f884ad72511acf5cd883343b8782 (diff) | |
download | xmlgraphics-fop-c3bc9e8b04ee93dc3e3cc421ee7b52861b04dc16.tar.gz xmlgraphics-fop-c3bc9e8b04ee93dc3e3cc421ee7b52861b04dc16.zip |
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
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java | 7 |
1 files changed, 6 insertions, 1 deletions
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; /** * <p>Models a section in an RTF document</p> @@ -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 { |