[Libreoffice-commits] core.git: 17 commits - oox/source sc/source sd/source sw/source

Caolán McNamara caolanm at redhat.com
Sat Jan 24 07:10:40 PST 2015


 oox/source/export/drawingml.cxx      |    4 ++--
 sc/source/ui/drawfunc/drawsh4.cxx    |    7 +++++--
 sc/source/ui/drawfunc/drtxtob2.cxx   |    7 +++++--
 sc/source/ui/view/imapwrap.cxx       |    3 +--
 sd/source/ui/dlg/sdtreelb.cxx        |   25 +++++++++++++++----------
 sd/source/ui/func/fudraw.cxx         |    4 ++--
 sd/source/ui/func/fuoaprms.cxx       |   29 ++++++++++++++++-------------
 sd/source/ui/view/drviews4.cxx       |   21 ++++++++++++++++-----
 sd/source/ui/view/drviews6.cxx       |   35 ++++++++++++++++++++---------------
 sw/source/uibase/shells/drwtxtsh.cxx |    7 +++++--
 sw/source/uibase/shells/textdrw.cxx  |    6 +++++-
 11 files changed, 92 insertions(+), 56 deletions(-)

New commits:
commit 6cfce6ead21a1c6c985d3d79cef6c584abbc7e8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:52:21 2015 +0000

    coverity#1265802 Dereference null return value
    
    Change-Id: I1ad3470410ef3a1f4f06033c89da9adcb640b7e0

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 7fbe700..0d9635b 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1170,9 +1170,8 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel)
  */
 void SdPageObjsTLB::DoDrag()
 {
-    mpDropNavWin = ( mpFrame->HasChildWindow( SID_NAVIGATOR ) ) ?
-                  static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ) :
-                  NULL;
+    SfxChildWindow* pWnd = mpFrame->HasChildWindow(SID_NAVIGATOR) ? mpFrame->GetChildWindow(SID_NAVIGATOR) : NULL;
+    mpDropNavWin = pWnd ? static_cast<SdNavigatorWin*>(pWnd->GetContextWindow(SD_MOD())) : NULL;
 
     if( mpDropNavWin )
     {
commit 58f88c968c94e129630d36e70c6e59ad515ad888
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:50:02 2015 +0000

    coverity#1265804 Dereference null return value
    
    Change-Id: Ie5622275aa5534714001ad04cf0ae4af365b3a9c

diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 09a0f7b..4de97fc 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -40,8 +40,11 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
     sal_uInt16              nId = SvxFontWorkChildWindow::GetChildWindowId();
 
     SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
-    if ( pViewFrm->HasChildWindow(nId) )
-        pDlg = static_cast<SvxFontWorkDialog*>(pViewFrm->GetChildWindow(nId)->GetWindow());
+    if (pViewFrm->HasChildWindow(nId))
+    {
+        SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
+        pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL;
+    }
 
     if ( rMarkList.GetMarkCount() == 1 )
         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
commit 428f51c768e47571ab44abd08923c2fc4442898d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:48:51 2015 +0000

    coverity#1265805 Dereference null return value
    
    Change-Id: I2b09de69fcb0a717562b502f50f6f80e1245f0e4

diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 2fe29bd..ccadc8f 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -244,8 +244,11 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
     const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
 
     SfxViewFrame* pVFrame = GetView().GetViewFrame();
-    if ( pVFrame->HasChildWindow(nId) )
-        pDlg = static_cast<SvxFontWorkDialog*>(pVFrame->GetChildWindow(nId)->GetWindow());
+    if (pVFrame->HasChildWindow(nId))
+    {
+        SfxChildWindow* pWnd = pVFrame->GetChildWindow(nId);
+        pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL;
+    }
 
     if ( rMarkList.GetMarkCount() == 1 )
         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
commit 98e9ac947d5150c0f4272ac0da7f3de35937d1f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:47:52 2015 +0000

    coverity#1265803 Dereference null return value
    
    Change-Id: I4e565d9b5a416e7f4f435c75a715dad09c4e7e26

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 213c4c4..7fbe700 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1262,9 +1262,9 @@ void SdPageObjsTLB::OnDragFinished( sal_uInt8 )
 {
     if( mpFrame->HasChildWindow( SID_NAVIGATOR ) )
     {
-        SdNavigatorWin* pNewNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) );
-
-        if( mpDropNavWin == pNewNavWin)
+        SfxChildWindow* pWnd = mpFrame->GetChildWindow(SID_NAVIGATOR);
+        SdNavigatorWin* pNewNavWin = pWnd ? static_cast<SdNavigatorWin*>(pWnd->GetContextWindow(SD_MOD())) : NULL;
+        if (mpDropNavWin == pNewNavWin)
         {
             MouseEvent aMEvt( mpDropNavWin->GetPointerPosPixel() );
             SvTreeListBox::MouseButtonUp( aMEvt );
commit 66b6f8f77db9d0497ff67d11f102f4160aefa7de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:46:42 2015 +0000

    coverity#1265806 Dereference null return value
    
    Change-Id: Iaf8d1f570b6f343d841327c379d5424ea64cda31

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 769e646..213c4c4 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1120,8 +1120,11 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel)
     SdNavigatorWin* pNavWin = NULL;
     SvTreeListEntry* pEntry = GetEntry(rPosPixel);
 
-    if( mpFrame->HasChildWindow( SID_NAVIGATOR ) )
-        pNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) );
+    if (mpFrame->HasChildWindow(SID_NAVIGATOR))
+    {
+        SfxChildWindow* pWnd = mpFrame->GetChildWindow(SID_NAVIGATOR);
+        pNavWin = pWnd ? static_cast<SdNavigatorWin*>(pWnd->GetContextWindow(SD_MOD())) : NULL;
+    }
 
     if (pEntry != NULL
         && pNavWin !=NULL
commit 3088788c6d122d1e2cfec04c33d4d084a019e782
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:45:11 2015 +0000

    coverity#1265809 Dereference null return value
    
    Change-Id: I9926fa66c99009403e5a4b90e30954f3330bba1c

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 4acf5ed..afd241b 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -288,8 +288,13 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt,
         //If object is marked , the corresponding entry is set true ,
         //else the corresponding entry is set false .
         FreshNavigatrTree();
-        if ( mbPipette )
-            static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->PipetteClicked();
+        if (mbPipette)
+        {
+            SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId());
+            SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
+            if (pBmpMask)
+                pBmpMask->PipetteClicked();
+        }
     }
 }
 
