From ccebd10bc4bea1e65b606a054db3f98ab07850cf Mon Sep 17 00:00:00 2001 From: AmandaQuaresmaCoutinho Date: Thu, 4 Apr 2024 19:46:32 +0200 Subject: tdf#148251 Use std::swap instead of using temporary values Change-Id: I7629d86b8f85a493bd3ad6b9c465a81c746b1dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165802 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas --- embedserv/source/embed/tracker.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'embedserv') diff --git a/embedserv/source/embed/tracker.cxx b/embedserv/source/embed/tracker.cxx index 2a502671bb63..fb331dfa1478 100644 --- a/embedserv/source/embed/tracker.cxx +++ b/embedserv/source/embed/tracker.cxx @@ -201,17 +201,10 @@ void winwrap::TransformRect(LPRECT rect,HWND pWnd,HWND pWndClipTo) static void NormalizeRect(LPRECT rp) { - if(rp->left > rp->right) { - UINT tmp = rp->left; - rp->left = rp->right; - rp->right = tmp; - } - - if(rp->top > rp->bottom) { - UINT tmp = rp->top; - rp->top = rp->bottom; - rp->bottom = tmp; - } + if(rp->left > rp->right) + std::swap(rp->left, rp->right); + if(rp->top > rp->bottom) + std::swap(rp->top, rp->bottom); } -- cgit