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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Mon Nov 13 12:06:16 UTC 2017


 editeng/source/editeng/editview.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 9a1ffec3207a0e4282d8033a657690363762b9fe
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Fri Nov 10 11:06:46 2017 +0100

    tdf#113591 Fix crash when switching between Calc and other LO window
    
    Need to get the ContentNode from EditDoc, as the selection might
    have a pointer to an already deleted ContentNode.
    
    Reviewed-on: https://gerrit.libreoffice.org/44583
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit e4d1551697406bab0e9973bfa8ac012c48ff8eea)
    
    Conflicts:
            editeng/source/editeng/editview.cxx
    
    Change-Id: I5c17be8ec2cbc57686eaf90e8b03c026aea7f28f
    Reviewed-on: https://gerrit.libreoffice.org/44616
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index f44d432db3ae..c8c9de850b39 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -220,11 +220,14 @@ bool EditView::IsReadOnly() const
 
 void EditView::SetSelection( const ESelection& rESel )
 {
-    // If someone has just left an empty attribute, and then the outliner
-    // manipulates the selection:
+    // If someone has just left an empty attribute, and then the
+    // outliner manipulates the selection, call the CursorMoved method
+    // so that empty attributes get cleaned up.
     if ( !pImpEditView->GetEditSelection().HasRange() )
     {
-        ContentNode* pNode = pImpEditView->GetEditSelection().Max().GetNode();
+        // tdf#113591 Get node from EditDoc, as the selection might
+        // have a pointer to an already deleted node.
+        ContentNode* pNode = pImpEditView->pEditEngine->GetEditDoc().GetEndPaM().GetNode();
         pImpEditView->pEditEngine->CursorMoved( pNode );
     }
     EditSelection aNewSelection( pImpEditView->pEditEngine->pImpEditEngine->ConvertSelection(


More information about the Libreoffice-commits mailing list