Indeed, the change tracking system needs to know about it. And secondly, if you remove a character from the QTextDocument, Qt will create an undo/redo command internally. If you do not have a corresponding  command on your application undoStack, you'll be out of sync with QTextDocument internal undoStack.<div>

This is the reason the current show/hide changes create an undo/redo action (because they add/remove the text from the QTextDocument).</div><div><br></div><div>PierreSt<br><div><br><br><div class="gmail_quote">On Wed, Jan 4, 2012 at 9:34 AM, Boudewijn Rempt <span dir="ltr"><<a href="mailto:boud@valdyas.org">boud@valdyas.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wednesday 04 January 2012 Jan, Thorsten Zachmann wrote:<br>
<br>
> When there is a anchor belonging to the shape, it also removes the anchor from<br>
> the document. This is done by circumventing the command generation of<br>
> KoTextEditor. I do this because there should be no additional commands<br>
> generated besides the DeleteShapeCommand. As the data to recovering the<br>
> deletion is stored in the application data it is not needed that a undo<br>
> command for the actual removal of the anchor is created.<br>
<br>
</div>Well, in my kotext-inlinecommand-rempt I was close to solving the same bug, but the other way around: I put the creation of the command in KoTextEditor instead because the change tracking mechanism needs to know about it. Also, anchors aren't only created in the addFrameSet method, afaik.<br>


<span class="HOEnZb"><font color="#888888"><br>
--<br>
Boudewijn Rempt<br>
<a href="http://www.valdyas.org" target="_blank">http://www.valdyas.org</a>, <a href="http://www.krita.org" target="_blank">http://www.krita.org</a>, <a href="http://www.boudewijnrempt.nl" target="_blank">http://www.boudewijnrempt.nl</a><br>


_______________________________________________<br>
calligra-devel mailing list<br>
<a href="mailto:calligra-devel@kde.org">calligra-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/calligra-devel" target="_blank">https://mail.kde.org/mailman/listinfo/calligra-devel</a><br>
</font></span></blockquote></div><br></div></div>