Kaydet (Commit) 95af5f51 authored tarafından Caolán McNamara's avatar Caolán McNamara

V668 no sense in testing the result of new against null

Change-Id: I85993df91bd14966f9175c356966fbd8eb1a927d
üst 1bb61406
......@@ -129,16 +129,7 @@ SvFileStream* EmbeddedDBPerformanceTest::getWordListStream()
{
OUString wlPath;
createFileURL("wordlist", wlPath);
SvFileStream *pFile(new SvFileStream(wlPath, StreamMode::READ));
if (!pFile)
{
fprintf(stderr, "Please ensure the wordlist is present\n");
CPPUNIT_ASSERT(false);
}
return pFile;
return new SvFileStream(wlPath, StreamMode::READ);
}
void EmbeddedDBPerformanceTest::printTimes(
......
......@@ -1011,18 +1011,15 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _
if ( &rView != &_rSection )
{
SdrObject *pNewObj = new SdrUnoObj(OUString("com.sun.star.form.component.FixedText"));
if (pNewObj)
{
pNewObj->SetLogicRect(_aRect);
pNewObj->SetLogicRect(_aRect);
pNewObj->Move(Size(0, aNewPos.Y()));
bool bChanged = rView.GetModel()->IsChanged();
rReportSection.getPage()->InsertObject(pNewObj);
rView.GetModel()->SetChanged(bChanged);
m_aBegDragTempList.push_back(pNewObj);
pNewObj->Move(Size(0, aNewPos.Y()));
bool bChanged = rView.GetModel()->IsChanged();
rReportSection.getPage()->InsertObject(pNewObj);
rView.GetModel()->SetChanged(bChanged);
m_aBegDragTempList.push_back(pNewObj);
rView.MarkObj( pNewObj, rView.GetSdrPageView() );
}
rView.MarkObj( pNewObj, rView.GetSdrPageView() );
}
const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
aNewPos.Y() -= nSectionHeight;
......
......@@ -1546,9 +1546,6 @@ ScChangeTrack* XclExpChangeTrack::CreateTempChangeTrack()
// create empty document
pTempDoc = new ScDocument;
OSL_ENSURE( pTempDoc, "XclExpChangeTrack::CreateTempChangeTrack - no temp document" );
if( !pTempDoc )
return NULL;
// adjust table count
SCTAB nOrigCount = GetDoc().GetTableCount();
......
......@@ -2884,9 +2884,10 @@ bool WW8PLCFx_Fc_FKP::NewFkp()
pFkp = *aIter;
pFkp->Reset(GetStartFc());
}
else if (0 != (pFkp = new WW8Fkp(GetFIBVersion(), pFKPStrm, pDataStrm, nPo,
pFkpSizeTab[ ePLCF ], ePLCF, GetStartFc())))
else
{
pFkp = new WW8Fkp(GetFIBVersion(), pFKPStrm, pDataStrm, nPo,
pFkpSizeTab[ ePLCF ], ePLCF, GetStartFc());
maFkpCache.push_back(pFkp);
if (maFkpCache.size() > eMaxCache)
......
......@@ -987,9 +987,7 @@ AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg(
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( vcl::Window *pParent )
{
Dialog* pDlg = new SwTitlePageDlg( pParent );
if ( pDlg )
return new VclAbstractDialog_Impl( pDlg );
return 0;
return new VclAbstractDialog_Impl( pDlg );
}
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment