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=28314>.
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=28314

[PATCH] Alignment of the last line in a justified block





------- Additional Comments From [EMAIL PROTECTED]  2004-04-29 19:01 -------
Luca,

This is a good patch, and Chris has already applied it. I have a few
remarks.

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

Reply via email to