<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/120250/">https://git.reviewboard.kde.org/r/120250/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So in general I guess it's nice to have an enum as return, but in fact it is not nessesary</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The two forms of PAGEBREAK are also not worthy of destinction.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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 <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">at_all</em></p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The hard pagebreaks are handled outside layoutBlock and those overrule any kind of backtracking</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The real fix however is to fix the backtrack to not backtrack at all if it means removing everything on the page.</p></pre>
 <br />









<p>- Camilla Boemann</p>


<br />
<p>On September 17th, 2014, 8:09 p.m. UTC, Pierre Ducroquet wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Calligra.</div>
<div>By Pierre Ducroquet.</div>


<p style="color: grey;"><i>Updated Sept. 17, 2014, 8:09 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=306000">306000</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
calligra
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Returns an enum instead of a boolean and relying on an integer value aside.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
This allows the backtrack code to know that a layout ended because of a page break,<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
and thus not follow the keep with next instead of ending up in an infinite loop.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Checked with the document from bug report 306000 : layouting the document now works and does not end up in an infinite loop.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>libs/textlayout/KoTextLayoutArea.h <span style="color: grey">(7a15191e5a3dfb05a3e62ae7b9aaadabcceeb1fb)</span></li>

 <li>libs/textlayout/KoTextLayoutArea.cpp <span style="color: grey">(c74dbd490bf5c48386383f5d622722dfa8b5f7cc)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/120250/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>








  </div>
 </body>
</html>