Review Request: Maintain text selection through undo/redo

Elvis Stansvik elvstone at gmail.com
Mon Feb 27 17:03:49 GMT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104098/
-----------------------------------------------------------

Review request for Calligra, Pierre Stirnweiss and C. Boemann.


Description
-------

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.


Diffs
-----

  libs/kotext/KoTextEditor_undo.cpp 912540b 

Diff: http://git.reviewboard.kde.org/r/104098/diff/


Testing
-------

Tested repeatedly making different words bold, then undoing and redoing the operations. The selection is maintained.


Thanks,

Elvis Stansvik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20120227/7fb12bd1/attachment.htm>


More information about the calligra-devel mailing list