tdf#120703 PVS: V581 ifs with identical conditions
V581 The conditional expressions of the 'if' statements situated
alongside each other are identical.
Change-Id: I79c655a072faff0bdb2af031ed1328e684b83aac
Reviewed-on: https://gerrit.libreoffice.org/71430
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index fc09390..6979c74 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -603,21 +603,18 @@
if (*ppMapping)
return;
}
if (! aRet.is()) // try callback chain
{
MutexGuard aGuard( rData.aCallbacksMutex );
for ( const auto& rCallback : rData.aCallbacks )
// try callback chain
{
(*rCallback)( ppMapping, pFrom, pTo, aAddPurpose.pData );
if (*ppMapping)
return;
MutexGuard aGuard(rData.aCallbacksMutex);
for (const auto& rCallback : rData.aCallbacks)
{
(*rCallback)(ppMapping, pFrom, pTo, aAddPurpose.pData);
if (*ppMapping)
return;
}
}
}
if (! aRet.is())
{
aRet = loadExternalMapping( aFrom, aTo, aAddPurpose ); // direct try
if (! aRet.is())
aRet = getMediateMapping( aFrom, aTo, aAddPurpose ); // try via uno
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 12372d0..caa7a97 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -954,27 +954,28 @@
nWidth = pPageWidthItem->GetValue();
if (pFlagSetItem )
{
if (( 0x0001 & pFlagSetItem->GetValue())== 0x0001 )
EnableRelativeMode();
if (pFlagSetItem)
if (( 0x0002 & pFlagSetItem->GetValue())== 0x0002 )
EnableRegisterMode();
if (pFlagSetItem)
if ( ( 0x0004 & pFlagSetItem->GetValue())== 0x0004 )
EnableAutoFirstLine();
}
if(pLineDistItem)
EnableAbsLineDist(pLineDistItem->GetValue());
if (pFlagSetItem)
{
if (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 )
EnableNegativeMode();
if (pFlagSetItem)
if (( 0x0010 & pFlagSetItem->GetValue()) == 0x0010 )
EnableContextualMode();
}
}
#define LASTLINEPOS_DEFAULT 0
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 4381441..909376c 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -154,11 +154,8 @@
// draw background self using wallpaper
OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice();
rTargetOutDev.DrawWallpaper(rRect, Wallpaper(pPgView->GetApplicationDocumentColor()));
}
// do paint (unbuffered) and mark repaint end
if(pPgView)
{
// do paint (unbuffered) and mark repaint end
pPgView->DrawLayer(RPT_LAYER_FRONT, &rRenderContext);
pPgView->GetView().EndDrawLayers(*pTargetPaintWindow, true);
}
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index a590326..e37602a 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -564,10 +564,7 @@
if( bUndo )
{
pUndoManager->AddUndoAction(getSdrModelFromSdrPage().GetSdrUndoFactory().CreateUndoNewObject(*pSdrObj));
}
if( bUndo )
{
pUndoManager->AddUndoAction( std::make_unique<UndoObjectPresentationKind>( *pSdrObj ) );
pUndoManager->AddUndoAction( std::make_unique<UndoObjectUserCall>(*pSdrObj) );
}
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx
index 04b50f9..6a987a6 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -136,33 +136,32 @@
const css::geometry::RealPoint2D pos(x,y);
// std::cerr << "Pointer at ("<<pos.X<<","<<pos.Y<<")" << std::endl;
if (xSlideShow.is()) try
if (xSlideShow.is())
{
// std::cerr << "pointer_coordination in the is" << std::endl;
xSlideShow->setProperty(
beans::PropertyValue( "PointerPosition" ,
-1,
makeAny( pos ),
beans::PropertyState_DIRECT_VALUE ) );
}
catch ( Exception& )
{
SAL_WARN( "sdremote", "sd::SlideShowImpl::setPointerPosition(), "
"exception caught: " << exceptionToString( cppu::getCaughtException() ));
}
try
{
// std::cerr << "pointer_coordination in the is" << std::endl;
xSlideShow->setProperty(beans::PropertyValue("PointerPosition", -1, makeAny(pos),
beans::PropertyState_DIRECT_VALUE));
}
catch (Exception&)
{
SAL_WARN("sdremote", "sd::SlideShowImpl::setPointerPosition(), "
"exception caught: "
<< exceptionToString(cppu::getCaughtException()));
}
if (xSlideShow.is()) try
{
xSlideShow->setProperty(
beans::PropertyValue( "PointerVisible" ,
-1,
makeAny( true ),
beans::PropertyState_DIRECT_VALUE ) );
}
catch ( Exception& )
{
SAL_WARN( "sdremote", "sd::SlideShowImpl::setPointerMode(), "
"exception caught: " << exceptionToString( cppu::getCaughtException() ));
try
{
xSlideShow->setProperty(beans::PropertyValue("PointerVisible", -1, makeAny(true),
beans::PropertyState_DIRECT_VALUE));
}
catch (Exception&)
{
SAL_WARN("sdremote", "sd::SlideShowImpl::setPointerMode(), "
"exception caught: "
<< exceptionToString(cppu::getCaughtException()));
}
}
SAL_INFO( "sdremote", "Pointer started, we display the pointer on screen" );
diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx
index 52d92c2..e1e0387 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -127,10 +127,10 @@
if( HasCurrentFunction() )
GetCurrentFunction()->Activate();
ReadFrameViewData(mpFrameView);
}
if( bIsMDIActivate )
ReadFrameViewData( mpFrameView );
GetDocSh()->Connect( this );
}