diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-07-05 16:44:19 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-05 17:11:46 +0100 |
commit | 67feb571330ec4b9eaff7791b27219b62d4c2f6a (patch) | |
tree | 401d3a2bf0e668fe39359dde44a97172bb9b288f /framework/source/layoutmanager | |
parent | a2f4aed32257e183339a3513339bc59009c88527 (diff) |
fdo#66524 - defer population of AddOns toolbar icons until they are shown.
Some addons eg. LibreLogo are almost never shown, so avoid their startup cost.
Change-Id: Ibbc072dd740eca6a97aeff918ae0a5c105278acf
Diffstat (limited to 'framework/source/layoutmanager')
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 670c2a4f2f0b..4abdbc928382 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -18,6 +18,7 @@ */ #include <toolbarlayoutmanager.hxx> +#include <uielement/addonstoolbarwrapper.hxx> #include <helpers.hxx> #include <services.h> #include <services/layoutmanager.hxx> @@ -442,6 +443,7 @@ bool ToolbarLayoutManager::requestToolbar( const OUString& rResourceURL ) bMustCallCreate = true; bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible & !aRequestedToolbar.m_bMasterHide ); + uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY ); if ( xContainerWindow.is() && aRequestedToolbar.m_bFloating ) bCreateOrShowToolbar &= bool( xContainerWindow->isActive()); @@ -569,6 +571,14 @@ bool ToolbarLayoutManager::showToolbar( const OUString& rResourceURL ) SolarMutexGuard aGuard; Window* pWindow = getWindowFromXUIElement( aUIElement.m_xUIElement ); + + // Addons appear to need to be populated at start, but we don't + // want to populate them with (scaled) images until later. + AddonsToolBarWrapper *pAddOns; + pAddOns = dynamic_cast<AddonsToolBarWrapper *>( aUIElement.m_xUIElement.get()); + if (pAddOns) + pAddOns->populateImages(); + if ( pWindow ) { if ( !aUIElement.m_bFloating ) |