Hi lijian,
I'm back from vacation :-/
and will try to answer your questions...

lijian wrote:
Hi Mathias,

I found an undo problem when the header or footer is changed.
For example:
First, I do some operations on a document(now there is no header or footer) 
when the UNDO button is lighted;
Second, I insert the header or footer to the document. Then, the UNDO and REDO button is grey and I can't undo any of the operations before.
I think this is unreasonable.

I found the codes in sw/source/core/doc/docdesc.cxx like this:

// #i46909# no undo if header or footer changed
if( bHeaderFooterChanged )
    {
        ClearRedo();
        DelAllUndoObj();
    }

This is to make undo and redo grey if header or footer is changed.
The codes above is to solve issue 46909. After tracking on issuezilla, I found 
there are a few crash problems with undo of
header and footer before, so engineers of the community accepted this solution 
for the moment ?
Yes, this was the solution for the crashes. In OOo1.x inserting/deleting header/footer results in an empty undo stack. So I stepped back to the old unsatisfying situation to avoid at least the crashes.

So, that means we should just remove all the undo operations when header or 
footer is changed ?
Should it be this ?
Yes and no, at the moment it's better to lose undo operations than to crash. But of course the best would be to allow undo and do not crash.

I need your help.Thank you!
[..]
Here some more info about this nasty situation:
Our undo uses indices into the SwDoc's SwNodes array. So it relies on the fact that the SwNodes array is in the same state when the undo operation will recorded and when the undo operation will performed. Unfortunately the header/footer content is stored in the SwNodes-array. An insertion of a header makes the indices into SwNodes unusable (for the moment). The real problem is that the undo operation of this insertion does _not_ remove the content nodes again, so after the undo of the header insertion all former undo operation will not work or crash! The reason why this content is not removed has something to do with the way the header/footer attributes are organized (they contain e.g. a SwNodeIndex into the SwNodes array!). This has to be changed to allow a proper undo for header/footer actions.

Kind regards
        Andreas

--
Andreas Martens (ama) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to