From 67feb571330ec4b9eaff7791b27219b62d4c2f6a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 5 Jul 2013 16:44:19 +0100 Subject: 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 --- framework/source/layoutmanager/toolbarlayoutmanager.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'framework/source/layoutmanager') 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 +#include #include #include #include @@ -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( aUIElement.m_xUIElement.get()); + if (pAddOns) + pAddOns->populateImages(); + if ( pWindow ) { if ( !aUIElement.m_bFloating ) -- cgit