summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-12-01 12:58:47 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-12-10 14:14:53 +0100
commitf3b8775050fea0b0242b94b947672cf3e5ba3f5d (patch)
tree452aa84d49ea0cb493e4646cb4690dc6af95cecf
parent9b52ce7d88ae613927f33816e4f994d21dc4ded8 (diff)
do not save UNO marks in undo historyprivate/llunak/mailmerge_03
These are usually very short-lived marks that are used for various internal purposes or by UNO interfaces, so restoring them from undo history does not make any sense. It can in fact lead to a crash on undo if the mark has been already deleted (which is usually the case with UNO marks) but the restoring still refers to it (this is not a problem with other mark types since those should be deleted only when they are no longer in the document, in which case they are saved in undo history by content positions rather than mark references). (cherry picked from commit 1ecf9ed3fc33c984890848eacbecad5e009eb33d) Conflicts: sw/source/core/undo/undobj.cxx Change-Id: Id707dc3d2b888b5c96a974d04a0ef17b22fc024c
-rw-r--r--sw/source/core/undo/undobj.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 30a86778525f..0442c54b8b12 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -772,10 +772,12 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
if( bSavePos || bSaveOtherPos )
{
- if( !pHistory )
- pHistory = new SwHistory;
-
- pHistory->Add( *pBkmk, bSavePos, bSaveOtherPos );
+ if( IDocumentMarkAccess::GetType(*pBkmk) != IDocumentMarkAccess::UNO_BOOKMARK )
+ {
+ if( !pHistory )
+ pHistory = new SwHistory;
+ pHistory->Add( *pBkmk, bSavePos, bSaveOtherPos );
+ }
if(bSavePos &&
(bSaveOtherPos || !pBkmk->IsExpanded()))
{