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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Oct 28 00:38:16 UTC 2018


 sd/source/filter/eppt/epptso.cxx |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit fd855967e0474323e22c9d27152d271826a43821
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Oct 28 01:21:32 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Oct 28 02:37:54 2018 +0200

    tdf#120703 PVS: V547 Expression '!pTmp' is always true
    
    Change-Id: Ia31961d65592ebd2718446eaa931aab785b8ba65
    Reviewed-on: https://gerrit.libreoffice.org/62457
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 01122edd607a..f000253a7e2a 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1720,17 +1720,14 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
                     aXIndexAccess( mXShape, css::uno::UNO_QUERY );
                 if ( EnterGroup( aXIndexAccess ) )
                 {
-                    SvMemoryStream* pTmp = nullptr;
-
+                    std::unique_ptr<SvMemoryStream> pTmp;
                     if ( eCa != css::presentation::ClickAction_NONE )
                     {
-                        if ( !pTmp )
-                            pTmp = new SvMemoryStream( 0x200, 0x200 );
+                        pTmp.reset(new SvMemoryStream(0x200, 0x200));
                         ImplWriteClickAction( *pTmp, eCa, bMediaClickAction );
                     }
-                    sal_uInt32 nShapeId = mpPptEscherEx->EnterGroup( &maRect, pTmp );
+                    sal_uInt32 nShapeId = mpPptEscherEx->EnterGroup(&maRect, pTmp.get());
                     aSolverContainer.AddShape( mXShape, nShapeId );
-                    delete pTmp;
                 }
             }
             else
@@ -2697,12 +2694,10 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
             }
             else if ( (mType == "drawing.Table") || (mType == "presentation.Table") )
             {
-                SvMemoryStream* pTmp = nullptr;
                 if ( eCa != css::presentation::ClickAction_NONE )
                 {
-                    if ( !pTmp )
-                        pTmp = new SvMemoryStream( 0x200, 0x200 );
-                    ImplWriteClickAction( *pTmp, eCa, bMediaClickAction );
+                    SvMemoryStream aTmp(0x200, 0x200);
+                    ImplWriteClickAction( aTmp, eCa, bMediaClickAction );
                 }
                 ImplCreateTable( mXShape, aSolverContainer, aPropOpt );
                 continue;


More information about the Libreoffice-commits mailing list