c3f51c2
From 385694f1e65c1cb8195d39d50c78ea083430b63b Mon Sep 17 00:00:00 2001
c3f51c2
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
c3f51c2
Date: Thu, 15 Jan 2015 14:43:27 +0000
c3f51c2
Subject: [PATCH] Resolves: rhbz#1162352 SwDataChanged dtor accesses deleted
c3f51c2
 PaM
c3f51c2
c3f51c2
an old bug that I finally hit on by typing one paragraph
c3f51c2
of three lines consisting of repeated "Apple " and the cursor
c3f51c2
at position 0 and click the bullet icon
c3f51c2
c3f51c2
(cherry picked from commit 3cb3396e4a4b36e5a05892da16b076feaef6b2b1)
c3f51c2
c3f51c2
Conflicts:
c3f51c2
	sw/source/core/doc/docfmt.cxx
c3f51c2
c3f51c2
Change-Id: I90e998561f2645ebfa51423bcaab9a4195144338
c3f51c2
---
c3f51c2
 sw/source/core/doc/docfmt.cxx | 10 ++++++----
c3f51c2
 1 file changed, 6 insertions(+), 4 deletions(-)
c3f51c2
c3f51c2
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
c3f51c2
index 18e5137..8aa95d4 100644
c3f51c2
--- a/sw/source/core/doc/docfmt.cxx
c3f51c2
+++ b/sw/source/core/doc/docfmt.cxx
c3f51c2
@@ -363,10 +363,10 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
c3f51c2
     }
c3f51c2
 
c3f51c2
     // #i96644#
c3f51c2
-    boost::scoped_ptr< SwDataChanged > pDataChanged;
c3f51c2
+    boost::scoped_ptr< SwDataChanged > xDataChanged;
c3f51c2
     if ( bSendDataChangedEvents )
c3f51c2
     {
c3f51c2
-        pDataChanged.reset( new SwDataChanged( *pPam ) );
c3f51c2
+        xDataChanged.reset( new SwDataChanged( *pPam ) );
c3f51c2
     }
c3f51c2
     SwHistory* pHst = 0;
c3f51c2
     if (GetIDocumentUndoRedo().DoesUndo())
c3f51c2
@@ -468,10 +468,12 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
c3f51c2
         GetNodes().ForEach( pStt->nNode, aTmpEnd, lcl_RstTxtAttr, &aPara );
c3f51c2
     }
c3f51c2
 
c3f51c2
+    SetModified();
c3f51c2
+
c3f51c2
+    xDataChanged.reset(); //before delete pPam
c3f51c2
+
c3f51c2
     if( pPam != &rRg )
c3f51c2
         delete pPam;
c3f51c2
-
c3f51c2
-    SetModified();
c3f51c2
 }
c3f51c2
 
c3f51c2
 #define DELETECHARSETS if ( bDelete ) { delete pCharSet; delete pOtherSet; }
c3f51c2
-- 
c3f51c2
1.9.3
c3f51c2