diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2023-05-10 23:55:14 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-05-13 06:36:47 +0200 |
commit | 389b801cea9c9f3c311dcbe9d32df62a66e5ea4a (patch) | |
tree | 052aaf890b610b47c560df1463c00b0751a42524 /vcl | |
parent | b5a22fceed57f05eb43a5fb0817afbc141610c5e (diff) |
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.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/QtGraphics_GDI.cxx | 13 |
1 files changed, 2 insertions, 11 deletions
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); } |