diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 09:07:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-30 10:49:51 +0200 |
commit | d6c32cffb5cc81989b4bb4a221a152bbe607bd98 (patch) | |
tree | 2c4ef9ec2a201ffcfea145ed5a0b901f2b6853ea /sfx2 | |
parent | 9ab64dc48a6a61edce6ff3724093162ca1cf8331 (diff) |
loplugin:simplifybool extend to expression like !(a < b || c > d)
mostly to catch stuff from the flatten work, but I think this looks good
in general
Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 9c2ee6687ded..715606a114e8 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -122,7 +122,7 @@ bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize ) rSize.setHeight( rStr.getToken(0, '/', nIdx).toInt32() ); // negative sizes are invalid - return !(rSize.Width() < 0 || rSize.Height() < 0); + return rSize.Width() >= 0 && rSize.Height() >= 0; } bool GetSplitSizeFromString( const OUString& rStr, Size& rSize ) @@ -141,7 +141,7 @@ bool GetSplitSizeFromString( const OUString& rStr, Size& rSize ) rSize.setHeight( aStr.getToken(0, ';', nIdx ).toInt32() ); // negative sizes are invalid - return !(rSize.Width() < 0 || rSize.Height() < 0); + return rSize.Width() >= 0 && rSize.Height() >= 0; } return false; diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 48874f59ac7e..739336a8859c 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -709,7 +709,7 @@ bool SfxDispatcher::GetShellAndSlot_Impl(sal_uInt16 nSlot, SfxShell** ppShell, if ( nullptr == (*ppSlot)->GetExecFnc() && bRealSlot ) *ppSlot = (*ppShell)->GetInterface()->GetRealSlot(*ppSlot); // Check only real slots as enum slots don't have an execute function! - return !bRealSlot || !((nullptr == *ppSlot) || (nullptr == (*ppSlot)->GetExecFnc()) ); + return !bRealSlot || ((nullptr != *ppSlot) && (nullptr != (*ppSlot)->GetExecFnc()) ); } return false; diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 562585a90c5e..926a68ab8bfa 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -297,7 +297,7 @@ namespace static bool lcl_checkDockingWindowID( sal_uInt16 nID ) { - return !(nID < SID_DOCKWIN_START || nID >= o3tl::make_unsigned(SID_DOCKWIN_START+NUM_OF_DOCKINGWINDOWS)); + return nID >= SID_DOCKWIN_START && nID < o3tl::make_unsigned(SID_DOCKWIN_START+NUM_OF_DOCKINGWINDOWS); } static SfxWorkWindow* lcl_getWorkWindowFromXFrame( const uno::Reference< frame::XFrame >& rFrame ) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 1400bf71e17b..ece8ce6f11fe 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2675,7 +2675,7 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OString const utf8Ptm(OUStringToOString(pPasswordRequest->getPasswordToModify(), RTL_TEXTENCODING_UTF8)); if (!(52 <= utf8Pwd.getLength() && utf8Pwd.getLength() <= 55 && SvtSaveOptions().GetODFSaneDefaultVersion() < SvtSaveOptions::ODFSVER_012) - && !(52 <= utf8Ptm.getLength() && utf8Ptm.getLength() <= 55)) + && (52 > utf8Ptm.getLength() || utf8Ptm.getLength() > 55)) { break; } |