summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-24 13:57:53 +0000
committerAndras Timar <andras.timar@collabora.com>2017-03-06 17:57:39 +0100
commit3e95ca44f8c6d0ba34a53b10365d3debc206192d (patch)
tree5c1686320ff6ffae01fb18645b58883af20296d9 /editeng
parent701d1dc040399e02ab83e6011d8e254c60dd5497 (diff)
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 (cherry picked from commit 71a84b69ae30458a941f38869aa994118051a063) Change-Id: Ic01379291fa66dd58246d33287b18801f5da49c0 Reviewed-on: https://gerrit.libreoffice.org/34614 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 612903384bbe68dfb3be1b36111e28b869aa0be8)
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index c2cadb85d807..bd3bc6cb7ba7 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -990,7 +990,18 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
aScreenPos = pImpEditView->GetWindow()->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 == MN_IGNORE )
{
OUString aWord = pImpEditView->SpellIgnoreWord();