You either call KoTextEditor->beginEditBlock before doing all the operations (ie, before deleting the shape and the anchor), and call textEditor->endEditBlock(), or alternatively you create a KUndo2Command and call KoTextEditor->addCommand(yourCommand). I think the second method is better as it allows you to specify the name of the command appearing in the undo stack. (check in the textTool/commands for some examples.
PierreSt On Thu, Jan 5, 2012 at 4:27 AM, Thorsten Zachmann <t.zachm...@zagge.de>wrote: > On Wednesday, January 04, 2012 11:55:14 Boudewijn Rempt wrote: > > On Thursday 15 December 2011 Dec, Boudewijn Rempt wrote: > > > It turns out that currently, only the rdf system keeps the actual id > > > strings after loading is finished, the other parts of calligra only > > > use the id strings to build their mappings during loading, and > > > recreate them during saving. > > > > Turns out that this isn't correct. The changetracking system also keeps a > > map, so I'll have to create the a class that keeps the map, can update > > items and a listener interface that can be used to make sure all > > dependent objects are informed when the xml-id is regenerated during a > > save operation. > > > > This should in all likelihood improve the rdf code as well. > > Can you please point me to the place where you see this. > > The only place where I found it is the KoGenChanges. If that is the place > you > talk about then it is not needed to have a mapping as that is only used on > saving. > > Thorsten > _______________________________________________ > calligra-devel mailing list > calligra-devel@kde.org > https://mail.kde.org/mailman/listinfo/calligra-devel >
_______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel