[Libreoffice-commits] core.git: 22 commits - cui/source editeng/source filter/source hwpfilter/source sal/osl sal/qa sc/source sd/source sfx2/source sw/source vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Mar 7 04:19:55 PST 2014


 cui/source/options/optpath.cxx                    |    4 ++--
 editeng/source/editeng/editeng.cxx                |    7 +++----
 editeng/source/editeng/editobj.cxx                |    6 +++---
 filter/source/t602/t602filter.cxx                 |    3 ---
 hwpfilter/source/hbox.cxx                         |    6 +++++-
 sal/osl/unx/tempfile.c                            |    3 +--
 sal/qa/osl/file/osl_File.cxx                      |    1 +
 sc/source/ui/Accessibility/AccessibleDocument.cxx |    2 +-
 sc/source/ui/Accessibility/AccessibleText.cxx     |   11 ++++-------
 sd/source/core/sdpage.cxx                         |    2 +-
 sd/source/ui/func/fuhhconv.cxx                    |    2 +-
 sd/source/ui/unoidl/unomodel.cxx                  |    4 ++--
 sd/source/ui/view/drtxtob.cxx                     |    2 +-
 sd/source/ui/view/viewshel.cxx                    |    3 ++-
 sfx2/source/control/thumbnailviewacc.cxx          |   13 +++++++------
 sw/source/core/frmedt/fefly1.cxx                  |    4 ++--
 sw/source/core/unocore/unotext.cxx                |    5 ++++-
 vcl/source/window/window2.cxx                     |    3 +--
 vcl/unx/gtk/window/gtksalframe.cxx                |    3 +--
 19 files changed, 42 insertions(+), 42 deletions(-)

New commits:
commit c31b821c9fb88bb602cbdbed11e1c402e781de03
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 12:11:10 2014 +0000

    coverity#707890 Uninitialized scalar field
    
    Change-Id: Ia28ff0bbe6fc6ac5a4a7c8b7189077707c6b964f

diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 20edf6a..a672e0c 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -290,7 +290,11 @@ hchar_string DateCode::GetString()
 
 // tab(9)
 
-Tab::Tab(void):HBox(CH_TAB)
+Tab::Tab()
+    : HBox(CH_TAB)
+    , width(0)
+    , leader(0)
+    , dummy(0)
 {
 }
 
