Hi, all:

Now I am working on a bugzilla issue 121897, which seems a writer undo/redo
corresponding issue. Inside there are some questions I met, which may need
help from the experts.

Here is background:

There are some refine work in SW undo/redo mechanism for integrating into
the SfxUndoManager framework. Inside the implementation,
SwUndoInserts::UndoImpl, which is the detailed undo method for inserting,
will drop all the hints inside the current SwTxtNode, and then retrieve
them back via the SwHistory::TmpRollback. Similar design also exist in
SwUndoDelete::UndoImpl (Similarly the detailed undo method for deleting),
but for some unknown reason (is there do exist some), the using hints clear
methods are different inside above 2 undo functions. For SwUndoInserts,
the SwTxtNode::RstAttr is used, and for SwUndoDelete,
the SwTxtNode::ClearSwpHintsArr is used. In general, the difference of said
2 hints clearing method is that, RstAttr will ignore the tox mark index and
ClearSwpHintsArr will ignore the fly content when clearing hints.

And such difference makes the phenomenon of i121897 happens: the former tox
mark index is kept when clearing and a new one inserted later from
SwHistory;

So my questions are:

1. Why the undo of inserting use a different clear method from the undo of
deleting? Should we make them identical or, refine the RstAttr for certain
usage in undo inserting?
2. As we see, the whole hints inside the text node will be cleared, even if
the actions should be undone are related to part of the text node. At it is
not a good performance design. Is there any certain reason for doing like
that?

Thanks for your help!

Reply via email to