diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 15:48:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 20:39:00 +0200 |
commit | 1c3929a0a1645e802ee18f9c3d3d380375500c72 (patch) | |
tree | 842d6867a8c67837b15d2ff666e1ad1dd694b401 /embeddedobj/source/general/docholder.cxx | |
parent | 9693b491295336955f7ce8359284b67a82ecf28f (diff) |
loplugin:flatten in embeddedobj,emfio
Change-Id: Ibaf5e1a4db1088322cf8c5e127d328b140406197
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92196
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embeddedobj/source/general/docholder.cxx')
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 4c35ffc156e6..cfc7afcf81a9 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -294,27 +294,27 @@ void DocumentHolder::PlaceFrame( const awt::Rectangle& aNewRect ) "The object does not have windows required for inplace mode!" ); //TODO: may need mutex locking??? - if ( m_xFrame.is() && m_xOwnWindow.is() ) - { - // the frame can be replaced only in inplace mode - frame::BorderWidths aOldWidths; - IntCounterGuard aGuard( m_nNoBorderResizeReact ); + if ( !(m_xFrame.is() && m_xOwnWindow.is()) ) + return; - do - { - aOldWidths = m_aBorderWidths; + // the frame can be replaced only in inplace mode + frame::BorderWidths aOldWidths; + IntCounterGuard aGuard( m_nNoBorderResizeReact ); - awt::Rectangle aHatchRect = AddBorderToArea( aNewRect ); + do + { + aOldWidths = m_aBorderWidths; - ResizeWindows_Impl( aHatchRect ); + awt::Rectangle aHatchRect = AddBorderToArea( aNewRect ); - } while ( aOldWidths.Left != m_aBorderWidths.Left - || aOldWidths.Top != m_aBorderWidths.Top - || aOldWidths.Right != m_aBorderWidths.Right - || aOldWidths.Bottom != m_aBorderWidths.Bottom ); + ResizeWindows_Impl( aHatchRect ); - m_aObjRect = aNewRect; - } + } while ( aOldWidths.Left != m_aBorderWidths.Left + || aOldWidths.Top != m_aBorderWidths.Top + || aOldWidths.Right != m_aBorderWidths.Right + || aOldWidths.Bottom != m_aBorderWidths.Bottom ); + + m_aObjRect = aNewRect; } @@ -1244,30 +1244,30 @@ awt::Rectangle SAL_CALL DocumentHolder::calcAdjustedRectangle( const awt::Rectan void SAL_CALL DocumentHolder::activated( ) { - if ( m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) + if ( !(m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE) ) + return; + + if ( m_pEmbedObj->getCurrentState() != embed::EmbedStates::UI_ACTIVE && + !(m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_NOUIACTIVATE) ) { - if ( m_pEmbedObj->getCurrentState() != embed::EmbedStates::UI_ACTIVE && - !(m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_NOUIACTIVATE) ) + try { - try - { - m_pEmbedObj->changeState( embed::EmbedStates::UI_ACTIVE ); - } - catch ( const css::embed::StateChangeInProgressException& ) - { - // must catch this exception because focus is grabbed while UI activation in doVerb() - } - catch ( const css::uno::Exception& ) - { - // no outgoing exceptions specified here - } + m_pEmbedObj->changeState( embed::EmbedStates::UI_ACTIVE ); } - else + catch ( const css::embed::StateChangeInProgressException& ) { - uno::Reference< frame::XFramesSupplier > xSupp = m_xFrame->getCreator(); - if ( xSupp.is() ) - xSupp->setActiveFrame( m_xFrame ); + // must catch this exception because focus is grabbed while UI activation in doVerb() } + catch ( const css::uno::Exception& ) + { + // no outgoing exceptions specified here + } + } + else + { + uno::Reference< frame::XFramesSupplier > xSupp = m_xFrame->getCreator(); + if ( xSupp.is() ) + xSupp->setActiveFrame( m_xFrame ); } } |