diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-12-19 23:53:11 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-12-20 14:11:44 +0100 |
commit | 72e3dd4d8ab6fe4368972a761c70185d1742855d (patch) | |
tree | ca3ff0d60ecd7138389a80c8a3a882f5fc997d3f /sw/inc/undobj.hxx | |
parent | 91a90acc033cfadb0cc7bf271fa9ea92c4c52e88 (diff) |
SwUndoInserts should not use a SwPosition:
There is a problem here; to see it paste something 3 times, then undo
twice and close the document, there is a SwIndexReg assertion because
the SwPosition in the one SwUndoInserts points to a node in the Undo
nodes array that is removed by the dtor of the other SwUndoInserts.
This is because the Undo objects are destroyed from the outermost Redo
backwards, which is usually a good idea but does not work for
SwUndoInserts, which (as they currently are) must be destroyed in the
other order.
But with the previous change to only store whole paragraphs in
SwUndoSaveCntnt it is possible to replace the SwPosition here with
a SwNodeIndex, which points directly to the SwTxtNode and thus does
not care if the position of that node changes due to whatever order
other SwUndoInserts are removed.
Change-Id: I4f0cf308d26f6b2e5aaa8997951c03ae7b2f0951
Diffstat (limited to 'sw/inc/undobj.hxx')
-rw-r--r-- | sw/inc/undobj.hxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 4fbd74ab96de..5148327a6b13 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -21,6 +21,7 @@ #include <vector> +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <svl/undo.hxx> @@ -230,7 +231,8 @@ class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt sal_Bool bSttWasTxtNd; protected: sal_uLong nNdDiff; - SwPosition *pPos; // Content for Redo. + /// start of Content in UndoNodes for Redo + ::boost::scoped_ptr<SwNodeIndex> m_pUndoNodeIndex; sal_uInt16 nSetPos; // Start in the history list. SwUndoInserts( SwUndoId nUndoId, const SwPaM& ); |