<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/104098/">http://git.reviewboard.kde.org/r/104098/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On February 27th, 2012, 5:44 p.m., <b>C. Boemann</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">on closer thought i don't think we can ever get this right. The problem is that we don't have access to the position before first. When the command is created the cursor has alredy been moved.
neverthenless i'l mention that redo shold not restore the original position but the position before undo. (because of the above probelm this is actually correct in your code but hardly intentional)</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Okay. I'll actually close the review for now since (as always) school work has come in the way. But you're right in that this needs more thinking. So hopefully we can come up with a proper solution in the future. It's not a release blocker after all.</pre>
<br />
<p>- Elvis</p>
<br />
<p>On February 27th, 2012, 5:03 p.m., Elvis Stansvik wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Calligra, Pierre Stirnweiss and C. Boemann.</div>
<div>By Elvis Stansvik.</div>
<p style="color: grey;"><i>Updated Feb. 27, 2012, 5:03 p.m.</i></p>
<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;">An unfortunate effect of calling QTextDocument::undo/redo is that it will move the cursor to where the change happened, but not the selection (anchor).
This patch makes sure that on construction of a UndoTextCommand, the current cursor and anchor positions are saved. They are then restored after the calls to QTextDocument::undo/redo. The effect is the same behavior as in LO Writer.</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;">Tested repeatedly making different words bold, then undoing and redoing the operations. The selection is maintained.</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_undo.cpp <span style="color: grey">(912540b)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/104098/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>