From f2cd9c0c789b5825b4d5bb84b352d089e231e527 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 24 Nov 2018 21:55:10 +0300 Subject: tdf#120703 PVS: V560 A part of conditional expression is always true/false Change-Id: If173f42302553b164267909a0a3156bb25a6d558 Reviewed-on: https://gerrit.libreoffice.org/63957 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sc/source/core/data/fillinfo.cxx | 2 +- sc/source/core/data/formulacell.cxx | 4 ++-- sc/source/filter/excel/excel.cxx | 5 +---- sc/source/ui/drawfunc/drtxtob.cxx | 2 +- sc/source/ui/drawfunc/fudraw.cxx | 2 +- sc/source/ui/view/formatsh.cxx | 4 ++-- 6 files changed, 8 insertions(+), 11 deletions(-) (limited to 'sc/source') diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 3d4c2f3b279c..bb760bda8c57 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -584,7 +584,7 @@ void ScDocument::FillInfo( ++nArrRow; } - else if (bRowHidden && nLastHiddenRow >= 0) + else if (nLastHiddenRow >= 0) { nCurRow = nLastHiddenRow; if (nCurRow > nThisRow) diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index aadb8e11b4d0..bdc832c55d39 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3219,7 +3219,7 @@ bool ScFormulaCell::UpdateReferenceOnShift( if (!bHasRefs) { bHasColRowNames = (formula::FormulaTokenArrayPlainIterator(*pCode).GetNextColRowName() != nullptr); - bHasRefs = bHasRefs || bHasColRowNames; + bHasRefs = bHasColRowNames; } bool bOnRefMove = pCode->IsRecalcModeOnRefMove(); @@ -3347,7 +3347,7 @@ bool ScFormulaCell::UpdateReferenceOnMove( if (!bHasRefs) { bHasColRowNames = (formula::FormulaTokenArrayPlainIterator(*pCode).GetNextColRowName() != nullptr); - bHasRefs = bHasRefs || bHasColRowNames; + bHasRefs = bHasColRowNames; } bool bOnRefMove = pCode->IsRecalcModeOnRefMove(); diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 221f274f3038..c45bca6e26a8 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -217,10 +217,7 @@ ErrCode ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument OSL_ENSURE( pMedStrm, "::ScExportExcel5 - medium without output stream" ); if( !pMedStrm ) return SCERR_IMPORT_OPEN; // should not happen - ErrCode eRet = SCERR_IMPORT_UNKNOWN_BIFF; - if( eFormat == ExpBiff5 || eFormat == ExpBiff8 ) - eRet = lcl_ExportExcelBiff( rMedium, pDocument, pMedStrm, eFormat == ExpBiff8, eNach ); - + ErrCode eRet = lcl_ExportExcelBiff(rMedium, pDocument, pMedStrm, eFormat == ExpBiff8, eNach); return eRet; } diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 242c3fc57a75..d688bf7977d8 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -265,7 +265,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) SvxLinkInsertMode eMode = pHyper->GetInsertMode(); bool bDone = false; - if ( pOutView && ( eMode == HLINK_DEFAULT || eMode == HLINK_FIELD ) ) + if (eMode == HLINK_DEFAULT || eMode == HLINK_FIELD) { const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); if (pFieldItem) diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 65a3f0b843da..d0cd38557ec6 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -487,7 +487,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) else { // move handle with index nHandleIndex - if(pHdl && (nX || nY)) + if (nX || nY) { // now move the Handle (nX, nY) Point aStartPoint(pHdl->GetPos()); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index ba3896ecab2e..cc4fa6fa9ed9 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -393,7 +393,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) pStyleSheet = &(pStylePool->Make( aStyleName, eFamily, SfxStyleSearchBits::UserDefined ) ); - if ( pStyleSheet && pStyleSheet->HasParentSupport() ) + if (pStyleSheet->HasParentSupport()) pStyleSheet->SetParent(aRefName); } break; @@ -2180,7 +2180,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet ) rSet.Put( SvxColorItem(aCol, SID_FRAME_LINECOLOR ) ); rSet.InvalidateItem(SID_FRAME_LINECOLOR); } - else if( !bCol && !bColDisable) // if no line available + else if (!bCol) // if no line available { aCol = COL_AUTO; rSet.Put( SvxColorItem(aCol, SID_FRAME_LINECOLOR ) ); -- cgit