Kaydet (Commit) 5c39b28a authored tarafından susobhang70's avatar susobhang70 Kaydeden (comit) jan iversen

tdf#96059 Replaced imageproducer with CommandInfoProvider

Replaced all instances of framework::GetImageFromURL with vcl::CommandInfoProvider::Instance().GetImageForCommand

Change-Id: I895a4a80d0219a6523b62d90ca88ec67a433b01c
Reviewed-on: https://gerrit.libreoffice.org/21101Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 075c7ece
......@@ -51,6 +51,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <osl/mutex.hxx>
#include <osl/file.hxx>
......@@ -165,7 +166,7 @@ MenuManager::MenuManager(
// Set image for the addon popup menu item
if ( bShowMenuImages && !pPopupMenu->GetItemImage( ITEMID_ADDONLIST ))
{
Image aImage = GetImageFromURL( rFrame, aItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aItemCommand, false, rFrame );
if ( !!aImage )
pPopupMenu->SetItemImage( ITEMID_ADDONLIST, aImage );
}
......@@ -186,7 +187,7 @@ MenuManager::MenuManager(
AddMenu(pSubMenu,OUString(),nItemId,true,false);
if ( bShowMenuImages && !pMenu->GetItemImage( nItemId ))
{
Image aImage = GetImageFromURL( rFrame, aItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aItemCommand, false, rFrame );
if ( !!aImage )
pMenu->SetItemImage( nItemId, aImage );
}
......@@ -201,7 +202,7 @@ MenuManager::MenuManager(
if ( bShowMenuImages && !pMenu->GetItemImage( nItemId ))
{
Image aImage = GetImageFromURL( rFrame, aItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aItemCommand, false, rFrame );
if ( !!aImage )
pMenu->SetItemImage( nItemId, aImage );
}
......@@ -222,12 +223,12 @@ MenuManager::MenuManager(
if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() )
{
// Retrieve image id from menu attributes
aImage = GetImageFromURL( rFrame, aImageId, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, false, rFrame );
}
if ( !aImage )
{
aImage = GetImageFromURL( rFrame, aItemCommand, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aItemCommand, false, rFrame );
if ( !aImage )
aImage = AddonsOptions().GetImageFromURL( aItemCommand, false );
}
......@@ -237,7 +238,7 @@ MenuManager::MenuManager(
}
else if ( !pMenu->GetItemImage( nItemId ))
{
Image aImage = GetImageFromURL( rFrame, aItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aItemCommand, false, rFrame );
if ( !!aImage )
pMenu->SetItemImage( nItemId, aImage );
}
......@@ -948,7 +949,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool
if ( !aImageId.isEmpty() )
{
Image aImage = GetImageFromURL( _xFrame, aImageId, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, false, _xFrame );
if ( !!aImage )
{
bImageSet = true;
......@@ -959,7 +960,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool
if ( !bImageSet )
{
OUString aMenuItemCommand = _pMenu->GetItemCommand( nId );
Image aImage = GetImageFromURL( _xFrame, aMenuItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aMenuItemCommand, false, _xFrame );
if ( !aImage )
aImage = aAddonOptions.GetImageFromURL( aMenuItemCommand, false );
......
......@@ -34,6 +34,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <unotools/dynamicmenuoptions.hxx>
#include <svtools/menuoptions.hxx>
......@@ -144,7 +145,7 @@ void BmkMenu::Initialize()
if ( !aImageId.isEmpty() )
{
Image aImage = GetImageFromURL( m_xFrame, aImageId, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aImageId, false, m_xFrame );
if ( !!aImage )
{
bImageSet = true;
......@@ -154,7 +155,7 @@ void BmkMenu::Initialize()
if ( !bImageSet )
{
Image aImage = GetImageFromURL( m_xFrame, aURL, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aURL, false, m_xFrame );
if ( !aImage )
InsertItem( nId, aTitle );
else
......
......@@ -56,6 +56,7 @@
#include <vcl/taskpanelist.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
// namespaces
......@@ -121,14 +122,14 @@ static Image RetrieveImage( Reference< css::frame::XFrame >& rFrame,
if ( !!aImage )
return aImage;
else
aImage = GetImageFromURL( rFrame, aImageId, bBigImage );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, bBigImage, rFrame );
if ( !!aImage )
return aImage;
}
aImage = framework::AddonsOptions().GetImageFromURL( aURL, bBigImage );
if ( !aImage )
aImage = GetImageFromURL( rFrame, aImageId, bBigImage );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, bBigImage, rFrame );
return aImage;
}
......
......@@ -1297,7 +1297,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
if ( bItemShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST ))
{
Reference< XFrame > xTemp( rFrame );
Image aImage = GetImageFromURL( xTemp, aItemCommand, false );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, xTemp );
if ( !!aImage )
pPopup->SetItemImage( ITEMID_ADDONLIST, aImage );
}
......@@ -1326,12 +1326,12 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() )
{
// Retrieve image id from menu attributes
aImage = GetImageFromURL( m_xFrame, aImageId, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aImageId, false, m_xFrame );
}
if ( !aImage )
{
aImage = GetImageFromURL( m_xFrame, aItemCommand, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, m_xFrame );
if ( !aImage )
aImage = AddonsOptions().GetImageFromURL( aItemCommand, false );
}
......
......@@ -37,6 +37,7 @@
#include <vcl/svapp.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
#include <svtools/menuoptions.hxx>
......@@ -89,7 +90,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
if ( !aImageId.isEmpty() )
{
aImage = GetImageFromURL( xFrame, aImageId, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aImageId, false, xFrame );
if ( !!aImage )
{
bImageSet = true;
......@@ -101,7 +102,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
{
OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
if ( !aCmd.isEmpty() )
aImage = GetImageFromURL( xFrame, aCmd, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aCmd, false, xFrame );
if ( !!aImage )
pPopupMenu->SetItemImage( nItemId, aImage );
......
......@@ -27,6 +27,7 @@
#include <tools/gen.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <com/sun/star/awt/XDockableWindow.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp>
......@@ -291,7 +292,7 @@ void SubToolBarController::updateImage()
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
{
Image aImage = framework::GetImageFromURL( getFrameInterface(), m_aLastCommand, pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE );
Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( m_aLastCommand, pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE, getFrameInterface() );
if ( !!aImage )
pToolBox->SetItemImage( nId, aImage );
}
......
......@@ -48,6 +48,7 @@
#include <vcl/i18nhelp.hxx>
#include <vcl/image.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <rtl/ustrbuf.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
......@@ -175,7 +176,7 @@ void ToolbarsMenuController::addCommand(
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
if ( rSettings.GetUseImagesInMenus() )
aImage = GetImageFromURL( m_xFrame, rCommandURL, false );
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( rCommandURL, false, m_xFrame );
VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( rPopupMenu ));
if ( pPopupMenu )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment