[Libreoffice-commits] core.git: 3 commits - sfx2/source svx/source

Caolán McNamara caolanm at redhat.com
Thu Mar 20 08:39:09 PDT 2014


 sfx2/source/toolbox/tbxitem.cxx                                       |    4 +
 sfx2/source/view/ipclient.cxx                                         |   30 +++-------
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |    2 
 3 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit c678b78c03212d4c9d3aa686afbaf2defb521881
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 20 14:39:00 2014 +0000

    coverity#705908 Dereference before null check
    
    Change-Id: Ieec81451bf486f728c0867c8a68dc99e98e62192

diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 30b2b20..63e11d0 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -719,7 +719,7 @@ IMPL_LINK_NOARG(ChineseDictionaryDialog, ModifyHdl)
     DictionaryList& rReverse = getReverseDictionary();
 
     DictionaryEntry* pE = rActive.getFirstSelectedEntry();
-    if( pE->m_aTerm != aTerm )
+    if( pE && pE->m_aTerm != aTerm )
         return 0;
 
     if( pE )
commit 8c809777e6ed3deb4b02a28c6dc45aea9aef1d8f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 20 14:37:50 2014 +0000

    coverity#705886 Dereference before null check
    
    Change-Id: I707dcfb324760a7058cb0abcb2eca7819e0568e4

diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 3d51f9a..8ef240e 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -702,7 +702,7 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject
         }
     }
 
-    if ( !m_pViewSh || m_pViewSh->GetViewFrame()->GetFrame().IsClosing_Impl() )
+    if ( m_pViewSh->GetViewFrame()->GetFrame().IsClosing_Impl() )
         // sometimes applications reconnect clients on shutting down because it happens in their Paint methods
         return;
 
@@ -929,8 +929,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
             if ( !nError )
             {
 
-                if ( m_pViewSh )
-                    m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true);
+                m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true);
                 try
                 {
                     m_pImp->m_xObject->setClientSite( m_pImp->m_xClient );
@@ -982,12 +981,9 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
                     //TODO/LATER: better error handling
                 }
 
-                if ( m_pViewSh )
-                {
-                    SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
-                    pFrame->GetTopFrame().LockResize_Impl(false);
-                    pFrame->GetTopFrame().Resize();
-                }
+                SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
+                pFrame->GetTopFrame().LockResize_Impl(false);
+                pFrame->GetTopFrame().Resize();
             }
         }
     }
@@ -1050,13 +1046,12 @@ void SfxInPlaceClient::DeactivateObject()
                 }
             }
 
-            if ( m_pViewSh )
-                m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true);
+            m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true);
 
             if ( m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
             {
                 m_pImp->m_xObject->changeState( embed::EmbedStates::INPLACE_ACTIVE );
-                if ( bHasFocus && m_pViewSh )
+                if (bHasFocus)
                     m_pViewSh->GetWindow()->GrabFocus();
             }
             else
@@ -1069,13 +1064,10 @@ void SfxInPlaceClient::DeactivateObject()
                     m_pImp->m_xObject->changeState( embed::EmbedStates::RUNNING );
             }
 
-            if ( m_pViewSh )
-            {
-                SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
-                SfxViewFrame::SetViewFrame( pFrame );
-                pFrame->GetTopFrame().LockResize_Impl(false);
-                pFrame->GetTopFrame().Resize();
-            }
+            SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
+            SfxViewFrame::SetViewFrame( pFrame );
+            pFrame->GetTopFrame().LockResize_Impl(false);
+            pFrame->GetTopFrame().Resize();
         }
         catch (com::sun::star::uno::Exception& )
         {}
commit 70f90c80e3aa8936558f25d9be742e13e7c49e2d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 20 14:33:55 2014 +0000

    coverity#735668 Dereference after null check
    
    Change-Id: Ie7fbc0508ab30c35c52508869367f553b75553e0

diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 9e30206..866a3bc 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -933,6 +933,7 @@ void SfxToolBoxControl::StateChanged
     switch ( eState )
     {
         case SFX_ITEM_AVAILABLE:
+        if ( pState )
         {
             if ( pState->ISA(SfxBoolItem) )
             {
@@ -951,14 +952,15 @@ void SfxToolBoxControl::StateChanged
             }
             else if ( pImpl->bShowString && pState->ISA(SfxStringItem) )
                 pImpl->pBox->SetItemText(nId, ((const SfxStringItem*)pState)->GetValue() );
-            break;
         }
+        break;
 
         case SFX_ITEM_DONTCARE:
         {
             eTri = TRISTATE_INDET;
             nItemBits |= TIB_CHECKABLE;
         }
+        break;
     }
 
     pImpl->pBox->SetItemState( GetId(), eTri );


More information about the Libreoffice-commits mailing list