[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/source

Luboš Luňák l.lunak at collabora.com
Thu Dec 11 05:12:38 PST 2014


 sw/source/core/undo/undobj.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 759658efd1c68fe919d33528497ecb6725343057
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Mon Dec 1 12:58:47 2014 +0100

    do not save UNO marks in undo history
    
    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).
    
    Change-Id: Id707dc3d2b888b5c96a974d04a0ef17b22fc024c

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index f552dc9..afa472c 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -784,10 +784,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() ) )


More information about the Libreoffice-commits mailing list