diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-20 16:35:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-25 09:58:32 +0200 |
commit | b3705c21e16ae693cba26630ce524bc43c28aae7 (patch) | |
tree | f06526fb2a07e949b8a9d85156a35e7ed5149184 /svtools/source | |
parent | 3b4794132776a4fe8ad5999d14a85885e3f942b0 (diff) |
SvResizeHelper::ValidateRect, simplify logic
Change-Id: Ie1c9891e8095172f53efc027eec9a68bde39ed1f
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/hatchwindow/ipwin.cxx | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx index 62ea003ff58e..2930e951d600 100644 --- a/svtools/source/hatchwindow/ipwin.cxx +++ b/svtools/source/hatchwindow/ipwin.cxx @@ -347,73 +347,51 @@ void SvResizeHelper::ValidateRect( Rectangle & rValidate ) const { case 0: if( rValidate.Top() > rValidate.Bottom() ) - { rValidate.Top() = rValidate.Bottom(); - rValidate.Bottom() = RECT_EMPTY; - } if( rValidate.Left() > rValidate.Right() ) - { rValidate.Left() = rValidate.Right(); - rValidate.Right() = RECT_EMPTY; - } break; case 1: if( rValidate.Top() > rValidate.Bottom() ) - { rValidate.Top() = rValidate.Bottom(); - rValidate.Bottom() = RECT_EMPTY; - } break; case 2: if( rValidate.Top() > rValidate.Bottom() ) - { rValidate.Top() = rValidate.Bottom(); - rValidate.Bottom() = RECT_EMPTY; - } if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = RECT_EMPTY; + rValidate.Right() = rValidate.Left(); break; case 3: if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = RECT_EMPTY; + rValidate.Right() = rValidate.Left(); break; case 4: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = RECT_EMPTY; + rValidate.Bottom() = rValidate.Top(); if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = RECT_EMPTY; + rValidate.Right() = rValidate.Left(); break; case 5: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = RECT_EMPTY; + rValidate.Bottom() = rValidate.Top(); break; case 6: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = RECT_EMPTY; + rValidate.Bottom() = rValidate.Top(); if( rValidate.Left() > rValidate.Right() ) - { rValidate.Left() = rValidate.Right(); - rValidate.Right() = RECT_EMPTY; - } break; case 7: if( rValidate.Left() > rValidate.Right() ) - { rValidate.Left() = rValidate.Right(); - rValidate.Right() = RECT_EMPTY; - } break; } - if( rValidate.Right() == RECT_EMPTY ) - rValidate.Right() = rValidate.Left(); - if( rValidate.Bottom() == RECT_EMPTY ) - rValidate.Bottom() = rValidate.Top(); // Mindestgr"osse 5 x 5 if( rValidate.Left() + 5 > rValidate.Right() ) - rValidate.Right() = rValidate.Left() +5; + rValidate.Right() = rValidate.Left() + 5; if( rValidate.Top() + 5 > rValidate.Bottom() ) - rValidate.Bottom() = rValidate.Top() +5; + rValidate.Bottom() = rValidate.Top() + 5; } /************************************************************************* |