summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-11 11:08:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-11 14:54:27 +0100
commite5e3a05f13f47d44276cfe8d88e8ec9d4d559a66 (patch)
tree7e808c3920c355a564b9502e0e5e650eb1e574ab /editeng
parent516c9acad348872dd2d0c1b26a013c68f8cf55b4 (diff)
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>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 884817f415b6..d7642736cf27 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