commit 291a95eaca8a3576c535fa20262154100d40fe96
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 12:09:08 2014 +0000

    coverity#1078571 Unchecked dynamic_cast
    
    Change-Id: I2270fba51d3f8f856322ed6c6e06217c213b7157

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 2df7ce4..a149de8 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -2090,8 +2090,8 @@ void SwFEShell::SetObjDescription( const OUString& rDescription )
             SwFrmFmt* pFmt = FindFrmFmt( pObj );
             if ( pFmt->Which() == RES_FLYFRMFMT )
             {
-                GetDoc()->SetFlyFrmDescription( *(dynamic_cast<SwFlyFrmFmt*>(pFmt)),
-                                                rDescription );
+                GetDoc()->SetFlyFrmDescription(dynamic_cast<SwFlyFrmFmt&>(*pFmt),
+                                               rDescription);
             }
             else
             {
commit ad4e155fa81536bda2896ffde69a44aafa7c85af
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 12:05:56 2014 +0000

    coverity#735418 Logically dead code
    
    Change-Id: Iad5d984cd923758daee8d5d6d76694586a34b9e0

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 2d86940..3041378 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1835,7 +1835,7 @@ void EditEngine::SetControlWord( sal_uInt32 nWord )
         if ( bSpellingChanged )
         {
             pImpEditEngine->StopOnlineSpellTimer();
-            if ( bSpellingChanged && ( nWord & EE_CNTRL_ONLINESPELLING ) )
+            if (nWord & EE_CNTRL_ONLINESPELLING)
             {
                 // Create WrongList, start timer...
                 sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count();
@@ -1856,10 +1856,9 @@ void EditEngine::SetControlWord( sal_uInt32 nWord )
                     ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
                     const ParaPortion* pPortion = pImpEditEngine->GetParaPortions()[n];
                     bool bWrongs = false;
-                    if (pNode->GetWrongList() != NULL && ( bSpellingChanged || ( nWord & EE_CNTRL_ONLINESPELLING ) ))
+                    if (pNode->GetWrongList() != NULL)
                         bWrongs = !pNode->GetWrongList()->empty();
-                    if ( bSpellingChanged )
-                        pNode->DestroyWrongList();
+                    pNode->DestroyWrongList();
                     if ( bWrongs )
                     {
                         pImpEditEngine->aInvalidRect.Left() = 0;
commit b2c18b7eb7581a41ff51191b2a65e531429ce23a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 12:01:16 2014 +0000

    coverity#735434 Logically dead code
    
    Change-Id: Ie81022b493accdfa300c6b962fcd438adb9ecfd7

diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 1d9550d..98b6b25 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -792,9 +792,6 @@ void T602ImportFilter::Read602()
                 } else {
                     inschr(0x8d);//inschr(' ');
                     if(ch == 0) node = EEND;
-                    else if(ch == '\n') {
-                        if(!pst.willbeeop) par602(false);
-                        node = EOL; }
                     else if(ch < 32) node = SETCH;
                     else node = WRITE;
                 }
commit 18447b0464c24acc94350d4a78d26a06e1dd3235
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:58:50 2014 +0000

    coverity#705831 Dereference before null check
    
    Change-Id: I8403e95cb452f2623a5a0bad63c54a3367b73e8c

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index ff18c4a..2dc2db7 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -465,7 +465,7 @@ sal_Bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurr
         pReplacement->Init();
 
     sal_Bool bResult(false);
-    if (pCurrentChild && pReplacement)
+    if (pReplacement)
     {
         OSL_ENSURE(pCurrentChild->GetXShape().get() == pReplacement->GetXShape().get(), "XShape changes and should be inserted sorted");
         SortedShapes::iterator aItr;
commit 6aeb4981f4c92b1aa1059398d125a5976195b326
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:57:44 2014 +0000

    coverity#705834 Dereference before null check
    
    Change-Id: I130042c2ff5dbaf0afb94d3600c9573d348b1df3

diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 3c02c89..b1a39c8 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1387,9 +1387,8 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
     if (bDataValid)
         return pForwarder;
 
-    if (!maText.isEmpty() && pEditEngine)
+    if (!maText.isEmpty())
     {
-
         if ( mpViewShell  )
         {
             Size aOutputSize;
@@ -1408,8 +1407,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
 
     bDataValid = true;
 
-    if (pEditEngine)
-        pEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
+    pEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
 
     return pForwarder;
 }
commit 4ff02c40b94592cc72540433935ffe259988e979
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:56:55 2014 +0000

    coverity#705833 Dereference before null check
    
    Change-Id: I6532774fb78c1d2cf293163c3bf99e0c52770b65

diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 923cfea..3c02c89 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1620,7 +1620,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
     if (mbDataValid)
         return mpForwarder;
 
-    if (!msText.isEmpty() && mpEditEngine)
+    if (!msText.isEmpty())
     {
 
         if ( mpViewShell  )
@@ -1641,8 +1641,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
 
     mbDataValid = true;
 
-    if (mpEditEngine)
-        mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
+    mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
 
     return mpForwarder;
 }
commit b2a0d91884447734bf67cea349c5596ee8728190
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:54:46 2014 +0000

    coverity#705824 Dereference before null check
    
    Change-Id: Iaf867d92adcc90d90a03dd8b7a353609934d9115

diff --git a/sal/osl/unx/tempfile.c b/sal/osl/unx/tempfile.c
index fcc2902..f11b499 100644
--- a/sal/osl/unx/tempfile.c
+++ b/sal/osl/unx/tempfile.c
@@ -317,8 +317,7 @@ oslFileError SAL_CALL osl_createTempFile(
             rtl_uString_assign(ppustrTempFileURL, temp_file_url);
         }
 
-        if (temp_file_url)
-            rtl_uString_release(temp_file_url);
+        rtl_uString_release(temp_file_url);
 
         rtl_uString_release(temp_file_name);
     }
commit 3454a9b34266a8d370306a4de8178ef263f1621f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:51:12 2014 +0000

    coverity#982453 Dereference after null check
    
    Change-Id: I4d7006ea9212313ef71e0879093d8f0cbc40b34f

diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index b2daf49..f965a74 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -638,7 +638,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
 
 IMPL_LINK( SvxPathTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
 {
-    if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
+    if (!pBar || pBar->GetCurItemId() != ITEMID_TYPE)
         return 0;
 
     HeaderBarItemBits nBits = pBar->GetItemBits(ITEMID_TYPE);
commit 12aab9c087770d2cb056f66d5f0f289d63771edd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:47:24 2014 +0000

    coverity#735831 Dereference after null check
    
    Change-Id: Ic41ed1f547a42668b17ec0c0d35a7cf2054c509c

diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 885130b..c25b658 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2200,7 +2200,7 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
 */
 SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect, bool bInit )
 {
-    ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+    ::svl::IUndoManager* pUndoManager = static_cast<SdDrawDocument*>(pModel)->GetUndoManager();
     const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
 
     if (!pObj && bInit)
commit 78cbc6de1b87134dcc0417537d270d49cbc8de38
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:45:44 2014 +0000

    coverity#735845 Dereference after null check
    
    Change-Id: I8e90d4a005fd40586c8262c35a4b6351ae5a17d0

diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index d5b8854..e228ff2 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -424,7 +424,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
 
 
     // these are disabled in outline-mode
-    if (!mpViewShell->ISA(DrawViewShell))
+    if (!mpViewShell || !mpViewShell->ISA(DrawViewShell))
     {
         rSet.DisableItem( SID_ATTR_PARA_ADJUST_LEFT );
         rSet.DisableItem( SID_ATTR_PARA_ADJUST_RIGHT );
commit 6e07c9885502fe0572761499e790ebf7aedb707d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:44:30 2014 +0000

    coverity#735844 Dereference after null check
    
    Change-Id: I444f545718f0d7b3e1612a1b17b810f93f032bcb

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 1206c87..fb155b0 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1949,7 +1949,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                         }
                         pView->SdrPaintView::CompleteRedraw( pOut, aRegion, &aImplRenderPaintProc );
 
-                        if ( pPDFExtOutDevData )
+                        if ( pPDFExtOutDevData && pPage )
                         {
                             try
                             {
commit 9e93e06529d4d30fdd620117f37341fe881e5786
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:43:41 2014 +0000

    coverity#735843 Dereference after null check
    
    Change-Id: I67909a2bc1ba411b5809a83be72716045034af19

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 4e6f3af..1206c87 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1923,7 +1923,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                             pPV, pPDFExtOutDevData );
 
                         // background color for outliner :o
-                        SdPage* pPage = (SdPage*)pPV->GetPage();
+                        SdPage* pPage = pPV ? (SdPage*)pPV->GetPage() : NULL;
                         if( pPage )
                         {
                             SdrOutliner& rOutl = mpDoc->GetDrawOutliner( NULL );
commit 4c69b0c00fb85a82905be61cba2fc6440344332a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:42:40 2014 +0000

    coverity#735841 Dereference after null check
    
    Change-Id: Ia6dc3065bcf6aa8e1475af8163dc5eefd9ad2f85

diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 3ae568a..d2752d0 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1520,7 +1520,8 @@ bool ViewShell::RelocateToParentWindow (::Window* pParentWindow)
 {
     mpParentWindow = pParentWindow;
 
-    mpParentWindow->SetBackground (Wallpaper());
+    if (mpParentWindow)
+        mpParentWindow->SetBackground (Wallpaper());
 
     if (mpContentWindow.get() != NULL)
         mpContentWindow->SetParent(pParentWindow);
commit 047d71d0dd25ec3bb86cef96af77a609686302bd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:31:37 2014 +0000

    coverity#735836 Dereference after null check
    
    Change-Id: Ia91df4aeec1b632030f0e4d1d0067cdc32e64057

diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx
index bed210c..374ec24 100644
--- a/sd/source/ui/func/fuhhconv.cxx
+++ b/sd/source/ui/func/fuhhconv.cxx
@@ -136,7 +136,7 @@ void FuHangulHanjaConversion::StartConversion( sal_Int16 nSourceLanguage, sal_In
 
     // Due to changing between edit mode, notes mode, and handout mode the
     // view has most likely changed.  Get the new one.
-    mpViewShell = pBase->GetMainViewShell().get();
+    mpViewShell = pBase ? pBase->GetMainViewShell().get() : NULL;
     if (mpViewShell != NULL)
     {
         mpView = mpViewShell->GetView();
commit f02cda1680da4816cae46805a1f0dd86c32ddbb8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:29:59 2014 +0000

    coverity#735847 Dereference after null check
    
    Change-Id: I564d00d279d0b1cfee4eead4b9bc9b6e98a3b0f2

diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx
index dfc274b..93e31bc 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -217,13 +217,14 @@ OUString SAL_CALL ThumbnailViewAcc::getAccessibleName()
     OUString aRet;
 
     if ( mpParent )
-        aRet = mpParent->GetAccessibleName();
-
-    if ( aRet.isEmpty() )
     {
-        Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
-        if ( pLabel && pLabel != mpParent )
-            aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
+        aRet = mpParent->GetAccessibleName();
+        if (aRet.isEmpty())
+        {
+            Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
+            if (pLabel && pLabel != mpParent)
+                aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
+        }
     }
 
     return aRet;
commit c3c9a1c38d45fa12db6298a441c09f3e7dfe57c7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:28:32 2014 +0000

    coverity#735999 Dereference after null check
    
    Change-Id: Icd48e7051fa9eddedcf66c5589cdbd50ec98b843

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 6a00560..9557f7a 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3033,8 +3033,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, SalX11S
 bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent )
 {
 #if !GTK_CHECK_VERSION(3,0,0)
-    if( pSysParent ) // this may be the first system child frame now
-        GetGenericData()->ErrorTrapPush(); // permanantly ignore unruly children's errors
+    GetGenericData()->ErrorTrapPush(); // permanantly ignore unruly children's errors
     createNewWindow( pSysParent->aWindow, (pSysParent->nSize > sizeof(long)) ? pSysParent->bXEmbedSupport : false, m_nXScreen );
     return true;
 #else
commit e65dede0898f052306915534dc6e6eaa3a8fdf70
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:26:09 2014 +0000

    coverity#735992 Dereference after null check
    
    Change-Id: Ib0887c927be3706ac346aaa5e3423e782b5d4723

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index c6e68b9..25b642b 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -138,13 +138,12 @@ bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
 
     // if TestWindow is before ThisWindow, it is in front
     pTempWindow = pTestWindow;
-    do
+    while ( pTempWindow )
     {
         if ( pTempWindow == pThisWindow )
             return true;
         pTempWindow = pTempWindow->mpWindowImpl->mpNext;
     }
-    while ( pTempWindow );
 
     return false;
 }
commit aba1ca55c1888a179f73723f59c751dcf81b6db8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:23:36 2014 +0000

    coverity#735930 Dereference after null check
    
    Change-Id: Id523444331bcdab40d938fde42bd747fc8fa3149

diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 721dda0..5cf2552 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1582,7 +1582,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
     }
     bool bParaAfterInserted = false;
     bool bParaBeforeInserted = false;
-    if (pStartStartNode != pEndStartNode || pStartStartNode != GetStartNode())
+    if (
+        pStartStartNode && pEndStartNode &&
+        (pStartStartNode != pEndStartNode || pStartStartNode != GetStartNode())
+       )
     {
         // todo: if the start/end is in a table then insert a paragraph
         // before/after, move the start/end nodes, then convert and
commit 0dde0ea5b79bf6ae8532f9ad0550a908f29bc253
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:20:10 2014 +0000

    coverity#982454 Dereference after null check
    
    Change-Id: I405db209c9277ba47b26d2a0970f4265e190a7c7

diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 8e8758d..b2daf49 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -667,7 +667,7 @@ IMPL_LINK( SvxPathTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
 
 IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
 {
-    if ( pBar && !pBar->GetCurItemId() )
+    if (!pBar || !pBar->GetCurItemId())
         return 0;
 
     if ( !pBar->IsItemMode() )
commit 9e8ba548cfefc58ac23dffd696048463675b7eb0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:18:49 2014 +0000

    coverity#982456 Dereference after null check
    
    Change-Id: I7222d394c47b73b8a84cd069fed3eb268090a70b

diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index b14771c..10c0004 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -583,17 +583,17 @@ EditTextObjectImpl::EditTextObjectImpl( EditTextObject* pFront, const EditTextOb
     else
     {
         pPool = EditEngine::CreatePool();
-        bOwnerOfPool =  true;
+        bOwnerOfPool = true;
 
     }
 
-    if(!bOwnerOfPool && pPool)
+    if (!bOwnerOfPool)
     {
         // it is sure now that the pool is an EditEngineItemPool
         pPool->AddSfxItemPoolUser(*mpFront);
     }
 
-    if ( bOwnerOfPool && pPool && r.pPool )
+    if (bOwnerOfPool && r.pPool)
         pPool->SetDefaultMetric( r.pPool->GetMetric( DEF_METRIC ) );
 
     aContents.reserve(r.aContents.size());
commit 31045492f0068210851d51751ca27d43c345e55a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 7 11:15:37 2014 +0000

    coverity#982463 Dereference after null check
    
    Change-Id: I46cbcb4091428557c8f9516e15c9be0eb4db27b2

diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index b1aa84b..dabfabe 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1425,6 +1425,7 @@ namespace osl_FileBase
         {
             nError1 = FileBase::createTempFile( pUStr_DirURL, 0, pUStr_FileURL );
             bOK = ( pUStr_FileURL != 0);
+            CPPUNIT_ASSERT(bOK);
             ::osl::File testFile( *pUStr_FileURL );
             nError2 = testFile.open( osl_File_OpenFlag_Create );
             deleteTestFile( *pUStr_FileURL );


More information about the Libreoffice-commits mailing list