vcl/qt5/QtGraphics_GDI.cxx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
New commits: commit 389b801cea9c9f3c311dcbe9d32df62a66e5ea4a Author: Dr. David Alan Gilbert <d...@treblig.org> AuthorDate: Wed May 10 23:55:14 2023 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat May 13 06:36:47 2023 +0200 tdf#148251 qt: Use std::swap instead of using temporary values Another std::swap case in drawLine Change-Id: I207fe3c8c6c88532c23faf3aa3188acdcda3a5b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151654 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx index 08116f85a529..28bab34a7cca 100644 --- a/vcl/qt5/QtGraphics_GDI.cxx +++ b/vcl/qt5/QtGraphics_GDI.cxx @@ -198,19 +198,10 @@ void QtGraphicsBackend::drawLine(tools::Long nX1, tools::Long nY1, tools::Long n QtPainter aPainter(*this); aPainter.drawLine(nX1, nY1, nX2, nY2); - tools::Long tmp; if (nX1 > nX2) - { - tmp = nX1; - nX1 = nX2; - nX2 = tmp; - } + std::swap(nX1, nX2); if (nY1 > nY2) - { - tmp = nY1; - nY1 = nY2; - nY2 = tmp; - } + std::swap(nY1, nY2); aPainter.update(nX1, nY1, nX2 - nX1 + 1, nY2 - nY1 + 1); }