[Libreoffice-commits] core.git: dbaccess/qa reportdesign/source sc/source sw/source

Caolán McNamara caolanm at redhat.com
Tue Mar 10 03:48:58 PDT 2015


 dbaccess/qa/unit/embeddeddb_performancetest.cxx |   11 +----------
 reportdesign/source/ui/report/ViewsWindow.cxx   |   17 +++++++----------
 sc/source/filter/xcl97/XclExpChangeTrack.cxx    |    3 ---
 sw/source/filter/ww8/ww8scan.cxx                |    5 +++--
 sw/source/ui/dialog/swdlgfact.cxx               |    4 +---
 5 files changed, 12 insertions(+), 28 deletions(-)

New commits:
commit 95af5f51fa6c7a0129360bb9df687fb8660fd3c9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 10 09:47:02 2015 +0000

    V668 no sense in testing the result of new against null
    
    Change-Id: I85993df91bd14966f9175c356966fbd8eb1a927d

diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
index 1eebc22..a639d72 100644
--- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx
+++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
@@ -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(
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index c849571..730b372 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -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;
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 2989f20..e90ebfa 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -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();
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 22d93f1..8c4f828 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -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)
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 8bc1190..a64cb08 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -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)


More information about the Libreoffice-commits mailing list