[Libreoffice-commits] core.git: 14 commits - editeng/source filter/source sd/source sfx2/source svx/source sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Sat Mar 22 09:50:20 PDT 2014


 editeng/source/editeng/impedit.cxx          |    2 +-
 filter/source/pdf/impdialog.cxx             |    2 +-
 sd/source/ui/view/drtxtob.cxx               |    2 +-
 sd/source/ui/view/drviews1.cxx              |    4 ++--
 sd/source/ui/view/drviews4.cxx              |    2 +-
 sfx2/source/dialog/dockwin.cxx              |    3 +--
 svx/source/svdraw/svdedxv.cxx               |    2 +-
 sw/source/core/crsr/viscrs.cxx              |    4 ++--
 sw/source/core/layout/ftnfrm.cxx            |    3 ++-
 sw/source/core/undo/unredln.cxx             |    3 +--
 sw/source/core/view/viewimp.cxx             |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx |    3 ++-
 vcl/source/font/PhysicalFontCollection.cxx  |    1 +
 vcl/source/gdi/print3.cxx                   |    2 +-
 14 files changed, 18 insertions(+), 17 deletions(-)

New commits:
commit 754fe6fa053ee03e44237d626667291fd884423a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:36:02 2014 +0000

    coverity#705873 Dereference before null check
    
    Change-Id: I50a2642d754324e49d265c9eff13233fd181b75b

diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index edb0736..0d48df4 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -390,7 +390,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
 
             case SID_THES:
             {
-                if( mpView && mpView->GetTextEditOutlinerView() )
+                if (mpView->GetTextEditOutlinerView())
                 {
                     EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();
                     OUString        aStatusVal;
commit f2aac4fdacd670c7c4eeb2b7e132bc69ebc3ac61
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:32:20 2014 +0000

    coverity#705875 Dereference before null check
    
    Change-Id: I83af9cbf298c26f9cd9c9fe0a5bd576fbf65d03e

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 230497b..462992c 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -851,8 +851,8 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
                 {
                     SdrPageView* pPV = mpDrawView->GetSdrPageView();
 
-                    SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage());
-                    if (pPV
+                    SdPage* pCurrentPage = pPV ? dynamic_cast<SdPage*>(pPV->GetPage()) : NULL;
+                    if (pCurrentPage
                         && pNewPage == pCurrentPage
                         && maTabControl.GetPageText(nSelectedPage+1).equals(pNewPage->GetName()))
                     {
commit 3cd160957c236d21ce9608bdc64d420a5f51ce8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:29:42 2014 +0000

    coverity#705876 Dereference before null check
    
    Change-Id: If18649ff83b7127054171f59965a66ddb27b7363

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 0141322..14cffd3 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -340,7 +340,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
         // Since the next MouseMove may execute a IsSolidDraggingNow() in
         // SdrCreateView::MovCreateObj and there the ApplicationBackgroundColor
         // is needed it is necessary to set it here.
-        if(mpDrawView!=NULL && GetDoc()!=NULL)
+        if (GetDoc())
         {
             svtools::ColorConfig aColorConfig;
             Color aFillColor;
commit 5a7e3f67f15d6eac1cf7319f57eafbbce321e6f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:27:38 2014 +0000

    coverity#705885 Dereference before null check
    
    Change-Id: I4e032dc9b77b98cc5981f812958667fc908993da

diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index a75af8c..bc42133 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -619,8 +619,7 @@ void SfxDockingWindow::ToggleFloatingMode()
     pImp->SetDockAlignment(GetAlignment());
 
     // Dock or undock SfxChildWindow correctly.
-    if ( pMgr )
-        pWorkWin->ConfigChild_Impl( eIdent, SFX_TOGGLEFLOATMODE, pMgr->GetType() );
+    pWorkWin->ConfigChild_Impl( eIdent, SFX_TOGGLEFLOATMODE, pMgr->GetType() );
 }
 
 
commit 78d382066a0437dca9e4e13668f99b08c27b78b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:23:06 2014 +0000

    coverity#705913 Dereference before null check
    
    Change-Id: I2f025ede234cfbea4f6422001d1dcfb1b8e73a6f

diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index a6f349b..40b7954 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -691,12 +691,12 @@ void SwShellTableCrsr::FillRects()
         const SwTableNode* pSelTblNd = pSttNd->FindTableNode();
 
         SwNodeIndex aIdx( *pSttNd );
-           SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, true, false );
+        SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, true, false );
 
         // table in table
         // (see also lcl_FindTopLevelTable in unoobj2.cxx for a different
         // version to do this)
-        const SwTableNode* pCurTblNd = pCNd->FindTableNode();
+        const SwTableNode* pCurTblNd = pCNd ? pCNd->FindTableNode() : NULL;
         while ( pSelTblNd != pCurTblNd && pCurTblNd )
         {
             aIdx = pCurTblNd->EndOfSectionIndex();
commit 15a26f0a389be09b4655774f3734e59bd9684ee7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:14:02 2014 +0000

    coverity#705933 Dereference before null check
    
    Change-Id: I5812d4223b362d4df54b29de6285b3dc3ba572f8

diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 0de8f0e..beacc1c 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -237,7 +237,7 @@ void SwViewImp::MakeDrawView()
 
         // #i68597# If document is read-only, we will not profit from overlay,
         // so switch it off.
-        if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
+        if (pDrawView->IsBufferedOverlayAllowed())
         {
             if(pSwViewOption->IsReadonly())
             {
commit 51452b7afe858139076010decbe04758321a8396
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:06:35 2014 +0000

    coverity#705969 Dereference before null check
    
    Change-Id: Icb19931bb529e6c2b98621a603cdb86011d68a9e

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 350bfdc..be3dc9c 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -716,7 +716,7 @@ bool Printer::StartJob( const OUString& i_rJobName, boost::shared_ptr<vcl::Print
 
             if( bError )
             {
-                mnError = ImplSalPrinterErrorCodeToVCL( mpPrinter->GetErrorCode() );
+                mnError = mpPrinter ? ImplSalPrinterErrorCodeToVCL(mpPrinter->GetErrorCode()) : 0;
                 if ( !mnError )
                     mnError = PRINTER_GENERALERROR;
                 i_pController->setJobState( mnError == PRINTER_ABORT
commit 901f3f76bc48614ffca98cacf98afd0b1967139f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:03:33 2014 +0000

    coverity#736772 Dereference before null check
    
    Change-Id: Idf973cb888c7ac7a3e33aa2fdec0e25515b1feca

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index ccb72f0..c4ff073 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1563,7 +1563,7 @@ void ImpEditView::dragGestureRecognized(const ::com::sun::star::datatransfer::dn
             GetEditSelection() = aCopySel;
             DrawSelection();
             sal_Bool bGotoCursor = DoAutoScroll();
-            sal_Bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode();
+            sal_Bool bForceCursor = sal_False;
             ShowCursor( bGotoCursor, bForceCursor );
         }
         else if ( IsBulletArea( aMousePos, &nPara ) )
commit 3f50dfa1aa99039fa65a3c55cc619a3f35873e66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 16:00:46 2014 +0000

    coverity#736776 Dereference before null check
    
    Change-Id: Ifd666fe1b71087ab8c5a20f1bd002277fe8f05da

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 1c18bce..b80d9d5 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1397,7 +1397,7 @@ void ImpPDFTabLinksPage::SetFilterConfigItem( const  ImpPDFTabDialog* paParent )
     // and set the link action accordingly
     // PDF/A-1 doesn't allow launch action on links
 
-    ImpPDFTabGeneralPage* pGeneralPage = paParent ? paParent->getGeneralPage() : NULL;
+    ImpPDFTabGeneralPage* pGeneralPage = paParent->getGeneralPage();
     if (pGeneralPage)
         ImplPDFALinkControl(!pGeneralPage->mpCbPDFA1b->IsChecked());
 }
commit a7f6cca3b3a7104570af5ab4b09830af3041887a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 15:58:35 2014 +0000

    coverity#736831 Dereference before null check
    
    Change-Id: I1c7a7b0d0ded11a18aa89df167a39b374520eb36

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 76de86b..430dc18 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -716,7 +716,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
 #endif
             pTextEditOutliner->ClearModifyFlag();
 
-            if(pWin && pTextObj->IsFitToSize())
+            if (pTextObj->IsFitToSize())
             {
                 pWin->Invalidate(aTextEditArea);
             }
commit 4c02b7d0cd6bcde7b2d0c26c34056ea6a00c170d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 15:56:00 2014 +0000

    coverity#736847 Dereference before null check
    
    Change-Id: I83025065fd69a50ec06a9d1ed5fdd5ed0242bce0

diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 52d5a4d..098d738 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1768,7 +1768,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm*   _pRef,
 
     bool bFound = false;
 
-    while ( _pFtn )
+    do
     {
         // Search for the next footnote in this column/page so that
         // we do not start from zero again after cutting one footnote.
@@ -1876,6 +1876,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm*   _pRef,
         else
             break;
     }
+    while ( _pFtn );
 }
 
 void SwFtnBossFrm::_MoveFtns( SwFtnFrms &rFtnArr, sal_Bool bCalc )
commit f645acbe91207502df56eb395efc80d92e24a73c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 15:30:42 2014 +0000

    coverity#736852 Dereference before null check
    
    Change-Id: I457fbd64af652efb902959b27696069b42665f46

diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 7fd9b58..96f7bc2 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -489,8 +489,7 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
 
         SwRangeRedline* pTmp = new SwRangeRedline( *pRedlData, *pPam );
         ((SwRedlineTbl&)pDoc->GetRedlineTbl()).Insert( pTmp );
-        if (pTmp) // #i19649#
-            pTmp->InvalidateRange();
+        pTmp->InvalidateRange();
     }
 
     SetPaM(*pPam, true);
commit de02912bb0a3f14ab6a1186719b53121add3b0ed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 15:23:40 2014 +0000

    coverity#736854 Dereference before null check
    
    Change-Id: I123887938735eb14e8ad4450f6d01b3b352f1b5e

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 6aaba7c..f9b8e71 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3512,9 +3512,10 @@ static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, const Size &rOrig, con
     unsigned long nSize, const RtfExport& rExport, SvStream *pStream = 0 )
 {
     OStringBuffer aRet;
-    bool bIsWMF = std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0;
     if (pBLIPType && nSize && pGraphicAry)
     {
+        bool bIsWMF = std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0;
+
         aRet.append("{" OOO_STRING_SVTOOLS_RTF_PICT);
 
         if( pFlyFrmFmt )
commit 83f3d617b3d9ee4d7829c2b39a882c1466d6e952
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 22 14:54:42 2014 +0000

    fix higher debug level builds
    
    Change-Id: Ie8225ad476c43cbff2ee8fb0f3178b3cc4662ac9

diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 6dcecc5..5e82caf 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -22,6 +22,7 @@
 #include <vector>
 
 #include <i18nlangtag/mslangid.hxx>
+#include <tools/debug.hxx>
 
 #include <config_graphite.h>
 #if ENABLE_GRAPHITE


More information about the Libreoffice-commits mailing list