]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #51484: Don't write final /sect suffix in RTF if section is last section.
authorGlenn Adams <gadams@apache.org>
Wed, 25 Apr 2012 13:54:22 +0000 (13:54 +0000)
committerGlenn Adams <gadams@apache.org>
Wed, 25 Apr 2012 13:54:22 +0000 (13:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1330296 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java
status.xml

index e85da98af77c60dd32940273057e3eed3ecf456d..424ad2215e933cec10d36ff3ce56ca9770024f05 100644 (file)
@@ -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 {
index 4b68a6494e9df5e98610b064cabd56c247dabaae..acfc01b73a958e077dc7c5c03351d716423d6b4b 100644 (file)
@@ -63,6 +63,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Fonts" dev="GA" type="fix" fixes-bug="51484" due-to="Benjamin Riefenstahl">
+        Don't write final /sect suffix in RTF if section is last section.
+      </action>
       <action context="Fonts" dev="GA" type="fix" fixes-bug="53143">
         Ensure fonts are not loaded twice (redundantly).
       </action>