diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-21 21:59:54 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-22 08:20:13 +0200 |
commit | f2c8180b7750e55807fe9d0e765e831ed2953c01 (patch) | |
tree | d3731a0ccc9e5427238240d29afb4694c44d1c21 /sd | |
parent | b979e7181ff8c089b7809571791f7f287d01ae83 (diff) |
tdf#120703 (PVS): redundant nullptr check
V668 There is no sense in testing the 'pProgress' pointer against null, as
the memory was allocated using the 'new' operator. The exception will
be generated in the case of memory allocation error.
Change-Id: Ida8c103e5f08d380e5c2de5bc5d269597bd32e30
Reviewed-on: https://gerrit.libreoffice.org/62151
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 95882960479c..affbf5da2af8 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -626,8 +626,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) mpDocSh->SetWaitCursor( false ); std::unique_ptr<SfxProgress> pProgress(new SfxProgress( mpDocSh, SdResId(STR_CREATE_PAGES), nNewPages)); - if( pProgress ) - pProgress->SetState( 0, 100 ); + pProgress->SetState( 0, 100 ); nNewPages = 0; @@ -659,8 +658,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) if( Outliner::HasParaFlag( pSourcePara, ParaFlag::ISPAGE ) ) { nNewPages++; - if( pProgress ) - pProgress->SetState( nNewPages ); + pProgress->SetState( nNewPages ); } pSourcePara = pOutliner->GetParagraph( ++nPos ); |