Re: Re: Attempt for an UNO Undo API

Mathias Bauer <[email protected]>
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
On 10/18/2010 05:16 PM, Malte Timmermann wrote:

> Or implementations w/o support for ref counting: For example, each
> EditEngine Undo action needs to have an EditEngine*.
> And EditEngines in OOo are destroyed and re-created quite frequently.

Maybe using an own Undo manager for the EditEngine is wrong. When we 
implemented Notes2, I finally ended up with letting the container 
(Writer) tracking the changes, I didn't create an additional undo 
manager for the note(s). That means, each time when an undo entry shall 
be created, the Writer just copies the content of the outliner object 
inside the note. For more complicated cases this could be improved by a 
better encapsulation of what needs to be copied by providing suitable 
methods in the Outliner class.

This way we got an Undo that is not prone to crashes and that doesn't 
depend on whether the user is editing the note or the text of the 
document. It also appeared that giving access to all entries of the undo 
stack while editing in a note doesn't create a problem if the 
implementation of the notes view is aware of sudden destruction 
(something that IMHO is necessary anyway).

I think that we could apply this idea to drawing objects also. For OLE 
objects OTOH this probably wouldn't help as copying the whole object 
each time it changes surely would be too much.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.