commit c8af68bc5adf093f9df803f6fe0147ac9d116169
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:42:50 2015 +0000

    coverity#1265810 Dereference null return value
    
    Change-Id: I3e99cfd189bae3ed37979dbbb69219b2649a9243

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e1442cd..769e646 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1329,8 +1329,11 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
             SdNavigatorWin* pNavWin = NULL;
             sal_uInt16          nId = SID_NAVIGATOR;
 
-            if( mpFrame->HasChildWindow( nId ) )
-                pNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) );
+            if (mpFrame->HasChildWindow(nId))
+            {
+                SfxChildWindow* pWnd = mpFrame->GetChildWindow(nId);
+                pNavWin = pWnd ? static_cast<SdNavigatorWin*>(pWnd->GetContextWindow(SD_MOD())) : NULL;
+            }
 
             if( pNavWin && ( pNavWin == mpParent ) )
             {
commit a79318470e63059309db4fe6ba92942cfac517a9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:41:33 2015 +0000

    coverity#1265811 Dereference null return value
    
    Change-Id: I975c8c28f00b364f57366ea2847f8bd155c12733

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 4552403..4acf5ed 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -369,7 +369,14 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
 
         ShowMousePosInfo(aRect, pWin);
 
-        if ( mbPipette && GetViewFrame()->HasChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() ) )
+        SvxBmpMask* pBmpMask = NULL;
+        if (mbPipette && GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
+        {
+            SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId());
+            pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
+        }
+
+        if (pBmpMask)
         {
             const long      nStartX = maMousePos.X() - PIPETTE_RANGE;
             const long      nEndX = maMousePos.X() + PIPETTE_RANGE;
@@ -392,8 +399,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
                 }
             }
 
-            static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
-                SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ),
+            pBmpMask->SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ),
                                  (sal_uInt8) ( nGreen / fDiv + .5 ),
                                  (sal_uInt8) ( nBlue / fDiv + .5 ) ) );
         }
commit ce4711afcb02109d4c9e2dc7d9b048ed4abe21ac
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:38:08 2015 +0000

    coverity#1265807 Dereference null return value
    
    Change-Id: I545a4ecee209d4198caebbcf394eccfe113a32a4

diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 8f43c4c..91c61a9 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -208,8 +208,11 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
     sal_uInt16              nId = SvxFontWorkChildWindow::GetChildWindowId();
 
     SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
-    if ( pViewFrm->HasChildWindow(nId) )
-        pDlg = static_cast<SvxFontWorkDialog*>(pViewFrm->GetChildWindow(nId)->GetWindow());
+    if (pViewFrm->HasChildWindow(nId))
+    {
+        SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
+        pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL;
+    }
 
     if ( rMarkList.GetMarkCount() == 1 )
         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
