diff options
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
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(); |