diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/gen.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 16b81b6ee56f..3593801579ac 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <algorithm> #include <sstream> #include <o3tl/safeint.hxx> #include <tools/gen.hxx> @@ -145,20 +146,14 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect void tools::Rectangle::Justify() { - long nHelp; - if ( (nRight < nLeft) && (nRight != RECT_EMPTY) ) { - nHelp = nLeft; - nLeft = nRight; - nRight = nHelp; + std::swap(nLeft, nRight); } if ( (nBottom < nTop) && (nBottom != RECT_EMPTY) ) { - nHelp = nBottom; - nBottom = nTop; - nTop = nHelp; + std::swap(nBottom, nTop); } } |