summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-28 00:28:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-28 08:34:46 +0200
commit38e7f933c86b66010f65d821155eccd9e8a4135e (patch)
tree9b71f3b1927f66394af0ce1560388a6cb2daf96a
parent3159ba99d16bf875c28b77c1219a794d9e9a6186 (diff)
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>
-rw-r--r--chart2/source/view/charttypes/Splines.cxx5
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx7
-rw-r--r--starmath/source/visitors.cxx15
-rw-r--r--svtools/source/svrtf/svparser.cxx3
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx3
-rw-r--r--svx/source/svdraw/svdedtv.cxx5
-rw-r--r--svx/source/svdraw/svdedtv2.cxx7
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx5
-rw-r--r--vcl/source/window/window.cxx5
10 files changed, 24 insertions, 43 deletions
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index 3527d1bec01f..e41a2ba6bcd7 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -850,9 +850,8 @@ void SplineCalculater::CalculateBSplines(
--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 a358bbfee73f..5fec836f5090 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -727,8 +727,7 @@ void SAL_CALL SlideShow::end()
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 @@ void SAL_CALL SlideShow::end()
}
}
}
- }
- //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 420c99f86e80..55b58e197f1c 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -665,15 +665,10 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
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 1d063a7b7e0d..41872f478b4f 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -993,8 +993,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
//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 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
//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 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
//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 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
//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 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
//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 a9a0f548fa83..f75314e6a42a 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -266,10 +266,7 @@ sal_uInt32 SvParser<T>::GetNextChar()
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 02e93dc159be..d188ce4d2243 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1540,9 +1540,6 @@ namespace sdr { namespace contact {
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 5fffa2b3da23..51678b78b0d0 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -457,10 +457,9 @@ bool SdrEditView::IsDismantlePossible(bool bMakeLines) const
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 7b503bf9c5df..4f00a877ef35 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1966,8 +1966,11 @@ void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea)
}
}
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 8eba70390954..8d21bbb518ee 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -121,9 +121,8 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext
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 cdd2aadde311..7435ce177244 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -859,19 +859,16 @@ bool Window::AcquireGraphics() const
}
}
- // 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));
}