summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-21 15:53:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-22 12:42:07 +0200
commit4347b5975283ca1a591b6c3d4559ed360e187022 (patch)
treed607931cc2143988fe344f32b8f311bcf4f3ef51 /vcl/source/control
parentb55fda6d9eb83460382c0da74eb5cd3a3d03cd7f (diff)
pvs-studio: V728 An excessive check can be simplified
for... "The '(A && !B) || (!A && B)' expression is equivalent to the 'bool(A) != bool(B)' expression" subcases, where the args are already bool Change-Id: Ica8b5c4974c513f7f7ad8acf17ca931e85ebc8af Reviewed-on: https://gerrit.libreoffice.org/62146 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/button.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d81565a68666..52fe3b483573 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2596,11 +2596,8 @@ bool RadioButton::PreNotify( NotifyEvent& rNEvt )
// trigger redraw if mouse over state has changed
if( IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Entire) )
{
- if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
- !maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
- ( maMouseRect.IsInside( GetLastPointerPosPixel()) &&
- !maMouseRect.IsInside( GetPointerPosPixel()) ) ||
- pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow() )
+ if (maMouseRect.IsInside(GetPointerPosPixel()) != maMouseRect.IsInside(GetLastPointerPosPixel()) ||
+ pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow())
{
Invalidate( maStateRect );
}
@@ -3495,11 +3492,8 @@ bool CheckBox::PreNotify( NotifyEvent& rNEvt )
// trigger redraw if mouse over state has changed
if( IsNativeControlSupported(ControlType::Checkbox, ControlPart::Entire) )
{
- if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
- !maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
- ( maMouseRect.IsInside( GetLastPointerPosPixel()) &&
- !maMouseRect.IsInside( GetPointerPosPixel()) ) ||
- pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow() )
+ if (maMouseRect.IsInside(GetPointerPosPixel()) != maMouseRect.IsInside(GetLastPointerPosPixel()) ||
+ pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow())
{
Invalidate( maStateRect );
}