main/framework/source/services/frame.cxx
/** little helper to enable/disable the menu closer at the menubar of the given frame.

    @param  xFrame
            we use its layout manager to set/reset a special callback.
            Its existence regulate visibility of this closer item.

    @param  bState
                <TRUE/> enable; <FALSE/> disable this state
 */
little helper to enable/disable the menu closer at the menubar of the given frame.
little helper to enable / disable the menu closer at the menubar of the given frame .
void Frame::impl_setCloser(  const css::uno::Reference< css::frame::XFrame >& xFrame ,
                                   sal_Bool                                   bState  )
{
    if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE))
        return;
    try
    {
        css::uno::Reference< css::beans::XPropertySet > xFrameProps(xFrame, css::uno::UNO_QUERY_THROW);
        css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
        xFrameProps->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
        css::uno::Reference< css::beans::XPropertySet > xLayoutProps(xLayoutManager, css::uno::UNO_QUERY_THROW);
        xLayoutProps->setPropertyValue(LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, css::uno::makeAny(bState));
    }
    catch(const css::uno::RuntimeException&)
        { throw; }
    catch(const css::uno::Exception&)
        {}
}
void Frame :: impl_setCloser ( const css :: uno :: Reference < css :: frame :: XFrame > & xFrame , sal_Bool bState ) { if ( ! SvtModuleOptions ( ) . IsModuleInstalled ( SvtModuleOptions :: E_SSTARTMODULE ) ) return ; try { css :: uno :: Reference < css :: beans :: XPropertySet > xFrameProps ( xFrame , css :: uno :: UNO_QUERY_THROW ) ; css :: uno :: Reference < css :: frame :: XLayoutManager > xLayoutManager ; xFrameProps -> getPropertyValue ( FRAME_PROPNAME_LAYOUTMANAGER ) >>= xLayoutManager ; css :: uno :: Reference < css :: beans :: XPropertySet > xLayoutProps ( xLayoutManager , css :: uno :: UNO_QUERY_THROW ) ; xLayoutProps -> setPropertyValue ( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER , css :: uno :: makeAny ( bState ) ) ; } catch ( const css :: uno :: RuntimeException & ) { throw ; } catch ( const css :: uno :: Exception & ) { } }
little helper to enable/disable the menu closer at the menubar of the given frame.
little helper to enable / disable the menu closer at the menubar of the given frame .
/*IN*/ /*IN*/ // Note: If start module isn't installed - no closer has to be shown!