spelling context menu misplaced in margin comments
in writer, comments in margin, right clicking on a misspelt word
and the menu is misplaced, very misplaced if the comment is long
enough that the comment has a scrollbar and the word is near the end
Change-Id: I8e806346bdca08e33c3926dae008d71de4fe03d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107590
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 884817f..d764273 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1080,10 +1080,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
aPopupMenu->RemoveDisabledEntries( true, true );
// PaMtoEditCursor returns Logical units
tools::Rectangle aTempRect = pImpEditView->pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly );
Point aScreenPos = pImpEditView->GetWindowPos( aTempRect.TopLeft() );
aScreenPos = pImpEditView->GetWindow()->OutputToScreenPixel( aScreenPos );
aTempRect = pImpEditView->GetWindow()->LogicToPixel( tools::Rectangle(aScreenPos, aTempRect.GetSize() ));
// GetWindowPos works in Logical units
aTempRect = pImpEditView->GetWindowPos(aTempRect);
// Convert to pixels
aTempRect = pImpEditView->GetWindow()->LogicToPixel(aTempRect);
//tdf#106123 store and restore the EditPaM around the menu Execute
//because the loss of focus in the current editeng causes writer