From 7e2641292b748e1c09c860f09f4d4a6b9fe7fd59 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Wed, 14 Aug 2024 15:30:33 -0700 Subject: [PATCH] it's definitely safe now --- src/interactivity/win32/uiaTextRange.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/interactivity/win32/uiaTextRange.cpp b/src/interactivity/win32/uiaTextRange.cpp index 028e181b383..765e52e8696 100644 --- a/src/interactivity/win32/uiaTextRange.cpp +++ b/src/interactivity/win32/uiaTextRange.cpp @@ -71,12 +71,16 @@ IFACEMETHODIMP UiaTextRange::Clone(_Outptr_result_maybenull_ ITextRangeProvider* void UiaTextRange::_TranslatePointToScreen(til::point& clientPoint) const { - ClientToScreen(_getWindowHandle(), clientPoint.as_win32_point()); + auto win32Point = clientPoint.as_win32_point(); + ClientToScreen(_getWindowHandle(), win32Point); + clientPoint = til::point{ *win32Point }; } void UiaTextRange::_TranslatePointFromScreen(til::point& screenPoint) const { - ScreenToClient(_getWindowHandle(), screenPoint.as_win32_point()); + auto win32Point = screenPoint.as_win32_point(); + ScreenToClient(_getWindowHandle(), win32Point); + screenPoint = til::point{ *win32Point }; } HWND UiaTextRange::_getWindowHandle() const