main/framework/source/services/frame.cxx
/** it checks, which of the top level task frames must have the special menu closer for
    switching to the backing window mode.

    It analyze the current list of visible top level frames. Only the last real document
    frame can have this symbol. Not the help frame nor the backing task itself.
    Here we do anything related to this closer. We remove it from the old frame and set it
    for the new one.
 */
it checks, which of the top level task frames must have the special menu closer for
switching to the backing window mode.

It analyze the current list of visible top level frames. Only the last real document
frame can have this symbol. Not the help frame nor the backing task itself.
Here we do anything related to this closer. We remove it from the old frame and set it
for the new one.
it checks which of the top level task frames must have the special menu closer for switching to the backing window mode . It analyze the current list of visible top level frames . Only the last real document frame can have this symbol . Not the help frame nor the backing task itself . Here we do anything related to this closer . We remove it from the old frame and set it for the new one .
void Frame::impl_checkMenuCloser()
{
    ReadGuard aReadLock(m_aLock);
    css::uno::Reference< css::frame::XDesktop >        xDesktop     (m_xParent, css::uno::UNO_QUERY);
    css::uno::Reference< css::frame::XFramesSupplier > xTaskSupplier(xDesktop , css::uno::UNO_QUERY);
    if ( !xDesktop.is() || !xTaskSupplier.is() )
        return;
    aReadLock.unlock();
    FrameListAnalyzer aAnalyzer(
        xTaskSupplier,
        this,
        FrameListAnalyzer::E_HIDDEN | FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
    css::uno::Reference< css::frame::XFrame > xNewCloserFrame;
    if (
        (aAnalyzer.m_lOtherVisibleFrames.getLength()==1)   &&
        (
            (aAnalyzer.m_bReferenceIsHelp  ) ||
            (aAnalyzer.m_bReferenceIsHidden)
        )
       )
    {
        xNewCloserFrame = aAnalyzer.m_lOtherVisibleFrames[0];
    }
    else
    if (
        (aAnalyzer.m_lOtherVisibleFrames.getLength()==0) &&
        (!aAnalyzer.m_bReferenceIsHelp                 ) &&
        (!aAnalyzer.m_bReferenceIsHidden               ) &&
        (!aAnalyzer.m_bReferenceIsBacking              )
       )
    {
        xNewCloserFrame = this;
    }
    WriteGuard aStaticWriteLock(LockHelper::getGlobalLock());
    css::uno::Reference< css::frame::XFrame > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY);
    if (xCloserFrame!=xNewCloserFrame)
    {
        if (xCloserFrame.is())
            impl_setCloser(xCloserFrame, sal_False);
        if (xNewCloserFrame.is())
            impl_setCloser(xNewCloserFrame, sal_True);
        m_xCloserFrame = xNewCloserFrame;
    }
    aStaticWriteLock.unlock();
}
void Frame :: impl_checkMenuCloser ( ) { ReadGuard aReadLock ( m_aLock ) ; css :: uno :: Reference < css :: frame :: XDesktop > xDesktop ( m_xParent , css :: uno :: UNO_QUERY ) ; css :: uno :: Reference < css :: frame :: XFramesSupplier > xTaskSupplier ( xDesktop , css :: uno :: UNO_QUERY ) ; if ( ! xDesktop . is ( ) || ! xTaskSupplier . is ( ) ) return ; aReadLock . unlock ( ) ; FrameListAnalyzer aAnalyzer ( xTaskSupplier , this , FrameListAnalyzer :: E_HIDDEN | FrameListAnalyzer :: E_HELP | FrameListAnalyzer :: E_BACKINGCOMPONENT ) ; css :: uno :: Reference < css :: frame :: XFrame > xNewCloserFrame ; if ( ( aAnalyzer . m_lOtherVisibleFrames . getLength ( ) == 1 ) && ( ( aAnalyzer . m_bReferenceIsHelp ) || ( aAnalyzer . m_bReferenceIsHidden ) ) ) { xNewCloserFrame = aAnalyzer . m_lOtherVisibleFrames [ 0 ] ; } else if ( ( aAnalyzer . m_lOtherVisibleFrames . getLength ( ) == 0 ) && ( ! aAnalyzer . m_bReferenceIsHelp ) && ( ! aAnalyzer . m_bReferenceIsHidden ) && ( ! aAnalyzer . m_bReferenceIsBacking ) ) { xNewCloserFrame = this ; } WriteGuard aStaticWriteLock ( LockHelper :: getGlobalLock ( ) ) ; css :: uno :: Reference < css :: frame :: XFrame > xCloserFrame ( m_xCloserFrame . get ( ) , css :: uno :: UNO_QUERY ) ; if ( xCloserFrame != xNewCloserFrame ) { if ( xCloserFrame . is ( ) ) impl_setCloser ( xCloserFrame , sal_False ) ; if ( xNewCloserFrame . is ( ) ) impl_setCloser ( xNewCloserFrame , sal_True ) ; m_xCloserFrame = xNewCloserFrame ; } aStaticWriteLock . unlock ( ) ; }
it checks, which of the top level task frames must have the special menu closer for
switching to the backing window mode.
it checks which of the top level task frames must have the special menu closer for switching to the backing window mode .
/* SAFE { */ // only top frames, which are part of our desktop hierarchy, can // do so! By the way - we need the desktop instance to have access // to all other top level frames too. /* } SAFE */ // analyze the list of current open tasks // Suppress search for other views to the same model ... // It's not needed here and can be very expensive. // specify the new frame, which must have this special state ... // ----------------------------- // a) // If there exist ate least one other frame - there are two frames currently open. // But we can enable this closer only, if one of these two tasks includes the help module. // The "other frame" couldn't be the help. Because then it wouldn't be part of this "other list". // In such case it will be separated to the reference aAnalyzer.m_xHelp! // But we must check, if weself includes the help ... // Check aAnalyzer.m_bReferenceIsHelp! // others[0] can't be the backing component! // Because it's set at the special member aAnalyzer.m_xBackingComponent ... :-) // ----------------------------- // b) // There is no other frame ... means no other document frame. The help module // will be handled separately and must(!) be ignored here ... excepting weself includes the help. // Look for necessary actions ... // Only if the closer state must be moved from one frame to another one // or must be enabled/disabled at all. /* STATIC SAFE { */ /* } STATIC SAFE */