diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-05-08 23:43:56 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-09 10:22:52 +0000 |
commit | b5f4a53d6d718e170303ea3d9344f86735fb8c99 (patch) | |
tree | 01ddc8dac5d91a3a6436bd6afecc8bc14eacc670 | |
parent | 02172de1a9c1f4442514cc79583ecd0a46331f45 (diff) |
fdo#77720: Mail Merge: reset cursors after clearing document
The root cause for the crash is that the shell has an invalid cursor
that does not point at a paragraph; this is because first the document
is filled and the cursor is pointed at the content of a frame, then the
document is cleared from SwFrmCtrlWindow::Resize() [not sure why?] and
at that point the cursor remains on an SwEndNode (which is invalid).
Change-Id: I47c1e2a34d5579953c1896ff0895568978e72bc7
(cherry picked from commit abb0549dd1744a35b0464faac55999b0d5968212)
Reviewed-on: https://gerrit.libreoffice.org/9288
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/utlui/unotools.cxx | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 2ea2fb95d1fd..815a4d9c7a9a 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -717,6 +717,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, (SwNodeIndex( GetNodes().GetEndOfAutotext()), GetTxtCollFromPool( nCollId )); SwCntntNode * pAnchorNode = pAnchorPos->nNode.GetNode().GetCntntNode(); + assert(pAnchorNode); // pAnchorNode from cursor, must be valid const SfxPoolItem * pItem = NULL; diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index e25deec000cc..b5b36bade269 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -415,7 +415,10 @@ void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer ) SwEditShell* pSh = pDoc->GetEditShell(); pSh->LockPaint(); pSh->StartAllAction(); + pSh->KillPams(); + pSh->ClearMark(); pDoc->ClearDoc(); + pSh->ClearUpCrsrs(); if( aLoadedTimer.IsActive() || !bStartUpdateTimer ) { |