summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-12-29 06:22:18 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-29 07:16:38 +0100
commitaaff1bfa765539068d837404ca016608490aaf11 (patch)
tree0396a8b7c92f54e165242f03868b077dcaaf9afd /sw
parentf011086f38775182ed3e05fc7a79ddfd8605af19 (diff)
Simplify a bit
Change-Id: I4b88160f27434588730082fc0b6853ba10df4603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161411 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/trvlfrm.cxx12
1 files changed, 2 insertions, 10 deletions
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?