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,8 +929,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) ...@@ -929,8 +929,7 @@ 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
{ {
m_pImp->m_xObject->setClientSite( m_pImp->m_xClient ); m_pImp->m_xObject->setClientSite( m_pImp->m_xClient );
...@@ -982,12 +981,9 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) ...@@ -982,12 +981,9 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
//TODO/LATER: better error handling //TODO/LATER: better error handling
} }
if ( m_pViewSh ) SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
{ pFrame->GetTopFrame().LockResize_Impl(false);
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); pFrame->GetTopFrame().Resize();
pFrame->GetTopFrame().LockResize_Impl(false);
pFrame->GetTopFrame().Resize();
}
} }
} }
} }
...@@ -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,13 +1064,10 @@ void SfxInPlaceClient::DeactivateObject() ...@@ -1069,13 +1064,10 @@ 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::SetViewFrame( pFrame );
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); pFrame->GetTopFrame().LockResize_Impl(false);
SfxViewFrame::SetViewFrame( pFrame ); pFrame->GetTopFrame().Resize();
pFrame->GetTopFrame().LockResize_Impl(false);
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