tdf#120703 PVS: V581 ifs with identical conditions
V581 The conditional expressions of the 'if' statements situated
alongside each other are identical.
Change-Id: I11fa13677c7980e6ac17fc4358406472ee784e41
Reviewed-on: https://gerrit.libreoffice.org/71446
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index 3527d1b..e41a2ba 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -850,9 +850,8 @@
--r;
}
}
} // aPointsIn contains the control points now.
if (bIsSuccessful)
{
// aPointsIn contains the control points now.
// calculate the intermediate points according given resolution
// using deBoor-Cox algorithm
lcl_tSizeType nNewSize = nResolution * n + 1;
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index a358bbfe..5fec836 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -727,8 +727,7 @@
if( mpCurrentViewShellBase )
{
ViewShell* pViewShell = mpCurrentViewShellBase->GetMainViewShell().get();
if( pViewShell )
if (ViewShell* const pViewShell = mpCurrentViewShellBase->GetMainViewShell().get())
{
// invalidate the view shell so the presentation slot will be re-enabled
// and the rehearsing will be updated
@@ -773,11 +772,12 @@
}
}
}
}
//Fire the acc focus event when focus is switched back. The above method mpCurrentViewShellBase->GetWindow()->GrabFocus() will
//set focus to WorkWindow instead of the sd::window, so here call Shell's method to fire the focus event
if (pViewShell)
// Fire the acc focus event when focus is switched back. The above method
// mpCurrentViewShellBase->GetWindow()->GrabFocus() will set focus to WorkWindow
// instead of the sd::window, so here call Shell's method to fire the focus event
pViewShell->SwitchActiveViewFireFocus();
}
}
mpCurrentViewShellBase = nullptr;
}
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 420c99f..55b58e1 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -665,15 +665,10 @@
if (eEditMode == EditMode::MasterPage)
{
// Disable some slots when in master page mode.
rSet.DisableItem(SID_ASSIGN_LAYOUT);
rSet.DisableItem(SID_INSERTPAGE);
}
// Disable some slots when in master page mode.
if (eEditMode == EditMode::MasterPage)
{
if (rSet.GetItemState(SID_INSERTPAGE) == SfxItemState::DEFAULT)
rSet.DisableItem(SID_INSERTPAGE);
if (rSet.GetItemState(SID_DUPLICATE_PAGE) == SfxItemState::DEFAULT)
rSet.DisableItem(SID_DUPLICATE_PAGE);
}
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 1d063a7..41872f4 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -993,8 +993,7 @@
//Set right on mpRightMost from pChild
mpRightMost->SetRight( bodyLeft );
}
}
if( pSubSup ) {
pChild = pSubSup->GetSubSup( LSUB );
if( pChild ) {
//Create position in front of pChild
@@ -1005,8 +1004,7 @@
//Set right on mpRightMost from pChild
mpRightMost->SetRight( bodyLeft );
}
}
if( pSubSup ) {
pChild = pSubSup->GetSubSup( CSUP );
if ( pChild ) {//TO
//Create position in front of pChild
@@ -1017,8 +1015,7 @@
//Set right on mpRightMost from pChild
mpRightMost->SetRight( bodyLeft );
}
}
if( pSubSup ) {
pChild = pSubSup->GetSubSup( CSUB );
if( pChild ) { //FROM
//Create position in front of pChild
@@ -1029,8 +1026,7 @@
//Set right on mpRightMost from pChild
mpRightMost->SetRight( bodyLeft );
}
}
if( pSubSup ) {
pChild = pSubSup->GetSubSup( RSUP );
if ( pChild ) {
//Create position in front of pChild
@@ -1041,8 +1037,7 @@
//Set right on mpRightMost from pChild
mpRightMost->SetRight( bodyLeft );
}
}
if( pSubSup ) {
pChild = pSubSup->GetSubSup( RSUB );
if ( pChild ) {
//Create position in front of pChild
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index a9a0f54..f75314e 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -266,10 +266,7 @@
cUC = (sal_Unicode(c1) << 8) | c2;
else
cUC = (sal_Unicode(c2) << 8) | c1;
}
if( !bErr )
{
c = cUC;
}
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 02e93dc..d188ce4 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1540,9 +1540,6 @@
if ( !bHadControl && rControl.is() && rControl.isVisible() )
rControl.invalidate();
if ( !bHadControl && rControl.is() && rControl.isVisible() )
rControl.invalidate();
// check if we already have an XControl.
if ( !xControlModel.is() || !rControl.is() )
{
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 5fffa2b..51678b7 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -457,10 +457,9 @@
void SdrEditView::CheckPossibilities()
{
if (mbSomeObjChgdFlag)
m_bPossibilitiesDirty=true;
if (mbSomeObjChgdFlag)
{
m_bPossibilitiesDirty = true;
// This call IS necessary to correct the MarkList, in which
// no longer to the model belonging objects still can reside.
// These ones need to be removed.
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 7b503bf..4f00a87 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1966,8 +1966,11 @@
}
}
EndUndo();
if (bMrkChg) AdjustMarkHdl();
if (bMrkChg) MarkListHasChanged();
if (bMrkChg)
{
AdjustMarkHdl();
MarkListHasChanged();
}
}
}
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 8eba703..8d21bbb 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -121,9 +121,8 @@
if (!aMatchCase)
nFlags |= TransliterationFlags::IGNORE_CASE;
if (aCTLOptions.IsCTLFontEnabled())
nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL;
if (aCTLOptions.IsCTLFontEnabled())
nFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL;
nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL
| TransliterationFlags::IGNORE_KASHIDA_CTL;
auto aArgs( comphelper::InitPropertySequence( {
{ "SearchItem.SearchString", css::uno::makeAny( sFindText ) },
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index cdd2aad..7435ce1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -859,19 +859,16 @@
}
}
// update global LRU list of wingraphics
if ( mpGraphics )
{
// update global LRU list of wingraphics
mpNextGraphics = pSVData->maGDIData.mpFirstWinGraphics;
pSVData->maGDIData.mpFirstWinGraphics = const_cast<vcl::Window*>(this);
if ( mpNextGraphics )
mpNextGraphics->mpPrevGraphics = const_cast<vcl::Window*>(this);
if ( !pSVData->maGDIData.mpLastWinGraphics )
pSVData->maGDIData.mpLastWinGraphics = const_cast<vcl::Window*>(this);
}
if ( mpGraphics )
{
mpGraphics->SetXORMode( (RasterOp::Invert == meRasterOp) || (RasterOp::Xor == meRasterOp), RasterOp::Invert == meRasterOp );
mpGraphics->setAntiAliasB2DDraw(bool(mnAntialiasing & AntialiasingFlags::EnableB2dDraw));
}