From c844aa36cc4268f182ec4f6627fb2b8f4cce7b15 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Tue, 25 May 2021 10:53:22 +0530 Subject: sc: lok: apply the previous fix for selections too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: editeng/source/editeng/impedit.cxx Change-Id: Ic1f6c1642da71e0ef8c23831786ae405dda21133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116427 Reviewed-by: Luboš Luňák Reviewed-by: Dennis Francis Tested-by: Jenkins CollaboraOffice (cherry picked from commit c5e249877b93e9d11788ec04fffee1dcb142a0e5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116541 Tested-by: Jenkins --- editeng/source/editeng/impedit.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 919873893575..653072083f66 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -660,9 +660,12 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice& rTarget, const Point& rDo { MapUnit eDevUnit = rTarget.GetMapMode().GetMapUnit(); tools::Rectangle aSelRect(rDocPosTopLeft, rDocPosBottomRight); - aSelRect = mpLOKSpecialPositioning->GetWindowPos(aSelRect, eDevUnit); - const Point aRefPoint = mpLOKSpecialPositioning->GetRefPoint(); - aSelRect.Move(-aRefPoint.X(), -aRefPoint.Y()); + aSelRect = GetWindowPos(aSelRect); + Point aRefPointLogical = GetOutputArea().TopLeft(); + // Get the relative coordinates w.r.t refpoint in display units. + aSelRect.Move(-aRefPointLogical.X(), -aRefPointLogical.Y()); + // Convert from display unit to twips. + aSelRect = OutputDevice::LogicToLogic(aSelRect, MapMode(eDevUnit), MapMode(MapUnit::MapTwip)); tools::Polygon aTmpPoly(4); aTmpPoly[0] = aSelRect.TopLeft(); -- cgit