summaryrefslogtreecommitdiff
path: root/framework/source/uielement/popuptoolbarcontroller.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-04-23 15:04:36 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-04-23 19:50:15 +0300
commitfb698d5e81c8b4149c092305506d40e2f7ef7f5d (patch)
tree7d4cc743d6fe75f628e974a1144379a7f6c563c9 /framework/source/uielement/popuptoolbarcontroller.cxx
parent94490fdf76ff9aec05774a6dbbb0b42d87812969 (diff)
Replace GetImage with CommandInfoProvider::GetImageForCommand
And move ToolBoxButtonSize->ImageType mapping code to a common place. Change-Id: If158f4b6f2750054fcf64491c2941706e7d3a329
Diffstat (limited to 'framework/source/uielement/popuptoolbarcontroller.cxx')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx16
1 files changed, 2 insertions, 14 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 74ff9da3f400..7227f05bf847 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -56,16 +56,6 @@ using namespace framework;
namespace
{
-vcl::ImageType getImageType(ToolBoxButtonSize eSize)
-{
- vcl::ImageType eImageType = vcl::ImageType::Size16;
- if (eSize == ToolBoxButtonSize::Large)
- eImageType = vcl::ImageType::Size26;
- else if (eSize == ToolBoxButtonSize::Size32)
- eImageType = vcl::ImageType::Size32;
- return eImageType;
-}
-
typedef cppu::ImplInheritanceHelper< svt::ToolboxController,
css::lang::XServiceInfo >
ToolBarBase;
@@ -383,9 +373,7 @@ void GenericPopupToolbarController::functionExecuted( const OUString& rCommand )
pToolBox->SetItemText( nId, vcl::CommandInfoProvider::GetLabelForCommand( rCommand, m_sModuleName ) );
pToolBox->SetQuickHelpText( nId, vcl::CommandInfoProvider::GetTooltipForCommand( rCommand, m_xFrame ) );
- vcl::ImageType eImageType = getImageType(pToolBox->GetToolboxButtonSize());
-
- Image aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommand, m_xFrame, eImageType);
+ Image aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommand, m_xFrame, pToolBox->GetImageSize());
if ( !!aImage )
pToolBox->SetItemImage( nId, aImage );
}
@@ -497,7 +485,7 @@ void SaveToolbarController::updateImage()
if ( !getToolboxId( nId, &pToolBox ) )
return;
- vcl::ImageType eImageType = getImageType(pToolBox->GetToolboxButtonSize());
+ vcl::ImageType eImageType = pToolBox->GetImageSize();
Image aImage;