From 71a84b69ae30458a941f38869aa994118051a063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 24 Feb 2017 13:57:53 +0000 Subject: [PATCH] Resolves: tdf#106123 store and restore the PaM around the menu Execute because the loss of focus in the current editeng causes writer annotations to save their contents, making the pContent of the current EditMaps invalid Change-Id: Ic01379291fa66dd58246d33287b18801f5da49c0 --- editeng/source/editeng/editview.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 4f72ae7bfcb0..553fe192cec8 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -983,7 +983,18 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, LinkGetWindow()->OutputToScreenPixel( aScreenPos ); aTempRect = pImpEditView->GetWindow()->LogicToPixel( Rectangle(aScreenPos, aTempRect.GetSize() )); + //tdf#106123 store and restore the EditPaM around the menu Execute + //because the loss of focus in the current editeng causes writer + //annotations to save their contents, making the pContent of the + //current EditPams invalid + EPaM aP = pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM); + EPaM aP2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2); + sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose ); + + aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2); + aPaM = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP); + if (nId == nIgnoreId) { OUString aWord = pImpEditView->SpellIgnoreWord();