summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorsusobhang70 <susobhang70@gmail.com>2016-01-03 22:38:50 +0530
committerjan iversen <jani@documentfoundation.org>2016-01-05 09:52:53 +0000
commit5c39b28a87060f80404079ab77604f664addb063 (patch)
tree34278a77a62adcc071c9c17bc793a6b565d65b68 /framework
parent075c7eceb0769b61d11a3857e33af1b2c6341bc5 (diff)
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/21101 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/classes/menumanager.cxx17
-rw-r--r--framework/source/fwe/classes/bmkmenu.cxx5
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx5
-rw-r--r--framework/source/uielement/menubarmanager.cxx6
-rw-r--r--framework/source/uielement/newmenucontroller.cxx5
-rw-r--r--framework/source/uielement/subtoolbarcontroller.cxx3
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx3
7 files changed, 25 insertions, 19 deletions
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index 56ae8e47d55b..8f354c6d5498 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -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 );
diff --git a/framework/source/fwe/classes/bmkmenu.cxx b/framework/source/fwe/classes/bmkmenu.cxx
index cc9c31f4617b..07f91f7441c3 100644
--- a/framework/source/fwe/classes/bmkmenu.cxx
+++ b/framework/source/fwe/classes/bmkmenu.cxx
@@ -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
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 8ca598a38ad6..d6e23276b38e 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -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;
}
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 137737009ba8..5af937157351 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -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 );
}
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 9029ccc49449..3bf73430f0cc 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -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 );
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx
index c548afa0ab68..13c1fcd6bca0 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -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 );
}
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index ba9476aba0a7..0353c89f67ee 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -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 )