Blame SOURCES/0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch

ebc4bd
From f752aa8de421ab6ee296370b4c287354fc2ba06c Mon Sep 17 00:00:00 2001
ebc4bd
From: Michael Stahl <mstahl@redhat.com>
ebc4bd
Date: Thu, 2 Apr 2015 22:32:59 +0200
ebc4bd
Subject: [PATCH 1/4] tdf#87400: sw: fix ~SwIndexReg assertion in AutoCorrect
ebc4bd
MIME-Version: 1.0
ebc4bd
Content-Type: text/plain; charset=UTF-8
ebc4bd
Content-Transfer-Encoding: 8bit
ebc4bd
ebc4bd
SwAutoFormat::DoUnderline() calls DeleteSel() with a SwPaM that is not
ebc4bd
corrected, except if it's passed along directly to SwDoc methods.
ebc4bd
ebc4bd
(regression from f9b62506b22c3eb885ffd5a4ec8025c33df7b2d4)
ebc4bd
ebc4bd
(cherry picked from commit 41e4998cdeb54a6fc316f349de61296be820fe47)
ebc4bd
Reviewed-on: https://gerrit.libreoffice.org/15127
ebc4bd
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
ebc4bd
Tested-by: Caolán McNamara <caolanm@redhat.com>
ebc4bd
(cherry picked from commit d8d946210a39400e4fc0b83f186e6234ad364836)
ebc4bd
ebc4bd
Conflicts:
ebc4bd
	sw/source/core/edit/eddel.cxx
ebc4bd
ebc4bd
Change-Id: I741e0391e7f8e09a64bcfe99ca4d650f1016aaa7
ebc4bd
---
ebc4bd
 sw/source/core/edit/eddel.cxx | 14 ++++++++++----
ebc4bd
 1 file changed, 10 insertions(+), 4 deletions(-)
ebc4bd
ebc4bd
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
ebc4bd
index 47614f2c..fad1eaf 100644
ebc4bd
--- a/sw/source/core/edit/eddel.cxx
ebc4bd
+++ b/sw/source/core/edit/eddel.cxx
ebc4bd
@@ -89,14 +89,20 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
ebc4bd
     }
ebc4bd
     else
ebc4bd
     {
ebc4bd
-        SwPaM aPam(rPam);
ebc4bd
+        std::unique_ptr<SwPaM> pNewPam;
ebc4bd
+        SwPaM * pPam = &rPam;
ebc4bd
         if (bSelectAll)
ebc4bd
+        {
ebc4bd
+            assert(dynamic_cast<SwShellCrsr*>(&rPam)); // must be corrected pam
ebc4bd
+            pNewPam.reset(new SwPaM(rPam));
ebc4bd
             // Selection starts at the first para of the first cell, but we
ebc4bd
             // want to delete the table node before the first cell as well.
ebc4bd
-            aPam.Start()->nNode = aPam.Start()->nNode.GetNode().FindTableNode()->GetIndex();
ebc4bd
+            pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex();
ebc4bd
+            pPam = pNewPam.get();
ebc4bd
+        }
ebc4bd
         // delete everything
ebc4bd
-        GetDoc()->DeleteAndJoin( aPam );
ebc4bd
-        SaveTblBoxCntnt( aPam.GetPoint() );
ebc4bd
+        GetDoc()->DeleteAndJoin( *pPam );
ebc4bd
+        SaveTblBoxCntnt( pPam->GetPoint() );
ebc4bd
     }
ebc4bd
 
ebc4bd
     // Selection is not needed anymore
ebc4bd
-- 
ebc4bd
2.1.0
ebc4bd