Review Request 120250: Change blockLayout return to be more explicit

Camilla Boemann cbr at boemann.dk
Thu Sep 18 09:22:40 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120250/#review66808
-----------------------------------------------------------


So in general I guess it's nice to have an enum as return, but in fact it is not nessesary

The DONTFIT and PAGEBREAK should be treated as one and the same - PAGEBREAK is not a hard break, but rather a hint (aka soft break)

The two forms of PAGEBREAK are also not worthy of destinction.

I have tested with MS Word and in both cases we should backtrack and only if it is completely impossible to adhere to the keep_with_next should we not backtrack but in that case we shouldn't backtrack _at_all_

The hard pagebreaks are handled outside layoutBlock and those overrule any kind of backtracking

So while I don't disagree with an enum as such right now it should only have two possible values: OK and DONTFIT (which makes it kind of pointless right now but I am not going prevent it if you want it more than the bool)

The real fix however is to fix the backtrack to not backtrack at all if it means removing everything on the page.

- Camilla Boemann


On Sept. 17, 2014, 8:09 p.m., Pierre Ducroquet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120250/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2014, 8:09 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Bugs: 306000
>     http://bugs.kde.org/show_bug.cgi?id=306000
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> Returns an enum instead of a boolean and relying on an integer value aside.
> This allows the backtrack code to know that a layout ended because of a page break,
> and thus not follow the keep with next instead of ending up in an infinite loop.
> 
> With that patch, we still have a difference between us and LibreOffice 4.3, a check of the OpenDocument specification will perhaps help : they decide to just skip the page break when it is in a keep with next block.
> 
> 
> Diffs
> -----
> 
>   libs/textlayout/KoTextLayoutArea.h 7a15191e5a3dfb05a3e62ae7b9aaadabcceeb1fb 
>   libs/textlayout/KoTextLayoutArea.cpp c74dbd490bf5c48386383f5d622722dfa8b5f7cc 
> 
> Diff: https://git.reviewboard.kde.org/r/120250/diff/
> 
> 
> Testing
> -------
> 
> Checked with the document from bug report 306000 : layouting the document now works and does not end up in an infinite loop.
> 
> 
> Thanks,
> 
> Pierre Ducroquet
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20140918/df0d3349/attachment.htm>


More information about the calligra-devel mailing list