Kaydet (Commit) 8c809777 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#705886 Dereference before null check

Change-Id: I707dcfb324760a7058cb0abcb2eca7819e0568e4
üst 70f90c80
...@@ -702,7 +702,7 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject ...@@ -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 // sometimes applications reconnect clients on shutting down because it happens in their Paint methods
return; return;
...@@ -929,7 +929,6 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) ...@@ -929,7 +929,6 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
if ( !nError ) if ( !nError )
{ {
if ( m_pViewSh )
m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true); m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true);
try try
{ {
...@@ -982,15 +981,12 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) ...@@ -982,15 +981,12 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
//TODO/LATER: better error handling //TODO/LATER: better error handling
} }
if ( m_pViewSh )
{
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
pFrame->GetTopFrame().LockResize_Impl(false); pFrame->GetTopFrame().LockResize_Impl(false);
pFrame->GetTopFrame().Resize(); pFrame->GetTopFrame().Resize();
} }
} }
} }
}
if( nError ) if( nError )
ErrorHandler::HandleError( nError ); ErrorHandler::HandleError( nError );
...@@ -1050,13 +1046,12 @@ void SfxInPlaceClient::DeactivateObject() ...@@ -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 ) if ( m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
{ {
m_pImp->m_xObject->changeState( embed::EmbedStates::INPLACE_ACTIVE ); m_pImp->m_xObject->changeState( embed::EmbedStates::INPLACE_ACTIVE );
if ( bHasFocus && m_pViewSh ) if (bHasFocus)
m_pViewSh->GetWindow()->GrabFocus(); m_pViewSh->GetWindow()->GrabFocus();
} }
else else
...@@ -1069,14 +1064,11 @@ void SfxInPlaceClient::DeactivateObject() ...@@ -1069,14 +1064,11 @@ void SfxInPlaceClient::DeactivateObject()
m_pImp->m_xObject->changeState( embed::EmbedStates::RUNNING ); m_pImp->m_xObject->changeState( embed::EmbedStates::RUNNING );
} }
if ( m_pViewSh )
{
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
SfxViewFrame::SetViewFrame( pFrame ); SfxViewFrame::SetViewFrame( pFrame );
pFrame->GetTopFrame().LockResize_Impl(false); pFrame->GetTopFrame().LockResize_Impl(false);
pFrame->GetTopFrame().Resize(); pFrame->GetTopFrame().Resize();
} }
}
catch (com::sun::star::uno::Exception& ) catch (com::sun::star::uno::Exception& )
{} {}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment