From 4732cbf3b93bb8a0ef08fa4ece318d03db648cc3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 3 Mar 2024 19:34:50 +0100 Subject: [PATCH] Gui: fix -Wlogical-op-parentheses --- src/Gui/CADNavigationStyle.cpp | 7 +++++-- src/Gui/RevitNavigationStyle.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index b5464695e4..931eafaf5a 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -260,10 +260,13 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) break; case BUTTON1DOWN: // make sure not to change the selection when stopping spinning - if (curmode == NavigationStyle::SPINNING || this->lockButton1 && curmode != NavigationStyle::SELECTION) + if (curmode == NavigationStyle::SPINNING + || (this->lockButton1 && curmode != NavigationStyle::SELECTION)) { newmode = NavigationStyle::IDLE; - else + } + else { newmode = NavigationStyle::SELECTION; + } break; case BUTTON3DOWN: if (curmode == NavigationStyle::SPINNING) { break; } diff --git a/src/Gui/RevitNavigationStyle.cpp b/src/Gui/RevitNavigationStyle.cpp index 5925936b58..be45712689 100644 --- a/src/Gui/RevitNavigationStyle.cpp +++ b/src/Gui/RevitNavigationStyle.cpp @@ -253,10 +253,13 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev) case BUTTON1DOWN: case CTRLDOWN|BUTTON1DOWN: // make sure not to change the selection when stopping spinning - if (curmode == NavigationStyle::SPINNING || this->lockButton1 && curmode != NavigationStyle::SELECTION) + if (curmode == NavigationStyle::SPINNING + || (this->lockButton1 && curmode != NavigationStyle::SELECTION)) { newmode = NavigationStyle::IDLE; - else + } + else { newmode = NavigationStyle::SELECTION; + } break; case BUTTON1DOWN|BUTTON2DOWN: case BUTTON3DOWN: