diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-11-10 11:06:46 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-11 23:18:09 +0100 |
commit | 90d3529629d2bf7313d3397c8d36d220712602ff (patch) | |
tree | 727c245fa7154833ff21e82f563a6290ce16e89d | |
parent | e399696bd0b996bee572b9dc6bc56b04b34dc777 (diff) |
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@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit e4d1551697406bab0e9973bfa8ac012c48ff8eea)
Conflicts:
editeng/source/editeng/editview.cxx
Change-Id: I5c17be8ec2cbc57686eaf90e8b03c026aea7f28f
-rw-r--r-- | editeng/source/editeng/editview.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 108a0875886d..9f14da4b02bd 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -232,11 +232,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() ) { - const ContentNode* pNode = pImpEditView->GetEditSelection().Max().GetNode(); + // tdf#113591 Get node from EditDoc, as the selection might + // have a pointer to an already deleted node. + const ContentNode* pNode = pImpEditView->pEditEngine->GetEditDoc().GetEndPaM().GetNode(); pImpEditView->pEditEngine->CursorMoved( pNode ); } EditSelection aNewSelection( pImpEditView->pEditEngine->pImpEditEngine->ConvertSelection( |