From c40d6029737141c4d86f3b6bde38ce444f8b3bb7 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Thu, 26 Apr 2012 13:18:53 +0000 Subject: [PATCH] Bugzilla #51484: Improve test for last section. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1330838 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 2074d3bab..150a46986 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 @@ -193,9 +193,9 @@ implements * @throws IOException for I/O problems */ protected void writeRtfSuffix() throws IOException { - 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() ) { + List siblings = parent.getChildren(); + if ( ( siblings.indexOf ( this ) + 1 ) < siblings.size() ) { writeControlWord("sect"); } } -- 2.39.5