Kaydet (Commit) 5f12d6d4 authored tarafından Caolán McNamara's avatar Caolán McNamara

loplugin: what is it with the weird-ass else placement in framework

Change-Id: I81809a80242457147dba716daa92b83726f732ba
üst 2a777a10
...@@ -805,8 +805,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl ...@@ -805,8 +805,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
// It doesn't matter if we have a valid parent or not. User ask for him and get it. // It doesn't matter if we have a valid parent or not. User ask for him and get it.
// An empty result is a valid result too. // An empty result is a valid result too.
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
else else if ( sTargetFrameName==SPECIALTARGET_PARENT )
if ( sTargetFrameName==SPECIALTARGET_PARENT )
{ {
xTarget = xParent; xTarget = xParent;
} }
...@@ -816,13 +815,11 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl ...@@ -816,13 +815,11 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
// If we are not the top frame in this hierarchy, we must forward request to our parent. // If we are not the top frame in this hierarchy, we must forward request to our parent.
// Otherwhise we must return ourself. // Otherwhise we must return ourself.
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
else else if ( sTargetFrameName==SPECIALTARGET_TOP )
if ( sTargetFrameName==SPECIALTARGET_TOP )
{ {
if (bIsTopFrame) if (bIsTopFrame)
xTarget = this; xTarget = this;
else else if (xParent.is()) // If we are not top - the parent MUST exist. But may it's better to check it again .-)
if (xParent.is()) // If we are not top - the parent MUST exist. But may it's better to check it again .-)
xTarget = xParent->findFrame(SPECIALTARGET_TOP,0); xTarget = xParent->findFrame(SPECIALTARGET_TOP,0);
} }
...@@ -830,8 +827,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl ...@@ -830,8 +827,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
// I.IV) "_self", "" // I.IV) "_self", ""
// This mean this frame in every case. // This mean this frame in every case.
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
else else if (
if (
( sTargetFrameName==SPECIALTARGET_SELF ) || ( sTargetFrameName==SPECIALTARGET_SELF ) ||
( sTargetFrameName.isEmpty() ) ( sTargetFrameName.isEmpty() )
) )
...@@ -845,8 +841,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl ...@@ -845,8 +841,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
// or create it there if it not already exists. // or create it there if it not already exists.
// Note: Such beamer exists for task(top) frames only! // Note: Such beamer exists for task(top) frames only!
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
else else if ( sTargetFrameName==SPECIALTARGET_BEAMER )
if ( sTargetFrameName==SPECIALTARGET_BEAMER )
{ {
// We are a task => search or create the beamer // We are a task => search or create the beamer
if (bIsTopWindow) if (bIsTopWindow)
...@@ -862,8 +857,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl ...@@ -862,8 +857,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl
} }
} }
// We arent a task => forward request to our parent or ignore it. // We arent a task => forward request to our parent or ignore it.
else else if (xParent.is())
if (xParent.is())
xTarget = xParent->findFrame(SPECIALTARGET_BEAMER,0); xTarget = xParent->findFrame(SPECIALTARGET_BEAMER,0);
} }
...@@ -1410,7 +1404,8 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X ...@@ -1410,7 +1404,8 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X
xDisposable->dispose(); xDisposable->dispose();
} }
catch(const css::lang::DisposedException&) catch(const css::lang::DisposedException&)
{} {
}
} }
xOldComponentWindow = NULL; xOldComponentWindow = NULL;
} }
...@@ -1431,8 +1426,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X ...@@ -1431,8 +1426,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X
// notifies all interest listener, that current component was changed or a new one was loaded // notifies all interest listener, that current component was changed or a new one was loaded
if (bIsConnected && bWasConnected) if (bIsConnected && bWasConnected)
implts_sendFrameActionEvent( css::frame::FrameAction_COMPONENT_REATTACHED ); implts_sendFrameActionEvent( css::frame::FrameAction_COMPONENT_REATTACHED );
else else if (bIsConnected && !bWasConnected)
if (bIsConnected && !bWasConnected)
implts_sendFrameActionEvent( css::frame::FrameAction_COMPONENT_ATTACHED ); implts_sendFrameActionEvent( css::frame::FrameAction_COMPONENT_ATTACHED );
//_____________________________________________________________________________________________________ //_____________________________________________________________________________________________________
...@@ -3118,12 +3112,11 @@ void Frame::impl_checkMenuCloser() ...@@ -3118,12 +3112,11 @@ void Frame::impl_checkMenuCloser()
// Because it's set at the special member aAnalyzer.m_xBackingComponent ... :-) // Because it's set at the special member aAnalyzer.m_xBackingComponent ... :-)
xNewCloserFrame = aAnalyzer.m_lOtherVisibleFrames[0]; xNewCloserFrame = aAnalyzer.m_lOtherVisibleFrames[0];
} }
else
// ----------------------------- // -----------------------------
// b) // b)
// There is no other frame ... means no other document frame. The help module // There is no other frame ... means no other document frame. The help module
// will be handled seperatly and must(!) be ignored here ... excepting weself includes the help. // will be handled seperatly and must(!) be ignored here ... excepting weself includes the help.
if ( else if (
(aAnalyzer.m_lOtherVisibleFrames.getLength()==0) && (aAnalyzer.m_lOtherVisibleFrames.getLength()==0) &&
(!aAnalyzer.m_bReferenceIsHelp ) && (!aAnalyzer.m_bReferenceIsHelp ) &&
(!aAnalyzer.m_bReferenceIsHidden ) && (!aAnalyzer.m_bReferenceIsHidden ) &&
......
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