DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=28706>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28706 [PATCH] More justification problems Summary: [PATCH] More justification problems Product: Fop Version: 1.0dev Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: page-master/layout AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Simon Pepping comments copied from bug 28314: 1. The patch introduces a trailing space in some cases. This can be seen in the area tree dump, in the second block in your test FO file. This problem can be remedied by adding an else branch, which removes all BPs after prevBP from vecInlineBreaks if we do not reset. 2. The disappearance of the word 'spaces' is due to the fact that in this case bp has not yet been added to vecInlineBreaks, so that prevCouldEndLine is applied on prevBP only, in which case it returns true immediately. We want it to return false in this case so that reset is called and bp is not silently dropped. The problem can be remedied by testing against this condition before checking for suppressibility. I prefer that above your adding bp to vecInlineBreaks, of which the side effects in other cases are unknown. prevCouldEndLine could then be written as: private boolean prevCouldEndLine(BreakPoss prev) { if (!isFinished()) { return false; } if (vecInlineBreaks.get(vecInlineBreaks.size() - 1) == prev) { return false; } return allAreSuppressible(prev); } My attached patch does the above. It also does away with prevCouldEndLine by inserting all the conditions directly in the code and reusing allAreSuppressible. Simon