diff --git a/sc/source/ui/view/imapwrap.cxx b/sc/source/ui/view/imapwrap.cxx
index 9ef97dc..ee2c8f8 100644
--- a/sc/source/ui/view/imapwrap.cxx
+++ b/sc/source/ui/view/imapwrap.cxx
@@ -30,9 +30,8 @@ sal_uInt16 ScIMapChildWindowId()
 SvxIMapDlg* ScGetIMapDlg()
 {
     //! pass view frame here and in SVXIMAPDLG()
-
     SfxViewFrame* pViewFrm = SfxViewFrame::Current();
-    if( pViewFrm && pViewFrm->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
+    if (pViewFrm && pViewFrm->HasChildWindow(SvxIMapDlgChildWindow::GetChildWindowId()))
         return SVXIMAPDLG();
     else
         return NULL;
commit a5ce2b6157d08f8576e28e6c2b07f9281a87b252
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:37:03 2015 +0000

    coverity#1265808 Dereference null return value
    
    Change-Id: Ib4ba32315a12a25ed5b9c4df5d6f88ee0400d054

diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 9ceea4d..d35ddef 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -92,8 +92,11 @@ void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
 
     sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
 
-    if ( GetViewFrame()->HasChildWindow(nId) )
-        pDlg = static_cast<SvxFontWorkDialog*>(GetViewFrame()->GetChildWindow(nId)->GetWindow());
+    if (GetViewFrame()->HasChildWindow(nId))
+    {
+        SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId);
+        pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL;
+    }
 
     if ( rMarkList.GetMarkCount() == 1 )
         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
commit 819d7342b250df89505cfa8d1bf12cc693b3b648
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:35:04 2015 +0000

    coverity#1265791 Unchecked return value
    
    Change-Id: I6577fe7a9eeeaadd42db5fe667d0418af9899978

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index b66b78a..3c5c3f3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -868,13 +868,13 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia )
             {
                 if ( aType == GRAPHIC_BITMAP )
                 {
-                    GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
+                    (void)GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
                     sMediaType = "image/png";
                     pExtension = ".png";
                 }
                 else
                 {
-                    GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
+                    (void)GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
                     sMediaType = "image/x-emf";
                     pExtension = ".emf";
                 }
commit 1f22bf4c23f17debb45395d47a8499be9b746c84
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:32:36 2015 +0000

    coverity#1265801 Dereference null return value
    
    Change-Id: I3cde11175ea07c6ce0b2828250fc3d942a41066c

diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index d134041..9ceea4d 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -151,8 +151,10 @@ void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
             AnimationWindow* pAnimWin;
             sal_uInt16 nId = AnimationChildWindow::GetChildWindowId();
 
-            pAnimWin = static_cast<AnimationWindow*>(
-                GetViewFrame()->GetChildWindow(nId)->GetWindow());
+            SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId);
+
+            pAnimWin = pWnd ? static_cast<AnimationWindow*>(
+                GetViewFrame()->GetChildWindow(nId)->GetWindow()) : NULL;
 
             if ( pAnimWin )
             {
commit 32d4c191b1195be1061dfb6055908461e25a28fe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:31:31 2015 +0000

    coverity#1265800 Dereference null return value
    
    Change-Id: Id5966c1f9b51ea47df52ad7a1e69a29a69e1764c

diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx
index ec30e19..11ade2b 100644
--- a/sw/source/uibase/shells/textdrw.cxx
+++ b/sw/source/uibase/shells/textdrw.cxx
@@ -73,10 +73,14 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget,
         if (rMarkList.GetMark(0))
         {
             SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
+            OSL_ENSURE( pUnoCtrl, "not an SdrUnoObj" );
+            if (!pUnoCtrl)
+                return;
+
             uno::Reference< awt::XControlModel >  xControlModel = pUnoCtrl->GetUnoControlModel();
 
             OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
-            if( !xControlModel.is() )
+            if (!xControlModel.is())
                 return;
 
             uno::Reference< beans::XPropertySet >  xPropSet(xControlModel, uno::UNO_QUERY);
commit a28ad8c96a6777fba734a4cc50c4fc56736dbaee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:30:05 2015 +0000

    coverity#1265798 Dereference null return value
    
    Change-Id: Ic4a9a42bafdc72be3de067b5f47dc98f0250f575

diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 20ea07c..ce16629 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -523,7 +523,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
                  mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
         {
             // pipette mode
-            SfxChildWindow* pWnd =  mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId());
+            SfxChildWindow* pWnd = mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId());
             SvxBmpMask* pMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
             if (pMask && pMask->IsEyedropping())
             {
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 9660b44..d134041 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -301,21 +301,21 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
                     }
                 }
 
