summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-10 16:19:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-11 01:16:33 +0000
commitffe060e954d172f8603a4e9f625445e49132c7bf (patch)
tree4a939673cd597c0812261fe28da2103526ac51a2 /sd
parentd59358ee28f0cd3e1eb56a0a923f165304fc17c9 (diff)
V668 no sense in testing the result of new against null
Change-Id: I7783d96e40de7a8df794f143d2c7830bf3314218
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/eppt/eppt.cxx28
-rw-r--r--sd/source/filter/ppt/pptin.cxx39
2 files changed, 26 insertions, 41 deletions
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index c5e4b2feac53..4c98f0beca82 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -1453,17 +1453,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL ExportPPT( const std::vector<
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd,
SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags )
{
- PPTWriter* pPPTWriter;
- bool bStatus = false;
-
- pPPTWriter = new PPTWriter( rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags );
- if ( pPPTWriter )
- {
- pPPTWriter->exportPPT(rMediaData);
- bStatus = pPPTWriter->IsValid();
- delete pPPTWriter;
- }
-
+ PPTWriter* pPPTWriter = new PPTWriter( rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags );
+ pPPTWriter->exportPPT(rMediaData);
+ bool bStatus = pPPTWriter->IsValid();
+ delete pPPTWriter;
return bStatus;
}
@@ -1486,14 +1479,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL SaveVBA( SfxObjectShell& rDocS
if ( nLen )
{
char* pTemp = new char[ nLen ];
- if ( pTemp )
- {
- xTemp->Seek( STREAM_SEEK_TO_BEGIN );
- xTemp->Read( pTemp, nLen );
- pBas = new SvMemoryStream( pTemp, nLen, StreamMode::READ );
- pBas->ObjectOwnsMemory( true );
- return true;
- }
+ xTemp->Seek( STREAM_SEEK_TO_BEGIN );
+ xTemp->Read( pTemp, nLen );
+ pBas = new SvMemoryStream( pTemp, nLen, StreamMode::READ );
+ pBas->ObjectOwnsMemory( true );
+ return true;
}
}
}
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index ca8ba0d12922..88f5f4bef69c 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -853,8 +853,7 @@ bool ImplSdPPTImport::Import()
}
}
}
- if( pStbMgr )
- pStbMgr->SetState( nImportedPages++ );
+ pStbMgr->SetState( nImportedPages++ );
}
// importing slide pages
@@ -984,8 +983,7 @@ bool ImplSdPPTImport::Import()
static_cast<SdrPageObj*>(pPageObj)->SetReferencedPage(pSdrModel->GetPage(( nPage << 1 ) + 1));
}
- if( pStbMgr )
- pStbMgr->SetState( nImportedPages++ );
+ pStbMgr->SetState( nImportedPages++ );
}
}
else
@@ -1257,30 +1255,27 @@ bool ImplSdPPTImport::Import()
if ( pList )
{
SdCustomShow* pSdCustomShow = new SdCustomShow( mpDoc );
- if ( pSdCustomShow )
+ pSdCustomShow->SetName( aCuShow );
+ sal_uInt32 nFound = 0;
+ for ( sal_uInt32 nS = 0; nS < nSCount; nS++ )
{
- pSdCustomShow->SetName( aCuShow );
- sal_uInt32 nFound = 0;
- for ( sal_uInt32 nS = 0; nS < nSCount; nS++ )
+ sal_uInt32 nPageNumber;
+ rStCtrl.ReadUInt32( nPageNumber );
+ sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
+ if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
{
- sal_uInt32 nPageNumber;
- rStCtrl.ReadUInt32( nPageNumber );
- sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
- if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
+ SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
+ if ( pPage )
{
- SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
- if ( pPage )
- {
- pSdCustomShow->PagesVector().push_back( pPage );
- nFound++;
- }
+ pSdCustomShow->PagesVector().push_back( pPage );
+ nFound++;
}
}
- if ( nFound )
- pList->push_back( pSdCustomShow );
- else
- delete pSdCustomShow;
}
+ if ( nFound )
+ pList->push_back( pSdCustomShow );
+ else
+ delete pSdCustomShow;
}
}
}