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

Michael Stahl mstahl at redhat.com
Fri Apr 3 00:25:53 PDT 2015


 sw/source/core/edit/eddel.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit d8d946210a39400e4fc0b83f186e6234ad364836
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Apr 2 22:32:59 2015 +0200

    tdf#87400: sw: fix ~SwIndexReg assertion in AutoCorrect
    
    SwAutoFormat::DoUnderline() calls DeleteSel() with a SwPaM that is not
    corrected, except if it's passed along directly to SwDoc methods.
    
    (regression from f9b62506b22c3eb885ffd5a4ec8025c33df7b2d4)
    
    Change-Id: I741e0391e7f8e09a64bcfe99ca4d650f1016aaa7
    (cherry picked from commit 41e4998cdeb54a6fc316f349de61296be820fe47)
    Reviewed-on: https://gerrit.libreoffice.org/15127
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 3e4f06d..8be74f3 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -90,14 +90,20 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
     }
     else
     {
-        SwPaM aPam(rPam);
+        std::unique_ptr<SwPaM> pNewPam;
+        SwPaM * pPam = &rPam;
         if (bSelectAll)
+        {
+            assert(dynamic_cast<SwShellCrsr*>(&rPam)); // must be corrected pam
+            pNewPam.reset(new SwPaM(rPam));
             // Selection starts at the first para of the first cell, but we
             // want to delete the table node before the first cell as well.
-            aPam.Start()->nNode = aPam.Start()->nNode.GetNode().FindTableNode()->GetIndex();
+            pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex();
+            pPam = pNewPam.get();
+        }
         // delete everything
-        GetDoc()->getIDocumentContentOperations().DeleteAndJoin( aPam );
-        SaveTblBoxCntnt( aPam.GetPoint() );
+        GetDoc()->getIDocumentContentOperations().DeleteAndJoin(*pPam);
+        SaveTblBoxCntnt( pPam->GetPoint() );
     }
 
     // Selection is not needed anymore


More information about the Libreoffice-commits mailing list