-                if( bCont )
+                SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(
+                                         SvxBmpMaskChildWindow::GetChildWindowId());
+                SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
+                assert(pBmpMask);
+                if (bCont && pBmpMask)
                 {
                     const Graphic&  rOldGraphic = pNewObj->GetGraphic();
-                    const Graphic   aNewGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow(
-                                                 SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
-                                                 Mask( rOldGraphic ) );
+                    const Graphic   aNewGraphic(pBmpMask->Mask(rOldGraphic));
 
                     if( aNewGraphic != rOldGraphic )
                     {
                         SdrPageView* pPV = mpDrawView->GetSdrPageView();
 
                         pNewObj->SetEmptyPresObj( false );
-                        pNewObj->SetGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow(
-                                             SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
-                                             Mask( pNewObj->GetGraphic() ) );
+                        pNewObj->SetGraphic(pBmpMask->Mask(pNewObj->GetGraphic()));
 
                         OUString aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
                         aStr += " " + SD_RESSTR(STR_EYEDROPPER);
commit 397ca5ca902cbdc0278f3a6efc41a31b2c7d6375
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:25:53 2015 +0000

    coverity#1265797 Dereference null return value
    
    Change-Id: Ief4e7898cfb8b5ab65e6dba39d04306637b776b4

diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index a68fb1a..20ea07c 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -523,8 +523,8 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
                  mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
         {
             // pipette mode
-            SvxBmpMask* pMask = static_cast<SvxBmpMask*>( mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow() );
-
+            SfxChildWindow* pWnd =  mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId());
+            SvxBmpMask* pMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
             if (pMask && pMask->IsEyedropping())
             {
                 bDefPointer = false;
commit 47b18f57f8c45f0dbb9244be4574f6b4e19f13d8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:22:32 2015 +0000

    coverity#1265795 Dereference null return value
    
    Change-Id: I3ad219b1729a7a4b2f3e52cd6ac0243a419bc632

diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index bf3e3d8..9660b44 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -343,10 +343,10 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
 
     if ( GetViewFrame()->HasChildWindow( nId ) )
     {
-        SvxBmpMask* pDlg = static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
-
-        if ( pDlg->NeedsColorList() )
-            pDlg->SetColorList( GetDoc()->GetColorList() );
+        SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId);
+        SvxBmpMask* pDlg = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL;
+        if (pDlg && pDlg->NeedsColorList())
+            pDlg->SetColorList(GetDoc()->GetColorList());
     }
 
     if ( rMarkList.GetMarkCount() == 1 )
commit 3768b305c062086aed1719d8ce1022f8af63f6d5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 24 14:20:03 2015 +0000

    coverity#704751 Explicit null dereferenced
    
    Change-Id: If95204a7e8e47ef62599da3374b6a2908e495493

diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index 8ceff8b..1959915 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -654,21 +654,24 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
                 pRunningObj = pObject1;
             }
 
-            DBG_ASSERT(pPath, "no curve found");
+            assert(pRunningObj && pPath && "no curve found");
 
             // push the running object to the end of the curve
-            Rectangle aCurRect(pRunningObj->GetLogicRect());
-            Point     aCurCenter(aCurRect.Center());
-            const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPath->GetPathPoly();
-            sal_uInt32 nNoOfPolygons(rPolyPolygon.count());
-            const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1L));
-            sal_uInt32 nPoints(aPolygon.count());
-            const ::basegfx::B2DPoint aNewB2DCenter(aPolygon.getB2DPoint(nPoints - 1L));
-            const Point aNewCenter(FRound(aNewB2DCenter.getX()), FRound(aNewB2DCenter.getY()));
-            Size aDistance(aNewCenter.X() - aCurCenter.X(), aNewCenter.Y() - aCurCenter.Y());
-            pRunningObj->Move(aDistance);
-
-            pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoMoveObject( *pRunningObj, aDistance));
+            if (pRunningObj)
+            {
+                Rectangle aCurRect(pRunningObj->GetLogicRect());
+                Point     aCurCenter(aCurRect.Center());
+                const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPath->GetPathPoly();
+                sal_uInt32 nNoOfPolygons(rPolyPolygon.count());
+                const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1L));
+                sal_uInt32 nPoints(aPolygon.count());
+                const ::basegfx::B2DPoint aNewB2DCenter(aPolygon.getB2DPoint(nPoints - 1L));
+                const Point aNewCenter(FRound(aNewB2DCenter.getX()), FRound(aNewB2DCenter.getY()));
+                Size aDistance(aNewCenter.X() - aCurCenter.X(), aNewCenter.Y() - aCurCenter.Y());
+                pRunningObj->Move(aDistance);
+
+                pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoMoveObject( *pRunningObj, aDistance));
+            }
         }
 
         for (size_t nObject = 0; nObject < nCount; ++nObject)


More information about the Libreoffice-commits mailing list