summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-05-25 10:53:22 +0530
committerDennis Francis <dennis.francis@collabora.com>2021-06-01 10:18:10 +0200
commitc5e249877b93e9d11788ec04fffee1dcb142a0e5 (patch)
tree9facf3e9474dd7e7ab9010b52bf69c8b896f9945 /editeng
parent77704022556bb97a64ef47666230a2c0232d45d3 (diff)
sc: lok: apply the previous fix for selections too
Change-Id: Ic1f6c1642da71e0ef8c23831786ae405dda21133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116427 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index fd76fe4d8d52..ca12e22fc197 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -660,9 +660,12 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD
{
MapUnit eDevUnit = _pTarget->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();