From 80f28e377db0ca04da57eed77d42f44cbdea363d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 May 2020 11:36:45 +0200 Subject: loplugin:simplifybool in oox..sd Change-Id: I76cbd5d3e65f0b392d713a51607f5c88dae79593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95101 Tested-by: Jenkins Reviewed-by: Noel Grandin --- oox/source/drawingml/chart/converterbase.cxx | 2 +- sal/osl/unx/profile.cxx | 4 ++-- sal/rtl/cipher.cxx | 4 ++-- sax/source/expatwrap/saxwriter.cxx | 4 ++-- sax/source/expatwrap/xml2utf.cxx | 2 +- sax/source/tools/converter.cxx | 2 +- sc/source/core/data/column2.cxx | 2 +- sc/source/core/tool/chgtrack.cxx | 2 +- sc/source/core/tool/compare.cxx | 2 +- sc/source/core/tool/compiler.cxx | 10 +++++----- sc/source/core/tool/interpr2.cxx | 4 ++-- sc/source/core/tool/interpr8.cxx | 2 +- sc/source/core/tool/refupdat.cxx | 12 ++++++------ sc/source/core/tool/token.cxx | 2 +- sc/source/ui/docshell/docsh.cxx | 2 +- sc/source/ui/docshell/impex.cxx | 2 +- sc/source/ui/unoobj/docuno.cxx | 4 ++-- sc/source/ui/view/cellsh.cxx | 2 +- sc/source/ui/view/cellsh1.cxx | 6 +++--- sc/source/ui/view/gridwin.cxx | 2 +- sc/source/ui/view/tabview2.cxx | 8 ++++---- sd/source/core/stlsheet.cxx | 2 +- sd/source/filter/eppt/pptx-text.cxx | 2 +- sd/source/ui/app/tmplctrl.cxx | 2 +- sd/source/ui/dlg/navigatr.cxx | 4 ++-- sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 2 +- sd/source/ui/view/drviews3.cxx | 2 +- sd/source/ui/view/drviewsj.cxx | 2 +- sd/source/ui/view/sdview.cxx | 3 ++- 29 files changed, 50 insertions(+), 49 deletions(-) diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index d8f7b564904d..5a58401ae07d 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -401,7 +401,7 @@ void LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, doub awt::Point aShapePos( lclCalcPosition( aChartSize.Width, mrModel.mfX, mrModel.mnXMode ), lclCalcPosition( aChartSize.Height, mrModel.mfY, mrModel.mnYMode ) ); - if( !((aShapePos.X >= 0) && (aShapePos.Y >= 0)) ) + if( (aShapePos.X < 0) || (aShapePos.Y < 0) ) return; bool bPropSet = false; diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index ce3742bc8a10..31cfc8575f73 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -306,7 +306,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile) } pFile = pProfile->m_pFile; - if ( !( pFile != nullptr && pFile->m_Handle >= 0 ) ) + if ( pFile == nullptr || pFile->m_Handle < 0 ) { pthread_mutex_unlock(&(pProfile->m_AccessLock)); @@ -325,7 +325,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile) static bool writeProfileImpl(osl_TFile* pFile) { - if ( !( pFile != nullptr && pFile->m_Handle >= 0 ) || ( pFile->m_pWriteBuf == nullptr ) ) + if ( pFile == nullptr || pFile->m_Handle < 0 || pFile->m_pWriteBuf == nullptr ) { return false; } diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 34428654975f..db9b1bdd20bf 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -718,7 +718,7 @@ static rtlCipherError BF_update( if (!pData || !pBuffer) return rtl_Cipher_E_Argument; - if (!((nDatLen > 0) && (nDatLen <= nBufLen))) + if ((nDatLen <= 0) || (nDatLen > nBufLen)) return rtl_Cipher_E_BufferSize; /* Update. */ @@ -1265,7 +1265,7 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl( if (!pData || !pBuffer) return rtl_Cipher_E_Argument; - if (!((0 < nDatLen) && (nDatLen <= nBufLen))) + if ((0 >= nDatLen) || (nDatLen > nBufLen)) return rtl_Cipher_E_BufferSize; #if defined LIBO_CIPHER_OPENSSL_BACKEND diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index f4f4c4bae142..2fe579648ce5 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -464,7 +464,7 @@ bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, rPos = writeSequence(); // reset left-over surrogate - if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) ) + if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) ) { OSL_ENSURE( nSurrogate != 0, "left-over Unicode surrogate" ); nSurrogate = 0; @@ -901,7 +901,7 @@ sal_Int32 calcXMLByteLength( const OUString& rStr, } // surrogate processing - if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) ) + if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) ) nSurrogate = 0; } diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index 420f90b6c3f0..9e531b13cfa6 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -117,7 +117,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence &seq , sal_In void XMLFile2UTFConverter::removeEncoding( Sequence &seq ) { const sal_Int8 *pSource = seq.getArray(); - if (!(seq.getLength() >= 5 && !strncmp(reinterpret_cast(pSource), "(pSource), " c) || (c > '9')) break; ++nPos; } diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 61a756699081..9a45e48899f6 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -3531,7 +3531,7 @@ public: const SCROW nRow1 = node.position; const SCROW nRow2 = nRow1 + 1; - if (! ((nRow2 < mnStartRow) || (nRow1 > mnEndRow))) + if ((nRow2 >= mnStartRow) && (nRow1 <= mnEndRow)) { mnCount += WeightedCounter::getWeight(node); } diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index a6524f95da7d..2e445d0247ed 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1003,7 +1003,7 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc ) switch ( GetType() ) { case SC_CAT_DELETE_COLS : - if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == pDoc->MaxCol()) ) + if ( aRange.aStart.Col() != 0 || aRange.aEnd.Col() != pDoc->MaxCol() ) { // Only if not TabDelete bOk = pDoc->CanInsertCol( aRange ) && pDoc->InsertCol( aRange ); } diff --git a/sc/source/core/tool/compare.cxx b/sc/source/core/tool/compare.cxx index f1c5fa3979c8..6d7150003417 100644 --- a/sc/source/core/tool/compare.cxx +++ b/sc/source/core/tool/compare.cxx @@ -42,7 +42,7 @@ CompareOptions::CompareOptions( const ScDocument* pDoc, const ScQueryEntry& rEnt { // Wildcard and Regex search work only with equal or not equal. if (eSearchType != utl::SearchParam::SearchType::Normal && - !(aQueryEntry.eOp == SC_EQUAL || aQueryEntry.eOp == SC_NOT_EQUAL)) + aQueryEntry.eOp != SC_EQUAL && aQueryEntry.eOp != SC_NOT_EQUAL) eSearchType = utl::SearchParam::SearchType::Normal; // Interpreter functions usually are case insensitive, except the simple diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 9cdc0c8fc427..f94931dd3278 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3559,8 +3559,8 @@ bool ScCompiler::IsColRowName( const OUString& rName ) { const ScRangePair & rR = (*pRL)[iPair]; const ScRange& rNameRange = rR.GetRange(0); - if ( jThisTab && !(rNameRange.aStart.Tab() <= nThisTab && - nThisTab <= rNameRange.aEnd.Tab()) ) + if ( jThisTab && (rNameRange.aStart.Tab() > nThisTab || + nThisTab > rNameRange.aEnd.Tab()) ) continue; // for ScCellIterator aIter( pDoc, rNameRange ); for (bool bHas = aIter.first(); bHas && !bInList; bHas = aIter.next()) @@ -3645,7 +3645,7 @@ bool ScCompiler::IsColRowName( const OUString& rName ) nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); nDistance = nD; } - else if ( !(nRow < aOne.Row() && nMyRow >= static_cast(aOne.Row())) ) + else if ( nRow >= aOne.Row() || nMyRow < static_cast(aOne.Row()) ) { // upper left, only if not further up than the // current entry and nMyRow is below (CellIter @@ -3709,7 +3709,7 @@ bool ScCompiler::IsColRowName( const OUString& rName ) nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); nDistance = nD; } - else if ( !(nRow < aOne.Row() && nMyRow >= static_cast(aOne.Row())) ) + else if ( nRow >= aOne.Row() || nMyRow < static_cast(aOne.Row()) ) { // upper left, only if not further up than the // current entry and nMyRow is below (CellIter @@ -4621,7 +4621,7 @@ std::unique_ptr ScCompiler::CompileString( const OUString& rFormul default: break; } - if (!(eLastOp == ocOpen && eOp == ocClose) && + if ((eLastOp != ocOpen || eOp != ocClose) && (eLastOp == ocOpen || eLastOp == ocSep || eLastOp == ocArrayRowSep || diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 891fcbc7e798..de63442eaf0e 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -559,7 +559,7 @@ void ScInterpreter::ScNetWorkdays( bool bOOXML_Version ) { while ( nRef < nMax && nSortArray.at( nRef ) < nDate1 ) nRef++; - if ( !( nRef < nMax && nSortArray.at( nRef ) == nDate1 ) ) + if ( nRef >= nMax || nSortArray.at( nRef ) != nDate1 ) nCnt++; } ++nDate1; @@ -613,7 +613,7 @@ void ScInterpreter::ScWorkday_MS() while ( nRef < nMax && nSortArray.at( nRef ) < nDate ) nRef++; - if ( !( nRef < nMax && nSortArray.at( nRef ) == nDate ) || nRef >= nMax ) + if ( nRef >= nMax || nSortArray.at( nRef ) != nDate || nRef >= nMax ) nDays--; } } diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 9fc1e799884a..b9e09dfef564 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1241,7 +1241,7 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType ) // required arguments double fPILevel = 0.0; - if ( nParamCount < 3 && !( nParamCount == 2 && eETSType == etsSeason ) ) + if ( nParamCount < 3 && ( nParamCount != 2 || eETSType != etsSeason ) ) { PushParameterExpected(); return; diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index c1c1ffa19cd5..3dfe38634478 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -388,7 +388,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, { if ( nDx && (theRow1 >= nRow1) && (theRow2 <= nRow2) && (theTab1 >= nTab1) && (theTab2 <= nTab2) && - !(theCol1 == nInt32Min && theCol2 == nInt32Max) ) + (theCol1 != nInt32Min || theCol2 != nInt32Max) ) { bCut1 = lcl_MoveBig( theCol1, nCol1, nDx ); bCut2 = lcl_MoveBig( theCol2, nCol1, nDx ); @@ -399,7 +399,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, } if ( nDy && (theCol1 >= nCol1) && (theCol2 <= nCol2) && (theTab1 >= nTab1) && (theTab2 <= nTab2) && - !(theRow1 == nInt32Min && theRow2 == nInt32Max) ) + (theRow1 != nInt32Min || theRow2 != nInt32Max) ) { bCut1 = lcl_MoveBig( theRow1, nRow1, nDy ); bCut2 = lcl_MoveBig( theRow2, nRow1, nDy ); @@ -410,7 +410,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, } if ( nDz && (theCol1 >= nCol1) && (theCol2 <= nCol2) && (theRow1 >= nRow1) && (theRow2 <= nRow2) && - !(theTab1 == nInt32Min && theTab2 == nInt32Max) ) + (theTab1 != nInt32Min || theTab2 != nInt32Max) ) { bCut1 = lcl_MoveBig( theTab1, nTab1, nDz ); bCut2 = lcl_MoveBig( theTab2, nTab1, nDz ); @@ -424,7 +424,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, { if ( rWhere.In( rWhat ) ) { - if ( nDx && !(theCol1 == nInt32Min && theCol2 == nInt32Max) ) + if ( nDx && (theCol1 != nInt32Min || theCol2 != nInt32Max) ) { bCut1 = lcl_MoveItCutBig( theCol1, nDx ); bCut2 = lcl_MoveItCutBig( theCol2, nDx ); @@ -433,7 +433,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, rWhat.aStart.SetCol( theCol1 ); rWhat.aEnd.SetCol( theCol2 ); } - if ( nDy && !(theRow1 == nInt32Min && theRow2 == nInt32Max) ) + if ( nDy && (theRow1 != nInt32Min || theRow2 != nInt32Max) ) { bCut1 = lcl_MoveItCutBig( theRow1, nDy ); bCut2 = lcl_MoveItCutBig( theRow2, nDy ); @@ -442,7 +442,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode eUpdateRefMode, rWhat.aStart.SetRow( theRow1 ); rWhat.aEnd.SetRow( theRow2 ); } - if ( nDz && !(theTab1 == nInt32Min && theTab2 == nInt32Max) ) + if ( nDz && (theTab1 != nInt32Min || theTab2 != nInt32Max) ) { bCut1 = lcl_MoveItCutBig( theTab1, nDz ); bCut2 = lcl_MoveItCutBig( theTab2, nDz ); diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 545ddc8dce08..8f58651355ac 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2971,7 +2971,7 @@ bool expandRangeByEdge( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, co // Edge-expansion is turned off. return false; - if (!(rSelectedRange.aStart.Tab() <= rRefRange.aStart.Tab() && rRefRange.aEnd.Tab() <= rSelectedRange.aEnd.Tab())) + if (rSelectedRange.aStart.Tab() > rRefRange.aStart.Tab() || rRefRange.aEnd.Tab() > rSelectedRange.aEnd.Tab()) // Sheet references not within selected range. return false; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 96b3d6623364..f2d80f1d5bf9 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -301,7 +301,7 @@ void ScDocShell::AfterXMLLoading(bool bRet) { if ( *pNameBuffer == '\'' && *(pNameBuffer-1) != '\\' ) bQuote = false; - else if( !(*pNameBuffer == '\\' && *(pNameBuffer+1) == '\'') ) + else if( *pNameBuffer != '\\' || *(pNameBuffer+1) != '\'' ) aDocURLBuffer.append(*pNameBuffer); // If escaped quote: only quote in the name ++pNameBuffer; } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index c61144fab693..7912d7ec389a 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1895,7 +1895,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) const sal_Unicode* q = p; while( *q && *q != ';' ) q++; - if ( !(*q == ';' && *(q+1) == 'I') && !bInvalidCol && !bInvalidRow ) + if ( (*q != ';' || *(q+1) != 'I') && !bInvalidCol && !bInvalidRow ) { // don't ignore value if( bText ) { diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 2a4153756eb1..276a2bd42dbf 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2857,8 +2857,8 @@ css::uno::Reference ScModelObj::create( // #i64497# If a chart is in a temporary document during clipboard paste, // there should be no data provider, so that own data is used bool bCreate = - ! ( nType == ServiceType::CHDATAPROV && - ( pDocShell->GetCreateMode() == SfxObjectCreateMode::INTERNAL )); + ( nType != ServiceType::CHDATAPROV || + ( pDocShell->GetCreateMode() != SfxObjectCreateMode::INTERNAL )); // this should never happen, i.e. the temporary document should never be // loaded, because this unlinks the data assert(bCreate); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index a9dfdc4db199..ff7e37538c08 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1117,7 +1117,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) else { CommentCaptionState eState = pDoc->GetAllNoteCaptionsState( aRanges ); - bool bAllNotesInShown = !(eState == ALLHIDDEN || eState == MIXED); + bool bAllNotesInShown = (eState != ALLHIDDEN && eState != MIXED); rSet.Put( SfxBoolItem( SID_TOGGLE_NOTES, bAllNotesInShown) ); } } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 4db57dc43f26..0ee0cc1b2f9d 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1381,9 +1381,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY ); pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, true ); - if ( !( pData->GetSimpleArea( nStartX, nStartY, nStartTab, - nEndX, nEndY, nEndTab ) == SC_MARK_SIMPLE && - nStartTab == nEndTab ) ) + if ( pData->GetSimpleArea( nStartX, nStartY, nStartTab, + nEndX, nEndY, nEndTab ) != SC_MARK_SIMPLE || + nStartTab != nEndTab ) { // the destination is not a simple range, // assume the destination as the current cell diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1de54e8f03e5..284fc13a29a8 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6056,7 +6056,7 @@ void ScGridWindow::UpdateCursorOverlay() SCCOL nX2 = nX + rMerge.GetColMerge() - 1; SCROW nY2 = nY + rMerge.GetRowMerge() - 1; // Check if the middle or tail of the merged range is visible. - if (!(maVisibleRange.mnCol1 <= nX2 && maVisibleRange.mnRow1 <= nY2)) + if (maVisibleRange.mnCol1 > nX2 || maVisibleRange.mnRow1 > nY2) return; // no visible part } diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 97e5dd9babd9..bf78bc7f21ee 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -513,7 +513,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCCOL nColSpan = pMergeAttr->GetColMerge(); SCROW nRowSpan = pMergeAttr->GetRowMerge(); - if ( !( nCurX >= nBlockStartXOrig + nColSpan - 1 && nCurY >= nBlockStartYOrig + nRowSpan - 1 ) ) + if ( nCurX < nBlockStartXOrig + nColSpan - 1 || nCurY < nBlockStartYOrig + nRowSpan - 1 ) { nBlockStartX = nCurX >= nBlockStartXOrig ? nBlockStartXOrig : nBlockStartXOrig + nColSpan - 1; nBlockStartY = nCurY >= nBlockStartYOrig ? nBlockStartYOrig : nBlockStartYOrig + nRowSpan - 1; @@ -538,7 +538,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCCOL nColSpan = pMergeAttr->GetColMerge(); SCROW nRowSpan = pMergeAttr->GetRowMerge(); - if ( !( nBlockStartX >= nCurX + nColSpan - 1 && nBlockStartY >= nCurY + nRowSpan - 1 ) ) + if ( nBlockStartX < nCurX + nColSpan - 1 || nBlockStartY < nCurY + nRowSpan - 1 ) { if ( nBlockStartX <= nCurX + nColSpan - 1 ) { @@ -550,8 +550,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, SCROW nCurYOffsetTemp = (nCurY < nCurY + nRowSpan - 1) ? nRowSpan - 1 : 0; nCurYOffset = std::max(nCurYOffset, nCurYOffsetTemp); } - if ( !( nBlockStartX <= nCurX && nBlockStartY <= nCurY ) && - !( nBlockStartX > nCurX + nColSpan - 1 && nBlockStartY > nCurY + nRowSpan - 1 ) ) + if ( ( nBlockStartX > nCurX || nBlockStartY > nCurY ) && + ( nBlockStartX <= nCurX + nColSpan - 1 || nBlockStartY <= nCurY + nRowSpan - 1 ) ) { nBlockStartXOffset = (nBlockStartX > nCurX && nBlockStartX <= nCurX + nColSpan - 1) ? nCurX - nBlockStartX : 0; nBlockStartYOffset = (nBlockStartY > nCurY && nBlockStartY <= nCurY + nRowSpan - 1) ? nCurY - nBlockStartY : 0; diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index c19b87e67645..c766ac790f5e 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1316,7 +1316,7 @@ void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase const * pStyleS SdStyleSheet* pRealSheet = static_cast(pStyleSheet)->GetRealStyleSheet(); pRealSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); - if( !((ePO >= PresentationObjects::Outline_1) && (ePO <= PresentationObjects::Outline_8)) ) + if( (ePO < PresentationObjects::Outline_1) || (ePO > PresentationObjects::Outline_8) ) return; OUString sStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " "); diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 46311702b3e4..81b1df15356d 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -752,7 +752,7 @@ void ParagraphObj::ImplClear() void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight ) { - if ( !(( nNumberingType == SVX_NUM_BITMAP ) && ( nBulletId != 0xffff )) ) + if ( ( nNumberingType != SVX_NUM_BITMAP ) || ( nBulletId == 0xffff ) ) return; // calculate the bullet real size for this graphic diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index fd9d27da3d1d..62d3ba6336a1 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -97,7 +97,7 @@ void SdTemplateControl::Paint( const UserDrawEvent& ) void SdTemplateControl::Command( const CommandEvent& rCEvt ) { - if ( !(rCEvt.GetCommand() == CommandEventId::ContextMenu && !GetStatusBar().GetItemText( GetId() ).isEmpty()) ) + if ( rCEvt.GetCommand() != CommandEventId::ContextMenu || GetStatusBar().GetItemText( GetId() ).isEmpty() ) return; SfxViewFrame* pViewFrame = SfxViewFrame::Current(); diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 21185602e2bb..7dc5177fc8b2 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -673,7 +673,7 @@ SdNavigatorControllerItem::SdNavigatorControllerItem( void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pItem ) { - if( !(eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_STATE) ) + if( eState < SfxItemState::DEFAULT || nSId != SID_NAVIGATOR_STATE ) return; const SfxUInt32Item& rStateItem = dynamic_cast(*pItem); @@ -739,7 +739,7 @@ SdPageNameControllerItem::SdPageNameControllerItem( void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pItem ) { - if( !(eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_PAGENAME) ) + if( eState < SfxItemState::DEFAULT || nSId != SID_NAVIGATOR_PAGENAME ) return; // only if doc in LB is the active diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 932f8e6da24f..1efdd922277a 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -1386,7 +1386,7 @@ void MultiSelectionModeHandler::UpdateSelection() maSecondCorner, false, false)); - if (!(nIndexUnderMouse>=0 && nIndexUnderMouse= nPageCount) return; if (mnAnchorIndex < 0) diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index f6358f3629c2..2883be985b46 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -148,7 +148,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) sal_Int32 nWhatPage = static_cast(pWhatPage->GetValue ()); PageKind nWhatKind = static_cast(pWhatKind->GetValue ()); - if (! (nWhatKind >= PageKind::Standard && nWhatKind <= PageKind::Handout)) + if (nWhatKind < PageKind::Standard || nWhatKind > PageKind::Handout) { #if HAVE_FEATURE_SCRIPTING StarBASIC::FatalError (ERRCODE_BASIC_BAD_PROP_VALUE); diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 772cf4a48ddb..372cb555ebdf 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -141,7 +141,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) } // If it is not a group object, we disable "ungroup" - if(!(dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && nInv == SdrInventor::Default)) + if(dynamic_cast< const SdrObjGroup *>( pObj ) == nullptr || nInv != SdrInventor::Default) { rSet.DisableItem(SID_UNGROUP); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 12470903d5a3..28e163e5bebc 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -180,7 +180,8 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected { const bool bDoCreateGeometry(pObject->getSdrPageFromSdrObject()->checkVisibility( rOriginal, rDisplayInfo, true )); - if(!bDoCreateGeometry && !(( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == OBJ_PAGE )) ) + if(!bDoCreateGeometry && + (( pObject->GetObjInventor() != SdrInventor::Default ) || ( pObject->GetObjIdentifier() != OBJ_PAGE )) ) return xRetval; PresObjKind eKind(PresObjKind::NONE); -- cgit