[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uncompress_solution() fix
From: |
Joe Neeman |
Subject: |
Re: uncompress_solution() fix |
Date: |
Mon, 21 May 2007 08:55:07 +1000 |
User-agent: |
KMail/1.9.5 |
On Monday 21 May 2007 08:26, Han-Wen Nienhuys wrote:
> Hi Joe,
>
> can you review my commit
>
> **
> commit e0bffa5a02d173f02a2f259eb2916d06c777d5f8
> Author: Han-Wen Nienhuys <address@hidden>
> Date: Sun May 20 19:24:09 2007 -0300
>
> Fix disappearing last page problem.
>
> - Add Page_breaking::uncompress_page_spacing_results().
> - Use on space_systems_on_n_.*() functions.
> **
>
> I'm not sure if I caught all the places where this happens. I think it
> would be best that all functions that do a compress_solution() run
> uncompress_solution() before returning the result.
The convention I (had intended to) adopt was that every non-private function
in Page_breaking calls finalize_spacing_result before returning a
Spacing_result. Of course I missed the else clause in
space_systems_on_n_or_one_more_pages as you have discovered. I think this
convention is easier than doing uncompress_solution everywhere because there
are only 3 non-private space_system_on_* functions and they need to call
finalize_spacing_result anyway to calculate the demerits.
So I would suggest not to do the uncompressing everywhere but instead to use
the attached patch (untested) to fix the problem. Something like it is needed
anyway because your patch still doesn't call finalize_spacing_result on
result from the else clause in space_systems_on_n_or_one_more_pages.
Thanks for fixing my bugs; I promise I'll do the documentation soon :)
tmp.patch
Description: Text Data