public void writeContent ( final OutputStream result ) throws IOException { if ( ! this . inTable ) { result . write ( OPEN_GROUP ) ; } int itemNr = 0 ; if ( items != null ) { for ( int i = 0 ; i < items . size ( ) ; i ++ ) { RtfElement thisRtfElement = ( RtfElement ) items . get ( i ) ; //thisRtfElement.writeContent(result); if ( thisRtfElement instanceof RtfListItem ) { itemNr ++ ; RtfListItem rtfElement = ( RtfListItem ) thisRtfElement ; RtfListLevel listLevel = rtfElement . getParent ( ) ; if ( listLevel . getListLevel ( ) == 0 ) { correctIndentation ( ) ; } if ( i == 0 ) { listLevel . writeListBeginning ( result ) ; writeListNumbers ( result ) ; } writeListTextBlock ( result , itemNr , listLevel ) ; rtfElement . writeContent ( result ) ; if ( i < ( items . size ( ) - 1 ) || ! this . inTable || listLevel . getListType ( ) > 0 ) { // TODO Fix no paragraph on last list item in tables result . write ( RtfParagraph . PARAGRAPH ) ; } this . document . outputDebugLinebreak ( result ) ; } else if ( thisRtfElement instanceof RtfList ) { ( ( RtfList ) thisRtfElement ) . writeContent ( result ) ; // ((RtfList)thisRtfElement).writeListBeginning(result); writeListNumbers ( result ) ; this . document . outputDebugLinebreak ( result ) ; } } } if ( ! this . inTable ) { result . write ( CLOSE_GROUP ) ; } result . write ( RtfParagraph . PARAGRAPH_DEFAULTS ) ; }
Writes the content of the RtfList