diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 13:13:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 19:43:11 +0200 |
commit | 52c2cf22aa78ee886ee447a2629332e1e6f6c611 (patch) | |
tree | 9b91680232117080901a968a90d6bb33c2becda9 /sw/source/uibase | |
parent | b81432a23c900329ece07854fd06a322225a97c1 (diff) |
loplugin:simplifybool in sw
Change-Id: Ib842d5a768806fc41a66802908acc8679cf7a985
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95107
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/app/docstyle.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/lingu/hhcwrp.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/inputwin.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 4 |
6 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 693ae7f20b14..458c01d8d725 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -2727,8 +2727,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() } if( rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) && !(nId & USER_FMT) && - !( RES_POOLCHR_HTML_BEGIN <= nId && - nId < RES_POOLCHR_HTML_END ) && + ( RES_POOLCHR_HTML_BEGIN > nId || nId >= RES_POOLCHR_HTML_END ) && RES_POOLCHR_INET_NORMAL != nId && RES_POOLCHR_INET_VISIT != nId && RES_POOLCHR_FOOTNOTE != nId && diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 8cb4910502c5..6345066d36ba 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3054,7 +3054,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) pHdl->GetKind() != SdrHdlKind::Anchor_TR; if ((rSh.IsInsideSelectedObj(aDocPos) || bHitHandle) && - !(rMEvt.GetModifier() == KEY_SHIFT && !bHitHandle)) + (rMEvt.GetModifier() != KEY_SHIFT || bHitHandle)) { rSh.EnterSelFrameMode( &aDocPos ); if ( !m_pApplyTempl ) diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 168f6246a33c..6cedaad79681 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -194,7 +194,7 @@ void SwHHCWrapper::HandleNewUnit( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); - if (!(0 <= nUnitStart && nUnitStart <= nUnitEnd)) + if (0 > nUnitStart || nUnitStart > nUnitEnd) return; lcl_ActivateTextShell( m_rWrtShell ); @@ -357,7 +357,7 @@ void SwHHCWrapper::ReplaceUnit( LanguageType *pNewUnitLanguage ) { OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); - if (!(nUnitStart >= 0 && nUnitEnd >= nUnitStart)) + if (nUnitStart < 0 || nUnitEnd < nUnitStart) return; lcl_ActivateTextShell( m_rWrtShell ); diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 841dc4a829bb..7cce5f47dd0d 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -548,8 +548,8 @@ void InputEdit::UpdateRange(const OUString& rBoxes, ++nEndPos; } // Only if the current position lies in the range or right behind. - if( bFound && !( nStartPos < o3tl::make_unsigned(aSelection.Max()) && - static_cast<sal_uInt16>(aSelection.Max()) <= nEndPos + 1 )) + if( bFound && ( nStartPos >= o3tl::make_unsigned(aSelection.Max()) || + static_cast<sal_uInt16>(aSelection.Max()) > nEndPos + 1 )) bFound = false; } if( bFound ) diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 72481f9a608b..066b6d855c54 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1788,7 +1788,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pItem )) { const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pItem)->GetValue(); - const bool bBookMode = !(0 == nColumns || 0 != (nColumns % 2)) && + const bool bBookMode = (0 != nColumns && 0 == (nColumns % 2)) && static_cast<const SvxViewLayoutItem *>(pItem)->IsBookMode(); SetViewLayout( nColumns, bBookMode ); diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 48d84b512ce7..24e44dfbc675 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -617,7 +617,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_RASTER_SUBDIVISION_X : { sal_Int32 nTmp = 0; - if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100)) + if(!(rValue >>= nTmp) || (0 > nTmp || nTmp >= 100)) throw IllegalArgumentException(); mpViewOption->SetDivisionX( static_cast<short>(nTmp) ); } @@ -625,7 +625,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_RASTER_SUBDIVISION_Y : { sal_Int32 nTmp = 0; - if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100)) + if(!(rValue >>= nTmp) || (0 > nTmp || nTmp >= 100)) throw IllegalArgumentException(); mpViewOption->SetDivisionY( static_cast<short>(nTmp) ); } |