sw/source/core/layout/trvlfrm.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
New commits: commit aaff1bfa765539068d837404ca016608490aaf11 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Dec 29 06:22:18 2023 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Dec 29 07:16:38 2023 +0100 Simplify a bit Change-Id: I4b88160f27434588730082fc0b6853ba10df4603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161411 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 5f8e3aa995a3..27922156b31d 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -191,16 +191,8 @@ bool SwLayoutFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point &rPoin bool SwPageFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point &rPoint, SwCursorMoveState* pCMS, bool bTestBackground ) const { - Point aPoint( rPoint ); - - // check, if we have to adjust the point - if ( !getFrameArea().Contains( aPoint ) ) - { - aPoint.setX( std::max( aPoint.X(), getFrameArea().Left() ) ); - aPoint.setX( std::min( aPoint.X(), getFrameArea().Right() ) ); - aPoint.setY( std::max( aPoint.Y(), getFrameArea().Top() ) ); - aPoint.setY( std::min( aPoint.Y(), getFrameArea().Bottom() ) ); - } + Point aPoint(std::clamp(rPoint.X(), getFrameArea().Left(), getFrameArea().Right()), + std::clamp(rPoint.Y(), getFrameArea().Top(), getFrameArea().Bottom())); bool bRet = false; //Could it be a free flying one?