[Libreoffice-commits] core.git: Branch 'libreoffice-4-4-0' - sw/source

Caolán McNamara caolanm at redhat.com
Mon Jan 19 10:18:35 PST 2015


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

New commits:
commit ff84b2f338b815d3f4c2465d0b60e57123de6d31
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 15 14:43:27 2015 +0000

    Resolves: rhbz#SwDataChanged dtor accesses deleted PaM
    
    an old bug that I finally hit on by typing one paragraph
    of three lines consisting of repeated "Apple " and the cursor
    at position 0 and click the bullet icon
    
    Change-Id: I90e998561f2645ebfa51423bcaab9a4195144338
    (cherry picked from commit 3cb3396e4a4b36e5a05892da16b076feaef6b2b1)
    Reviewed-on: https://gerrit.libreoffice.org/13931
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 3d9cbff..5a82a57 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -289,10 +289,10 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
     }
 
     // #i96644#
-    boost::scoped_ptr< SwDataChanged > pDataChanged;
+    boost::scoped_ptr< SwDataChanged > xDataChanged;
     if ( bSendDataChangedEvents )
     {
-        pDataChanged.reset( new SwDataChanged( *pPam ) );
+        xDataChanged.reset( new SwDataChanged( *pPam ) );
     }
     SwHistory* pHst = 0;
     if (GetIDocumentUndoRedo().DoesUndo())
@@ -394,10 +394,12 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
         GetNodes().ForEach( pStt->nNode, aTmpEnd, sw::DocumentContentOperationsManager::lcl_RstTxtAttr, &aPara );
     }
 
+    getIDocumentState().SetModified();
+
+    xDataChanged.reset(); //before delete pPam
+
     if( pPam != &rRg )
         delete pPam;
-
-    getIDocumentState().SetModified();
 }
 
 /// Set the rsid of the next nLen symbols of rRg to the current session number


More information about the Libreoffice-commits mailing list