diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-25 10:32:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-25 11:53:48 +0200 |
commit | 9d7b96e00909fa6798aafb9b385e58cda360e05f (patch) | |
tree | 4310865d671bcb0d47d548def9961d351c12cb9d /svtools/source/control/headbar.cxx | |
parent | 6891ab0dae58fe482e89eec5186ad7aeff909cac (diff) |
clang-tidy readability-simplify-boolean-expr in svtools
Change-Id: I13286a691348e136d16c07473285313c3ba5bba2
Reviewed-on: https://gerrit.libreoffice.org/36928
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/control/headbar.cxx')
-rw-r--r-- | svtools/source/control/headbar.cxx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 9f863884de6b..0b5bc8de630c 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -209,10 +209,7 @@ sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos, return nMode; } - if ( pItem->mnBits & HeaderBarItemBits::FIXED ) - bLastFixed = true; - else - bLastFixed = false; + bLastFixed = static_cast<bool>(pItem->mnBits & HeaderBarItemBits::FIXED); nX += pItem->mnSize; } @@ -708,10 +705,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) bool bNewOutDrag; tools::Rectangle aItemRect = ImplGetItemRect( nPos ); - if ( aItemRect.IsInside( rMousePos ) ) - bNewOutDrag = false; - else - bNewOutDrag = true; + bNewOutDrag = !aItemRect.IsInside( rMousePos ); // if needed switch on ItemDrag if ( bNewOutDrag && mbDragable && !mbItemDrag && @@ -727,10 +721,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos ) sal_uInt16 nOldItemDragPos = mnItemDragPos; if ( mbItemDrag ) { - if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) ) - bNewOutDrag = true; - else - bNewOutDrag = false; + bNewOutDrag = (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF); if ( bNewOutDrag ) mnItemDragPos = HEADERBAR_ITEM_NOTFOUND; |