Kaydet (Commit) 59886618 authored tarafından Miklos Vajna's avatar Miklos Vajna

tools: use std::swap() in Rectangle::Justify()

Change-Id: If613c9e54f8b6178937f085c594d16a9b883ac10
Reviewed-on: https://gerrit.libreoffice.org/67263
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst b35a64be
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <sal/config.h> #include <sal/config.h>
#include <algorithm>
#include <sstream> #include <sstream>
#include <o3tl/safeint.hxx> #include <o3tl/safeint.hxx>
#include <tools/gen.hxx> #include <tools/gen.hxx>
...@@ -145,20 +146,14 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect ...@@ -145,20 +146,14 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect
void tools::Rectangle::Justify() void tools::Rectangle::Justify()
{ {
long nHelp;
if ( (nRight < nLeft) && (nRight != RECT_EMPTY) ) if ( (nRight < nLeft) && (nRight != RECT_EMPTY) )
{ {
nHelp = nLeft; std::swap(nLeft, nRight);
nLeft = nRight;
nRight = nHelp;
} }
if ( (nBottom < nTop) && (nBottom != RECT_EMPTY) ) if ( (nBottom < nTop) && (nBottom != RECT_EMPTY) )
{ {
nHelp = nBottom; std::swap(nBottom, nTop);
nBottom = nTop;
nTop = nHelp;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment