[Libreoffice-commits] core.git: cppu/source cui/source reportdesign/source sd/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 27 19:01:29 UTC 2019


 cppu/source/uno/lbmap.cxx                       |   19 +++-----
 cui/source/tabpages/paragrph.cxx                |    7 +--
 reportdesign/source/ui/report/ReportSection.cxx |    5 --
 sd/source/core/sdpage.cxx                       |    3 -
 sd/source/ui/remotecontrol/Receiver.cxx         |   51 +++++++++++-------------
 sd/source/ui/view/presvish.cxx                  |    4 -
 6 files changed, 40 insertions(+), 49 deletions(-)

New commits:
commit ba57c3e041bb05ef49a3ea7940a4183f09775a18
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat Apr 27 19:57:17 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Apr 27 20:59:34 2019 +0200

    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 at collabora.com>

diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index fc093907c591..6979c74042f9 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -603,21 +603,18 @@ void SAL_CALL uno_getMapping(
 
         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 12372d0127bf..caa7a97b33c3 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -954,27 +954,28 @@ void SvxStdParagraphTabPage::PageCreated(const SfxAllItemSet& aSet)
         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 43814411a25f..909376cd21be 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -154,11 +154,8 @@ void OReportSection::Paint( vcl::RenderContext& rRenderContext, const tools::Rec
             // 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 a5903269364f..e37602afcf9e 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -564,10 +564,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
         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 04b50f9a3936..6a987a67e877 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -136,33 +136,32 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand )
         const css::geometry::RealPoint2D pos(x,y);
         // std::cerr << "Pointer at ("<<pos.X<<","<<pos.Y<<")" << std::endl;
 
-        if (xSlideShow.is()) 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& )
+        if (xSlideShow.is())
         {
-            SAL_WARN( "sdremote", "sd::SlideShowImpl::setPointerMode(), "
-                "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()));
+            }
+
+            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 52d92c222301..e1e03875236b 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -127,10 +127,10 @@ void PresentationViewShell::Activate( bool bIsMDIActivate )
 
         if( HasCurrentFunction() )
             GetCurrentFunction()->Activate();
+
+        ReadFrameViewData(mpFrameView);
     }
 
-    if( bIsMDIActivate )
-        ReadFrameViewData( mpFrameView );
     GetDocSh()->Connect( this );
 }
 


More information about the Libreoffice-commits mailing list