<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/124641/">https://git.reviewboard.kde.org/r/124641/</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;">This rewrite fails as it doesn't check for cell1 == cell2 in which case it's not a complex selection</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">so it fails</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">please discard request</p></pre>
<br />
<p>- Camilla Boemann</p>
<br />
<p>On August 6th, 2015, 11:48 a.m. UTC, Soma Schliszka 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, Camilla Boemann and Thorsten Zachmann.</div>
<div>By Soma Schliszka.</div>
<p style="color: grey;"><i>Updated Aug. 6, 2015, 11:48 a.m.</i></p>
<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;">The KoTextEditor::recursivelyVisitSelection() function had a bit complex conditional expression when there is a table inside the selection.
This change is following the previous behaviour but the expression is built more logically. It isn't the shortest version, but it's much easier to understand and simpler to use.
There are several cases of selecting a table, and it's not trivial to say whether entire or just a part is selected.
* The process has been divided into two section: first, the conditional expression decides about the visiting mode (party or entirely), than just 'visit' the objects in order.
* I wasn't sure about why is it necessary to select the entire table in a different way? If the entire table is selected, than selectedTableCells() should do the same. That's why there is no different caret-selection-handling right before the visit.
* Other modification is the removed duplicate of cell-protection-check. If only one cell is selected, the loop still can operate, just runs only once.
* The patch contains many inline comments to cover all cases clearly.
*This patch is just a suggestion to make this snippet more cleaner.*</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;">Builded successfully, table works the same as before.</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/kotext/KoTextEditor.cpp <span style="color: grey">(392f682)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/124641/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>