diff options
Diffstat (limited to 'framework/source/layoutmanager/layoutmanager.cxx')
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 154 |
1 files changed, 73 insertions, 81 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 0d1cc619da89..bd122e6f683f 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -63,6 +63,7 @@ #include <rtl/ref.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <algorithm> @@ -76,7 +77,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui; using namespace ::com::sun::star::frame; -constexpr OUStringLiteral STATUS_BAR_ALIAS = u"private:resource/statusbar/statusbar"; +constexpr OUString STATUS_BAR_ALIAS = u"private:resource/statusbar/statusbar"_ustr; namespace framework { @@ -129,6 +130,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, beans::PropertyAttribute::TRANSIENT, &m_bMenuBarCloseButton, cppu::UnoType<decltype(m_bMenuBarCloseButton)>::get() ); registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, beans::PropertyAttribute::TRANSIENT, cppu::UnoType<bool>::get(), css::uno::Any(false) ); registerProperty( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE, LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, beans::PropertyAttribute::TRANSIENT, &m_bPreserveContentSize, cppu::UnoType<decltype(m_bPreserveContentSize)>::get() ); + registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP, LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP, beans::PropertyAttribute::TRANSIENT, cppu::UnoType<bool>::get(), css::uno::Any(false) ); } LayoutManager::~LayoutManager() @@ -152,7 +154,7 @@ void LayoutManager::implts_createMenuBar(const OUString& rMenuBarName) if (m_bInplaceMenuSet || m_xMenuBar.is()) return; - m_xMenuBar = implts_createElement( rMenuBarName ); + m_xMenuBar.set( static_cast< MenuBarWrapper* >(implts_createElement( rMenuBarName ).get()) ); if ( !m_xMenuBar.is() ) return; @@ -162,25 +164,21 @@ void LayoutManager::implts_createMenuBar(const OUString& rMenuBarName) Reference< awt::XMenuBar > xMenuBar; - Reference< XPropertySet > xPropSet( m_xMenuBar, UNO_QUERY ); - if ( xPropSet.is() ) + try + { + m_xMenuBar->getPropertyValue("XMenuBar") >>= xMenuBar; + } + catch (const beans::UnknownPropertyException&) + { + } + catch (const lang::WrappedTargetException&) { - try - { - xPropSet->getPropertyValue("XMenuBar") >>= xMenuBar; - } - catch (const beans::UnknownPropertyException&) - { - } - catch (const lang::WrappedTargetException&) - { - } } if ( !xMenuBar.is() ) return; - VCLXMenu* pAwtMenuBar = comphelper::getFromUnoTunnel<VCLXMenu>( xMenuBar ); + VCLXMenu* pAwtMenuBar = dynamic_cast<VCLXMenu*>( xMenuBar.get() ); if ( pAwtMenuBar ) { MenuBar* pMenuBar = static_cast<MenuBar*>(pAwtMenuBar->GetMenu()); @@ -213,12 +211,11 @@ void LayoutManager::impl_clearUpMenuBar() { Reference< awt::XMenuBar > xMenuBar; - Reference< XPropertySet > xPropSet( m_xMenuBar, UNO_QUERY ); - if ( xPropSet.is() ) + if ( m_xMenuBar.is() ) { try { - xPropSet->getPropertyValue("XMenuBar") >>= xMenuBar; + m_xMenuBar->getPropertyValue("XMenuBar") >>= xMenuBar; } catch (const beans::UnknownPropertyException&) { @@ -228,7 +225,7 @@ void LayoutManager::impl_clearUpMenuBar() } } - VCLXMenu* pAwtMenuBar = comphelper::getFromUnoTunnel<VCLXMenu>( xMenuBar ); + VCLXMenu* pAwtMenuBar = dynamic_cast<VCLXMenu*>( xMenuBar.get() ); if ( pAwtMenuBar ) pSetMenuBar = static_cast<MenuBar*>(pAwtMenuBar->GetMenu()); } @@ -250,10 +247,11 @@ void LayoutManager::impl_clearUpMenuBar() pMenuBar.disposeAndClear(); m_bInplaceMenuSet = false; - Reference< XComponent > xComp( m_xMenuBar, UNO_QUERY ); - if ( xComp.is() ) - xComp->dispose(); - m_xMenuBar.clear(); + if ( m_xMenuBar.is() ) + { + m_xMenuBar->dispose(); + m_xMenuBar.clear(); + } implts_unlock(); } @@ -429,7 +427,7 @@ void LayoutManager::implts_reset( bool bAttached ) if ( bAttached ) { xToolbarManager->attach( xFrame, xModCfgMgr, xDokCfgMgr, xPersistentWindowState ); - uno::Reference< awt::XWindowPeer > xParent( xContainerWindow, UNO_QUERY ); + uno::Reference< awt::XVclWindowPeer > xParent( xContainerWindow, UNO_QUERY ); xToolbarManager->setParentWindow( xParent ); if ( bAutomaticToolbars ) xToolbarManager->createStaticToolbars(); @@ -482,7 +480,7 @@ void LayoutManager::implts_toggleFloatingUIElementsVisibility( bool bActive ) pToolbarManager->setFloatingToolbarsVisibility( bActive ); } -uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( const OUString& aName ) +uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( std::u16string_view aName ) { OUString aElementType; OUString aElementName; @@ -534,7 +532,7 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem if ( rPersistentWindowState->hasByName( aName ) && (rPersistentWindowState->getByName( aName ) >>= aWindowState) ) { bool bValue( false ); - for ( PropertyValue const & rProp : std::as_const(aWindowState) ) + for (PropertyValue const& rProp : aWindowState) { if ( rProp.Name == WINDOWSTATE_PROPERTY_DOCKED ) { @@ -692,12 +690,12 @@ void LayoutManager::implts_writeWindowStateData( const OUString& aName, const UI if ( xPersistentWindowState->hasByName( aName )) { Reference< XNameReplace > xReplace( xPersistentWindowState, uno::UNO_QUERY ); - xReplace->replaceByName( aName, makeAny( aWindowState )); + xReplace->replaceByName( aName, Any( aWindowState )); } else { Reference< XNameContainer > xInsert( xPersistentWindowState, uno::UNO_QUERY ); - xInsert->insertByName( aName, makeAny( aWindowState )); + xInsert->insertByName( aName, Any( aWindowState )); } } catch (const Exception&) @@ -761,7 +759,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible ) implts_notifyListeners( frame::LayoutManagerEvents::INVISIBLE, a ); SolarMutexResettableGuard aWriteLock; - Reference< XUIElement > xMenuBar = m_xMenuBar; + rtl::Reference< MenuBarWrapper > xMenuBar = m_xMenuBar; Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); rtl::Reference< MenuBarManager > xInplaceMenuBar( m_xInplaceMenuBar ); aWriteLock.clear(); @@ -775,8 +773,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible ) pMenuBar = static_cast<MenuBar *>(xInplaceMenuBar->GetMenuBar()); else { - MenuBarWrapper* pMenuBarWrapper = static_cast< MenuBarWrapper* >(xMenuBar.get()); - pMenuBar = static_cast<MenuBar *>(pMenuBarWrapper->GetMenuBarManager()->GetMenuBar()); + pMenuBar = static_cast<MenuBar *>(xMenuBar->GetMenuBarManager()->GetMenuBar()); } SystemWindow* pSysWindow = getTopSystemWindow( xContainerWindow ); @@ -871,7 +868,7 @@ void LayoutManager::implts_createProgressBar() { Reference< XUIElement > xStatusBar; Reference< XUIElement > xProgressBar; - Reference< XUIElement > xProgressBarBackup; + rtl::Reference< ProgressBarWrapper > xProgressBarBackup; Reference< awt::XWindow > xContainerWindow; SolarMutexResettableGuard aWriteLock; @@ -882,10 +879,10 @@ void LayoutManager::implts_createProgressBar() xContainerWindow = m_xContainerWindow; aWriteLock.clear(); - bool bRecycled = xProgressBarBackup.is(); + bool bRecycled = xProgressBarBackup.is(); rtl::Reference<ProgressBarWrapper> pWrapper; if ( bRecycled ) - pWrapper = static_cast<ProgressBarWrapper*>(xProgressBarBackup.get()); + pWrapper = xProgressBarBackup.get(); else if ( xProgressBar.is() ) pWrapper = static_cast<ProgressBarWrapper*>(xProgressBar.get()); else @@ -934,17 +931,13 @@ void LayoutManager::implts_backupProgressBarWrapper() // safe a backup copy of the current progress! // This copy will be used automatically inside createProgressBar() which is called // implicitly from implts_doLayout() .-) - m_xProgressBarBackup = m_aProgressBarElement.m_xUIElement; + m_xProgressBarBackup = static_cast<ProgressBarWrapper*>(m_aProgressBarElement.m_xUIElement.get()); // remove the relation between this old progress bar and our old status bar. // Otherwise we work on disposed items ... // The internal used ProgressBarWrapper can handle a NULL reference. if ( m_xProgressBarBackup.is() ) - { - ProgressBarWrapper* pWrapper = static_cast<ProgressBarWrapper*>(m_xProgressBarBackup.get()); - if ( pWrapper ) - pWrapper->setStatusBar( Reference< awt::XWindow >() ); - } + m_xProgressBarBackup->setStatusBar( Reference< awt::XWindow >() ); // prevent us from dispose() the m_aProgressBarElement.m_xUIElement inside implts_reset() m_aProgressBarElement.m_xUIElement.clear(); @@ -1186,12 +1179,11 @@ void LayoutManager::implts_resetInplaceMenuBar() if ( m_xContainerWindow.is() ) { SolarMutexGuard aGuard; - MenuBarWrapper* pMenuBarWrapper = static_cast< MenuBarWrapper* >(m_xMenuBar.get()); SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow ); if ( pSysWindow ) { - if ( pMenuBarWrapper ) - pSysWindow->SetMenuBar(static_cast<MenuBar *>(pMenuBarWrapper->GetMenuBarManager()->GetMenuBar())); + if ( m_xMenuBar ) + pSysWindow->SetMenuBar(static_cast<MenuBar *>(m_xMenuBar->GetMenuBarManager()->GetMenuBar())); else pSysWindow->SetMenuBar(nullptr); } @@ -1371,7 +1363,7 @@ void LayoutManager::implts_reparentChildWindows() aWriteLock.reset(); ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); if ( pToolbarManager ) - pToolbarManager->setParentWindow( uno::Reference< awt::XWindowPeer >( xContainerWindow, uno::UNO_QUERY )); + pToolbarManager->setParentWindow( uno::Reference< awt::XVclWindowPeer >( xContainerWindow, uno::UNO_QUERY )); aWriteLock.clear(); } @@ -1480,7 +1472,7 @@ void SAL_CALL LayoutManager::createElement( const OUString& aName ) if ( bNotify ) { // UI element is invisible - provide information to listeners - implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( aName ) ); + implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::Any( aName ) ); } } @@ -1550,7 +1542,7 @@ void SAL_CALL LayoutManager::destroyElement( const OUString& aName ) doLayout(); if ( bNotify ) - implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::makeAny( aName ) ); + implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::Any( aName ) ); } sal_Bool SAL_CALL LayoutManager::requestElement( const OUString& rResourceURL ) @@ -1624,7 +1616,7 @@ sal_Bool SAL_CALL LayoutManager::requestElement( const OUString& rResourceURL ) } if ( bNotify ) - implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( rResourceURL ) ); + implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::Any( rResourceURL ) ); return bResult; } @@ -1648,7 +1640,7 @@ Reference< XUIElement > SAL_CALL LayoutManager::getElement( const OUString& aNam Sequence< Reference< ui::XUIElement > > SAL_CALL LayoutManager::getElements() { SolarMutexClearableGuard aReadLock; - uno::Reference< ui::XUIElement > xMenuBar( m_xMenuBar ); + rtl::Reference< MenuBarWrapper > xMenuBar( m_xMenuBar ); uno::Reference< ui::XUIElement > xStatusBar( m_aStatusBarElement.m_xUIElement ); ToolbarLayoutManager* pToolbarManager( m_xToolbarManager.get() ); aReadLock.clear(); @@ -1752,7 +1744,7 @@ sal_Bool SAL_CALL LayoutManager::showElement( const OUString& aName ) doLayout(); if ( bNotify ) - implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::makeAny( aName ) ); + implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_VISIBLE, uno::Any( aName ) ); return bResult; } @@ -1834,7 +1826,7 @@ sal_Bool SAL_CALL LayoutManager::hideElement( const OUString& aName ) doLayout(); if ( bNotify ) - implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::makeAny( aName ) ); + implts_notifyListeners( frame::LayoutManagerEvents::UIELEMENT_INVISIBLE, uno::Any( aName ) ); return false; } @@ -1880,7 +1872,7 @@ sal_Bool SAL_CALL LayoutManager::dockAllWindows( ::sal_Int16 /*nElementType*/ ) sal_Bool SAL_CALL LayoutManager::floatWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1899,7 +1891,7 @@ sal_Bool SAL_CALL LayoutManager::floatWindow( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::lockWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1918,7 +1910,7 @@ sal_Bool SAL_CALL LayoutManager::lockWindow( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::unlockWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1936,7 +1928,7 @@ sal_Bool SAL_CALL LayoutManager::unlockWindow( const OUString& aName ) void SAL_CALL LayoutManager::setElementSize( const OUString& aName, const awt::Size& aSize ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -1953,7 +1945,7 @@ void SAL_CALL LayoutManager::setElementSize( const OUString& aName, const awt::S void SAL_CALL LayoutManager::setElementPos( const OUString& aName, const awt::Point& aPos ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -1970,7 +1962,7 @@ void SAL_CALL LayoutManager::setElementPos( const OUString& aName, const awt::Po void SAL_CALL LayoutManager::setElementPosSize( const OUString& aName, const awt::Point& aPos, const awt::Size& aSize ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -2061,7 +2053,7 @@ sal_Bool SAL_CALL LayoutManager::isElementVisible( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementFloating( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2076,7 +2068,7 @@ sal_Bool SAL_CALL LayoutManager::isElementFloating( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementDocked( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2091,7 +2083,7 @@ sal_Bool SAL_CALL LayoutManager::isElementDocked( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementLocked( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2106,7 +2098,7 @@ sal_Bool SAL_CALL LayoutManager::isElementLocked( const OUString& aName ) awt::Size SAL_CALL LayoutManager::getElementSize( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2121,7 +2113,7 @@ awt::Size SAL_CALL LayoutManager::getElementSize( const OUString& aName ) awt::Point SAL_CALL LayoutManager::getElementPos( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2325,7 +2317,7 @@ bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSiz // calculate the maximum size we have for the container window sal_Int32 nDisplay = xContainerTopWindow->getDisplay(); - tools::Rectangle aWorkArea = Application::GetScreenPosSizePixel( nDisplay ); + AbsoluteScreenPixelRectangle aWorkArea = Application::GetScreenPosSizePixel( nDisplay ); if (!aWorkArea.IsEmpty()) { @@ -2463,12 +2455,8 @@ bool LayoutManager::implts_resetMenuBar() MenuBar* pSetMenuBar = nullptr; if ( m_xInplaceMenuBar.is() ) pSetMenuBar = static_cast<MenuBar *>(m_xInplaceMenuBar->GetMenuBar()); - else - { - MenuBarWrapper* pMenuBarWrapper = static_cast< MenuBarWrapper* >( m_xMenuBar.get() ); - if ( pMenuBarWrapper ) - pSetMenuBar = static_cast<MenuBar*>(pMenuBarWrapper->GetMenuBarManager()->GetMenuBar()); - } + else if ( m_xMenuBar ) + pSetMenuBar = static_cast<MenuBar*>(m_xMenuBar->GetMenuBarManager()->GetMenuBar()); SystemWindow* pSysWindow = getTopSystemWindow( xContainerWindow ); if ( pSysWindow && bMenuVisible && pSetMenuBar ) @@ -2486,9 +2474,8 @@ void LayoutManager::implts_createMSCompatibleMenuBar( const OUString& aName ) SolarMutexGuard aWriteLock; // Find Form menu in the original menubar - m_xMenuBar = implts_createElement( aName ); - uno::Reference< XUIElementSettings > xMenuBarSettings(m_xMenuBar, UNO_QUERY); - uno::Reference< container::XIndexReplace > xMenuIndex(xMenuBarSettings->getSettings(true), UNO_QUERY); + m_xMenuBar.set( static_cast< MenuBarWrapper* >(implts_createElement( aName ).get()) ); + uno::Reference< container::XIndexReplace > xMenuIndex(m_xMenuBar->getSettings(true), UNO_QUERY); sal_Int32 nFormsMenu = -1; for (sal_Int32 nIndex = 0; nIndex < xMenuIndex->getCount(); ++nIndex) @@ -2496,7 +2483,7 @@ void LayoutManager::implts_createMSCompatibleMenuBar( const OUString& aName ) uno::Sequence< beans::PropertyValue > aProps; xMenuIndex->getByIndex( nIndex ) >>= aProps; OUString aCommand; - for ( beans::PropertyValue const & rProp : std::as_const(aProps) ) + for (beans::PropertyValue const& rProp : aProps) { if (rProp.Name == "CommandURL") { @@ -2522,7 +2509,7 @@ void LayoutManager::implts_createMSCompatibleMenuBar( const OUString& aName ) assert(xFormsMenuIndex->getCount() >= 1); uno::Sequence< beans::PropertyValue > aNewFormsMenu; xFormsMenuIndex->getByIndex( 0 ) >>= aNewFormsMenu; - xMenuIndex->replaceByIndex(nFormsMenu, uno::makeAny(aNewFormsMenu)); + xMenuIndex->replaceByIndex(nFormsMenu, uno::Any(aNewFormsMenu)); setMergedMenuBar( xMenuIndex ); @@ -2786,7 +2773,7 @@ void SAL_CALL LayoutManager::disposing( const lang::EventObject& rEvent ) ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); if (pToolbarManager) { - uno::Reference<awt::XWindowPeer> aEmptyWindowPeer; + uno::Reference<awt::XVclWindowPeer> aEmptyWindowPeer; pToolbarManager->setParentWindow(aEmptyWindowPeer); } impl_clearUpMenuBar(); @@ -2852,7 +2839,7 @@ void SAL_CALL LayoutManager::elementInserted( const ui::ConfigurationEvent& Even if ( xPropSet.is() ) { if ( Event.Source == uno::Reference< uno::XInterface >( m_xDocCfgMgr, uno::UNO_QUERY )) - xPropSet->setPropertyValue( "ConfigurationSource", makeAny( m_xDocCfgMgr )); + xPropSet->setPropertyValue( "ConfigurationSource", Any( m_xDocCfgMgr )); } xElementSettings->updateSettings(); } @@ -2868,7 +2855,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event Reference< frame::XFrame > xFrame( m_xFrame ); rtl::Reference< ToolbarLayoutManager > xToolbarManager( m_xToolbarManager ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); - Reference< ui::XUIElement > xMenuBar( m_xMenuBar ); + rtl::Reference< MenuBarWrapper > xMenuBar( m_xMenuBar ); Reference< ui::XUIConfigurationManager > xModuleCfgMgr( m_xModuleCfgMgr ); Reference< ui::XUIConfigurationManager > xDocCfgMgr( m_xDocCfgMgr ); aReadLock.clear(); @@ -2915,7 +2902,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event // document settings removed if ( xModuleCfgMgr->hasSettings( Event.ResourceURL )) { - xPropSet->setPropertyValue( aConfigSourcePropName, makeAny( m_xModuleCfgMgr )); + xPropSet->setPropertyValue( aConfigSourcePropName, Any( m_xModuleCfgMgr )); xElementSettings->updateSettings(); return; } @@ -2934,9 +2921,8 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event if ( pSysWindow && !m_bInplaceMenuSet ) pSysWindow->SetMenuBar( nullptr ); - Reference< XComponent > xComp( xMenuBar, UNO_QUERY ); - if ( xComp.is() ) - xComp->dispose(); + if ( xMenuBar.is() ) + xMenuBar->dispose(); SolarMutexGuard g; m_xMenuBar.clear(); @@ -3000,7 +2986,7 @@ void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Even void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& aValue ) { - if ( nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY ) + if ( (nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY) && (nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP) ) LayoutManager_PBase::setFastPropertyValue_NoBroadcast( nHandle, aValue ); switch( nHandle ) @@ -3028,6 +3014,12 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 n case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI: implts_setCurrentUIVisibility( !m_bHideCurrentUI ); break; + + case LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP: + if (m_xToolbarManager.is()) + m_xToolbarManager->updateToolbarsTips(); + break; + default: break; } } |