[ http://jira.codehaus.org/browse/DOXIA-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=168273#action_168273 ]
Dean Murphy commented on DOXIA-295: ----------------------------------- I am using a parser and calling parse() with the sink. I will double check the content to determine if it is xhtml compliant. I do agree with you to an extent that hiding this would probably not be beneficial. Would it be better to throw some type of exception versus death by a division by zero attempt? I will post soon regarding the content I'm trying to parse to conclude whether or not it is compliant. Thanks! > doxia-module-fo fails with a division by 0 error when using FoSink > ------------------------------------------------------------------ > > Key: DOXIA-295 > URL: http://jira.codehaus.org/browse/DOXIA-295 > Project: Maven Doxia > Issue Type: Bug > Components: Module - FO > Affects Versions: 1.2 > Environment: Linux / Solairs jdk 1.5 > Build from svn check out Revsion: 749805 > Reporter: Dean Murphy > > When using the FoSink to convert from documents containing a table, I am > running into a division by 0 error on line: 703 in > org.apache.maven.doxia.module.fo.FoSink.java: > int percent = 100 / cellCount; > for ( int i = 0; i < cellCount; i++ ) > { > sb.append( "<fo:table-column column-width=\"" + percent + > "%\"/>" ); > sb.append( EOL ); > } > Simple fix would be to check if cellCount != 0: > if ( cellCount != 0 ) { > int percent = 100 / cellCount; > for ( int i = 0; i < cellCount; i++ ) > { > sb.append( "<fo:table-column column-width=\"" + percent + > "%\"/>" ); > sb.append( EOL ); > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira