diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-05-08 23:43:56 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-05-09 11:57:03 +0200 |
commit | abb0549dd1744a35b0464faac55999b0d5968212 (patch) | |
tree | 6f2d2a014dd45905a2dec9bd165330362f2cce70 | |
parent | e754e43662523b0d2504beb0d4875e3c10ecf6a2 (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
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/uibase/utlui/unotools.cxx | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 7b601c865c4c..eb62fcf6d5f2 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -718,10 +718,11 @@ 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; - if (bCalledFromShell && pAnchorNode && !lcl_IsItemSet(*pNewTxtNd, RES_PARATR_ADJUST) && + if (bCalledFromShell && !lcl_IsItemSet(*pNewTxtNd, RES_PARATR_ADJUST) && SFX_ITEM_SET == pAnchorNode->GetSwAttrSet(). GetItemState(RES_PARATR_ADJUST, true, &pItem)) { diff --git a/sw/source/core/uibase/utlui/unotools.cxx b/sw/source/core/uibase/utlui/unotools.cxx index 795ff23454a3..363017fd7fc2 100644 --- a/sw/source/core/uibase/utlui/unotools.cxx +++ b/sw/source/core/uibase/utlui/unotools.cxx @@ -416,7 +416,10 @@ void SwOneExampleFrame::ClearDocument( bool bStartUpdateTimer ) SwEditShell* pSh = pDoc->GetEditShell(); pSh->LockPaint(); pSh->StartAllAction(); + pSh->KillPams(); + pSh->ClearMark(); pDoc->ClearDoc(); + pSh->ClearUpCrsrs(); if( aLoadedTimer.IsActive() || !bStartUpdateTimer ) { |