summaryrefslogtreecommitdiff
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
parent94490fdf76ff9aec05774a6dbbb0b42d87812969 (diff)
Replace GetImage with CommandInfoProvider::GetImageForCommand
And move ToolBoxButtonSize->ImageType mapping code to a common place. Change-Id: If158f4b6f2750054fcf64491c2941706e7d3a329
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.cxx1
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx1
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.cxx1
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.cxx1
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx16
-rw-r--r--include/sfx2/imagemgr.hxx39
-rw-r--r--include/sfx2/tbxctrl.hxx3
-rw-r--r--include/vcl/toolbox.hxx1
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx9
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx1
-rw-r--r--sd/inc/pch/precompiled_sd.hxx1
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx8
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx10
-rw-r--r--sd/source/ui/view/outlview.cxx6
-rw-r--r--sd/source/ui/view/viewoverlaymanager.cxx1
-rw-r--r--sd/uiconfig/simpress/ui/annotationmenu.ui10
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx1
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--sfx2/source/appl/imagemgr.cxx202
-rw-r--r--sfx2/source/dialog/recfloat.cxx1
-rw-r--r--sfx2/source/sidebar/ControllerItem.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx9
-rw-r--r--sfx2/source/sidebar/Tools.cxx4
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx6
-rw-r--r--svx/inc/pch/precompiled_svx.hxx1
-rw-r--r--svx/source/form/tbxform.cxx1
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx1
-rw-r--r--svx/source/sidebar/shapes/DefaultShapesPanel.cxx3
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx5
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx3
-rw-r--r--svx/source/tbxctrls/tbxdrctl.cxx1
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx1
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.cxx18
-rw-r--r--vcl/source/window/toolbox2.cxx21
36 files changed, 53 insertions, 338 deletions
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index 715f1e6c9700..cfad4732a591 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -25,7 +25,6 @@
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index d25b9232ff3c..6ee81319f591 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -27,7 +27,6 @@
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
index f359d409f573..95100060cfb0 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -26,7 +26,6 @@
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 6e48a4688e7f..ca18efbabe77 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -32,7 +32,6 @@
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
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;
diff --git a/include/sfx2/imagemgr.hxx b/include/sfx2/imagemgr.hxx
deleted file mode 100644
index 36f914c53cdf..000000000000
--- a/include/sfx2/imagemgr.hxx
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SFX2_IMAGEMGR_HXX
-#define INCLUDED_SFX2_IMAGEMGR_HXX
-
-#include <sal/config.h>
-#include <sfx2/dllapi.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/frame/XFrame.hpp>
-
-#include <rtl/ustring.hxx>
-#include <vcl/image.hxx>
-
-SFX2_DLLPUBLIC Image SAL_CALL GetImage(
- const css::uno::Reference< css::frame::XFrame >& rFrame,
- const OUString& aURL,
- bool bBig
-);
-
-#endif // INCLUDED_SFX2_IMAGEMGR_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index caa0cfe9bfad..e6002abb8001 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -157,9 +157,6 @@ protected:
// Must be called by subclass to set a new popup window instance
void SetPopupWindow( SfxPopupWindow* pWindow );
- // helper methods
- bool hasBigImages() const;
-
public:
// XComponent
virtual void SAL_CALL dispose() override;
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index a200557a4a2f..650fe127f55c 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -336,6 +336,7 @@ public:
// sets a fixed button size (small, large or dontcare (==autosize))
void SetToolboxButtonSize( ToolBoxButtonSize eSize );
ToolBoxButtonSize GetToolboxButtonSize() const;
+ vcl::ImageType GetImageSize() const;
void SetAlign( WindowAlign eNewAlign = WindowAlign::Top );
WindowAlign GetAlign() const { return meAlign; }
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 2d62a3308b37..8296542b6440 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -20,9 +20,9 @@
#include "rangelst.hxx"
#include "scitems.hxx"
#include <sfx2/bindings.hxx>
-#include <sfx2/imagemgr.hxx>
#include <svl/zforlist.hxx>
#include <vcl/builderfactory.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
@@ -349,13 +349,8 @@ void ScOptSolverDlg::dispose()
void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
{
- // Get the "Delete Rows" commandimagelist images from sfx instead of
- // adding a second copy to sc (see ScTbxInsertCtrl::StateChanged)
-
- OUString aSlotURL( "slot:" );
- aSlotURL += OUString::number( SID_DEL_ROWS );
uno::Reference<frame::XFrame> xFrame = GetBindings().GetActiveFrame();
- Image aDelNm = ::GetImage( xFrame, aSlotURL, false );
+ Image aDelNm = vcl::CommandInfoProvider::GetImageForCommand(".uno:DeleteRows", xFrame);
for (VclPtr<PushButton> & pButton : mpDelButton)
{
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index b35720c8f72a..937387ec2ece 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -23,7 +23,6 @@
#include "scresid.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 72edaa133137..27993c6c65be 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -346,7 +346,6 @@
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/frame.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/linkmgr.hxx>
#include <sfx2/msg.hxx>
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index b2680c08bf11..b5802d726994 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -32,6 +32,7 @@
#include <comphelper/string.hxx>
#include <svx/svxids.hrc>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/settings.hxx>
#include <vcl/menu.hxx>
#include <vcl/msgbox.hxx>
@@ -46,7 +47,6 @@
#include <tools/datetime.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/app.hxx>
@@ -1206,12 +1206,8 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( const Reference< XAnno
sal_uInt16 nId = pMenu->GetItemId( nPos );
if (!pMenu->IsItemEnabled(nId))
continue;
- OString sIdent = pMenu->GetItemIdent(nId);
- sal_uInt16 nSID = IdentToSID(sIdent);
- OUString sSlotURL( "slot:" );
- sSlotURL += OUString::number(nSID);
- Image aImage( GetImage( xFrame, sSlotURL, false ) );
+ Image aImage( vcl::CommandInfoProvider::GetImageForCommand( pMenu->GetItemCommand( nId ), xFrame ) );
if( !!aImage )
pMenu->SetItemImage( nId, aImage );
}
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 521e18f86ce3..888e49fdd367 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -40,7 +40,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/infobar.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/request.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/app.hxx>
@@ -65,6 +64,7 @@
#include "res_bmp.hrc"
#include "sdresid.hxx"
#include <vcl/canvastools.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/settings.hxx>
#include "comphelper/anytostring.hxx"
@@ -2004,13 +2004,13 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl, void*, void)
Reference< css::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if( xFrame.is() )
{
- pMenu->SetItemImage(pMenu->GetItemId("next"), GetImage(xFrame, "slot:10617" , false));
- pMenu->SetItemImage(pMenu->GetItemId("prev"), GetImage(xFrame, "slot:10618" , false));
+ pMenu->SetItemImage(pMenu->GetItemId("next"), vcl::CommandInfoProvider::GetImageForCommand(".uno:NextRecord", xFrame));
+ pMenu->SetItemImage(pMenu->GetItemId("prev"), vcl::CommandInfoProvider::GetImageForCommand(".uno:PrevRecord", xFrame));
if( pPageMenu )
{
- pPageMenu->SetItemImage(pPageMenu->GetItemId("first"), GetImage(xFrame, "slot:10616" , false));
- pPageMenu->SetItemImage(pPageMenu->GetItemId("last"), GetImage(xFrame, "slot:10619" , false));
+ pPageMenu->SetItemImage(pPageMenu->GetItemId("first"), vcl::CommandInfoProvider::GetImageForCommand(".uno:FirstRecord", xFrame));
+ pPageMenu->SetItemImage(pPageMenu->GetItemId("last"), vcl::CommandInfoProvider::GetImageForCommand(".uno:LastRecord", xFrame));
}
}
}
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index f0cbddc14394..5821dde1d610 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -20,6 +20,7 @@
#include "OutlineView.hxx"
#include <editeng/forbiddencharacterstable.hxx>
#include <sfx2/progress.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/svxids.hrc>
#include <editeng/outliner.hxx>
@@ -28,7 +29,6 @@
#include <editeng/lrspitem.hxx>
#include <svx/svdotext.hxx>
#include <sfx2/printer.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <svl/itempool.hxx>
@@ -146,9 +146,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie
maBulletFont.SetShadow(false);
Reference<XFrame> xFrame (mrOutlineViewShell.GetViewShellBase().GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY);
-
- const OUString aSlotURL( ".uno:ShowSlide" );
- maSlideImage = GetImage( xFrame, aSlotURL, true );
+ maSlideImage = vcl::CommandInfoProvider::GetImageForCommand(".uno:ShowSlide", xFrame, vcl::ImageType::Size26);
// Tell undo manager of the document about the undo manager of the
// outliner, so that the former can synchronize with the later.
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
index 44aa1f59e3d0..19254e201c9c 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -20,7 +20,6 @@
#include "sddll.hxx"
#include <com/sun/star/frame/XFrame.hpp>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/app.hxx>
diff --git a/sd/uiconfig/simpress/ui/annotationmenu.ui b/sd/uiconfig/simpress/ui/annotationmenu.ui
index b5bf418e9784..0e8ba5f39645 100644
--- a/sd/uiconfig/simpress/ui/annotationmenu.ui
+++ b/sd/uiconfig/simpress/ui/annotationmenu.ui
@@ -9,6 +9,7 @@
<object class="GtkMenuItem" id="reply">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:ReplyToAnnotation</property>
<property name="label" translatable="yes">_Reply</property>
<property name="use_underline">True</property>
</object>
@@ -23,6 +24,7 @@
<object class="GtkCheckMenuItem" id="bold">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Bold</property>
<property name="label" translatable="yes">_Bold</property>
<property name="use_underline">True</property>
</object>
@@ -31,6 +33,7 @@
<object class="GtkCheckMenuItem" id="italic">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Italic</property>
<property name="label" translatable="yes">_Italic</property>
<property name="use_underline">True</property>
</object>
@@ -39,6 +42,7 @@
<object class="GtkCheckMenuItem" id="underline">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Underline</property>
<property name="label" translatable="yes">_Underline</property>
<property name="use_underline">True</property>
</object>
@@ -47,6 +51,7 @@
<object class="GtkCheckMenuItem" id="strike">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Strikeout</property>
<property name="label" translatable="yes">_Strikethrough</property>
<property name="use_underline">True</property>
</object>
@@ -61,6 +66,7 @@
<object class="GtkMenuItem" id="copy">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Copy</property>
<property name="label" translatable="yes">_Copy</property>
<property name="use_underline">True</property>
</object>
@@ -69,6 +75,7 @@
<object class="GtkMenuItem" id="paste">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:Paste</property>
<property name="label" translatable="yes">_Paste</property>
<property name="use_underline">True</property>
</object>
@@ -83,6 +90,7 @@
<object class="GtkMenuItem" id="delete">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:DeleteAnnotation</property>
<property name="label" translatable="yes">_Delete Comment</property>
<property name="use_underline">True</property>
</object>
@@ -91,6 +99,7 @@
<object class="GtkMenuItem" id="deleteby">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:DeleteAllAnnotationByAuthor</property>
<property name="label" translatable="yes">Delete All Comments b_y %1</property>
<property name="use_underline">True</property>
</object>
@@ -99,6 +108,7 @@
<object class="GtkMenuItem" id="deleteall">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="action_name">.uno:DeleteAllAnnotation</property>
<property name="label" translatable="yes">Delete _All Comments</property>
<property name="use_underline">True</property>
</object>
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 2ad775dcc162..5b0ca8cccd85 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -105,7 +105,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/appl/fwkhelper \
sfx2/source/appl/helpdispatch \
sfx2/source/appl/helpinterceptor \
- sfx2/source/appl/imagemgr \
sfx2/source/appl/imestatuswindow \
sfx2/source/appl/impldde \
sfx2/source/appl/linkmgr2 \
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 570c23b28def..7a3e57ac264d 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -460,7 +460,6 @@
#include <sfx2/frame.hxx>
#include <sfx2/frmdescr.hxx>
#include <sfx2/hintpost.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/infobar.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/linkmgr.hxx>
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 0b14446a7098..234fa72c0f95 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -100,7 +100,6 @@
#include <rtl/strbuf.hxx>
#include <memory>
#include <framework/sfxhelperfunctions.hxx>
-#include <sfx2/imagemgr.hxx>
#include "fwkhelper.hxx"
using namespace ::com::sun::star;
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
deleted file mode 100644
index ad59dccc7a3a..000000000000
--- a/sfx2/source/appl/imagemgr.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sfx2/imagemgr.hxx>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/ui/XImageManager.hpp>
-#include <com/sun/star/frame/ModuleManager.hpp>
-#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
-#include <com/sun/star/ui/ImageType.hpp>
-#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
-
-#include <tools/globname.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/imagemgr.hxx>
-#include <comphelper/processfactory.hxx>
-#include <rtl/ustring.hxx>
-
-#include <sfx2/app.hxx>
-#include <sfx2/unoctitm.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/msg.hxx>
-#include <sfx2/msgpool.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/docfac.hxx>
-
-#include <unordered_map>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::ui;
-
-typedef std::unordered_map< OUString,
- WeakReference< XImageManager >,
- OUStringHash > ModuleIdToImagegMgr;
-
-
-Image SAL_CALL GetImage(
- const css::uno::Reference< css::frame::XFrame >& rFrame,
- const OUString& aURL,
- bool bBig
-)
-{
- // TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel
- if ( !rFrame.is() )
- return Image();
-
- INetURLObject aObj( aURL );
- INetProtocol nProtocol = aObj.GetProtocol();
-
- Reference < XController > xController;
- Reference < XModel > xModel;
- if ( rFrame.is() )
- xController = rFrame->getController();
- if ( xController.is() )
- xModel = xController->getModel();
-
- OUString aCommandURL( aURL );
- if ( nProtocol == INetProtocol::Slot )
- {
- sal_uInt16 nId = ( sal_uInt16 ) aURL.copy(5).toInt32();
- const SfxSlot* pSlot = nullptr;
- if ( xModel.is() )
- {
- Reference < XUnoTunnel > xObj( xModel, UNO_QUERY );
- Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
- sal_Int64 nHandle = xObj.is() ? xObj->getSomething( aSeq ) : 0;
- if ( nHandle )
- {
- SfxObjectShell* pDoc = reinterpret_cast<SfxObjectShell*>(sal::static_int_cast<sal_IntPtr>( nHandle ));
- SfxModule* pModule = pDoc->GetFactory().GetModule();
- pSlot = pModule->GetSlotPool()->GetSlot( nId );
- }
- }
- else
- pSlot = SfxSlotPool::GetSlotPool().GetSlot( nId );
-
- if ( pSlot )
- {
- aCommandURL = ".uno:";
- aCommandURL += OUString::createFromAscii( pSlot->GetUnoName() );
- }
- else
- aCommandURL.clear();
- }
-
- Reference< XImageManager > xDocImgMgr;
- if ( xModel.is() )
- {
- Reference< XUIConfigurationManagerSupplier > xSupplier( xModel, UNO_QUERY );
- if ( xSupplier.is() )
- {
- Reference< XUIConfigurationManager > xDocUICfgMgr( xSupplier->getUIConfigurationManager(), UNO_QUERY );
- xDocImgMgr.set( xDocUICfgMgr->getImageManager(), UNO_QUERY );
- }
- }
-
- sal_Int16 nImageType( css::ui::ImageType::COLOR_NORMAL| css::ui::ImageType::SIZE_DEFAULT );
- if ( bBig )
- nImageType |= css::ui::ImageType::SIZE_LARGE;
-
- if ( xDocImgMgr.is() )
- {
- Sequence< Reference< css::graphic::XGraphic > > aGraphicSeq;
- Sequence<OUString> aImageCmdSeq { aCommandURL };
-
- try
- {
- aGraphicSeq = xDocImgMgr->getImages( nImageType, aImageCmdSeq );
- Reference< css::graphic::XGraphic > xGraphic = aGraphicSeq[0];
- Image aImage( xGraphic );
-
- if ( !!aImage )
- return aImage;
- }
- catch (const Exception&)
- {
- }
- }
-
- static WeakReference< XModuleManager2 > s_xModuleManager;
-
- Reference< XModuleManager2 > xModuleManager = s_xModuleManager;
-
- if ( !xModuleManager.is() )
- {
- xModuleManager = ModuleManager::create(::comphelper::getProcessComponentContext());
- s_xModuleManager = xModuleManager;
- }
-
- try
- {
- if ( !aCommandURL.isEmpty() )
- {
- Reference< XImageManager > xModuleImageManager;
- OUString aModuleId = xModuleManager->identify( rFrame );
-
- static ModuleIdToImagegMgr s_aModuleIdToImageMgrMap;
-
- ModuleIdToImagegMgr::iterator pIter = s_aModuleIdToImageMgrMap.find( aModuleId );
- if ( pIter != s_aModuleIdToImageMgrMap.end() )
- xModuleImageManager = pIter->second;
- else
- {
- static WeakReference< XModuleUIConfigurationManagerSupplier > s_xModuleCfgMgrSupplier;
-
- Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier = s_xModuleCfgMgrSupplier;
-
- if ( !xModuleCfgMgrSupplier.is() )
- {
- xModuleCfgMgrSupplier = theModuleUIConfigurationManagerSupplier::get(
- ::comphelper::getProcessComponentContext() );
-
- s_xModuleCfgMgrSupplier = xModuleCfgMgrSupplier;
- }
-
- Reference< XUIConfigurationManager > xUICfgMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId );
- xModuleImageManager.set( xUICfgMgr->getImageManager(), UNO_QUERY );
- s_aModuleIdToImageMgrMap.insert( ModuleIdToImagegMgr::value_type( aModuleId, xModuleImageManager ));
- }
-
- Sequence< Reference< css::graphic::XGraphic > > aGraphicSeq;
- Sequence<OUString> aImageCmdSeq { aCommandURL };
-
- aGraphicSeq = xModuleImageManager->getImages( nImageType, aImageCmdSeq );
-
- Reference< css::graphic::XGraphic > xGraphic = aGraphicSeq[0];
- Image aImage( xGraphic );
-
- if ( !!aImage )
- return aImage;
- else if ( nProtocol != INetProtocol::Uno && nProtocol != INetProtocol::Slot )
- return SvFileInformationManager::GetImageNoDefault( aObj, bBig );
- }
- }
- catch (const Exception&)
- {
- }
-
- return Image();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index aebfd9c9fe1f..d80d89f965a1 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -30,7 +30,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/imagemgr.hxx>
SFX_IMPL_FLOATINGWINDOW( SfxRecordingFloatWrapper_Impl, SID_RECORDING_FLOATWINDOW );
diff --git a/sfx2/source/sidebar/ControllerItem.cxx b/sfx2/source/sidebar/ControllerItem.cxx
index 2ebff3df3a8c..5bc39b3e664d 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -20,7 +20,6 @@
#include <sfx2/msgpool.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/bindings.hxx>
#include <unotools/cmdoptions.hxx>
#include <vcl/commandinfoprovider.hxx>
diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx
index 8c8db52d0731..e0d72cff36d2 100644
--- a/sfx2/source/sidebar/SidebarPanelBase.cxx
+++ b/sfx2/source/sidebar/SidebarPanelBase.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/SidebarModelUpdate.hxx>
-#include <sfx2/imagemgr.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/layout.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 968366eab8f9..2dc0c5910c62 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -255,13 +255,6 @@ IMPL_LINK_NOARG(SidebarToolBox, ChangedIconSizeHandler, LinkParamNone*, void)
if (mbUseDefaultButtonSize)
SetToolboxButtonSize(GetDefaultButtonSize());
- vcl::ImageType eImageType = vcl::ImageType::Size16;
- ToolBoxButtonSize eSize = GetToolboxButtonSize();
- if (eSize == ToolBoxButtonSize::Large)
- eImageType = vcl::ImageType::Size26;
- else if (eSize == ToolBoxButtonSize::Size32)
- eImageType = vcl::ImageType::Size32;
-
for (auto const& it : maControllers)
{
Reference<frame::XSubToolbarController> xController(it.second, UNO_QUERY);
@@ -275,7 +268,7 @@ IMPL_LINK_NOARG(SidebarToolBox, ChangedIconSizeHandler, LinkParamNone*, void)
{
OUString aCommandURL = GetItemCommand(it.first);
css::uno::Reference<frame::XFrame> xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface();
- Image aImage = vcl::CommandInfoProvider::GetImageForCommand(aCommandURL, xFrame, eImageType);
+ Image aImage = vcl::CommandInfoProvider::GetImageForCommand(aCommandURL, xFrame, GetImageSize());
SetItemImage(it.first, aImage);
}
}
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index b809f7ad96f5..e246599fd9c0 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -21,9 +21,9 @@
#include <sfx2/sidebar/Theme.hxx>
-#include <sfx2/imagemgr.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/namedvaluecollection.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/gradient.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -57,7 +57,7 @@ Image Tools::GetImage (
{
if (rsURL.startsWith(".uno:"))
{
- const Image aPanelImage (::GetImage(rxFrame, rsURL, false));
+ const Image aPanelImage(vcl::CommandInfoProvider::GetImageForCommand(rsURL, rxFrame));
return aPanelImage;
}
else
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index b908b6f932f6..5aed453f2392 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -87,7 +87,6 @@
#include <sfx2/unoctitm.hxx>
#include "helpid.hrc"
#include "workwin.hxx"
-#include <sfx2/imagemgr.hxx>
#include <ctrlfactoryimpl.hxx>
using namespace ::com::sun::star;
@@ -572,11 +571,6 @@ Reference< css::awt::XWindow > SAL_CALL SfxToolBoxControl::createItemWindow( con
return VCLUnoHelper::GetInterface( CreateItemWindow( VCLUnoHelper::GetWindow( rParent )));
}
-bool SfxToolBoxControl::hasBigImages() const
-{
- return (GetToolBox().GetToolboxButtonSize() == ToolBoxButtonSize::Large);
-}
-
void SfxToolBoxControl::SetPopupWindow( SfxPopupWindow* pWindow )
{
pImpl->mpPopupWindow = pWindow;
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index f9aaba9f6051..201a708a4a03 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -324,7 +324,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/dllapi.h>
#include <sfx2/dockwin.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/itemconnect.hxx>
#include <sfx2/module.hxx>
#include <sfx2/objsh.hxx>
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 467834bf9c54..23c97a7c0cbb 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -37,7 +37,6 @@
#include "fmhelp.hrc"
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/imagemgr.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 7ca72f4def9d..d94f52d4211b 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -26,7 +26,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/imagemgr.hxx>
#include <svx/dlgutil.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/virdev.hxx>
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
index a56e004fa670..c67e24a2328f 100644
--- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -19,7 +19,6 @@
#include "DefaultShapesPanel.hxx"
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <sfx2/imagemgr.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <vcl/outdev.hxx>
#include <vcl/commandinfoprovider.hxx>
@@ -131,7 +130,7 @@ void DefaultShapesPanel::populateShapes()
for(std::map<sal_uInt16, rtl::OUString>::size_type i = 0; i < aSet.second.size(); i++)
{
sSlotStr = aSet.second[i];
- aSlotImage = ::GetImage(mxFrame, sSlotStr, false);
+ aSlotImage = vcl::CommandInfoProvider::GetImageForCommand(sSlotStr, mxFrame);
sLabel = vcl::CommandInfoProvider::GetTooltipForCommand(sSlotStr, mxFrame);
aSet.first->InsertItem(i, aSlotImage, sLabel);
}
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index dbabd99ae6f7..bf81afb5e032 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -12,12 +12,12 @@
#include <comphelper/propertysequence.hxx>
#include <i18nlangtag/mslangid.hxx>
-#include <sfx2/imagemgr.hxx>
#include <svtools/popupwindowcontroller.hxx>
#include <svtools/toolbarmenu.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
#include <svx/numvset.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/settings.hxx>
@@ -120,7 +120,8 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
AddStatusListener( ".uno:CurrentOutlineType" );
}
- appendEntry( 1, aMoreItemText, ::GetImage( mrController.getFrameInterface(), ".uno:OutlineBullet", false ) );
+ appendEntry( 1, aMoreItemText,
+ vcl::CommandInfoProvider::GetImageForCommand( ".uno:OutlineBullet", mrController.getFrameInterface() ) );
SetOutputSizePixel( getMenuSize() );
mpValueSet->SetSelectHdl( LINK( this, NumberingPopup, VSSelectValueSetHdl ) );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index e15a571fb1e2..41b4e8ed3f54 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -41,7 +41,6 @@
#include <svl/stritem.hxx>
#include <sfx2/tplpitem.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/templdlg.hxx>
@@ -2915,7 +2914,7 @@ sal_Bool SvxColorToolBoxControl::opensSubToolbar()
void SvxColorToolBoxControl::updateImage()
{
- Image aImage = GetImage( m_xFrame, m_aCommandURL, hasBigImages() );
+ Image aImage = vcl::CommandInfoProvider::GetImageForCommand(m_aCommandURL, m_xFrame, GetToolBox().GetImageSize());
if ( !!aImage )
{
GetToolBox().SetItemImage( GetId(), aImage );
diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx
index 2cf2197108c3..cc45215d388a 100644
--- a/svx/source/tbxctrls/tbxdrctl.cxx
+++ b/svx/source/tbxctrls/tbxdrctl.cxx
@@ -23,7 +23,6 @@
#include <svl/aeitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/viewfrm.hxx>
#include <vcl/toolbox.hxx>
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index da384935b31e..f3bf91fec342 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -24,7 +24,6 @@
#include <sfx2/htmlmode.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/bindings.hxx>
-#include <sfx2/imagemgr.hxx>
#include <sfx2/msgpool.hxx>
#include <swmodule.hxx>
#include <view.hxx>
diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
index 08e5f9392190..d3954521b35a 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
@@ -25,8 +25,8 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
-#include <sfx2/imagemgr.hxx>
#include <svl/eitem.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/settings.hxx>
@@ -148,20 +148,20 @@ void WrapPropertyPanel::Initialize()
mpEnableContour->SetClickHdl(EnableContourLink);
mpSpacingLB->SetSelectHdl(LINK(this, WrapPropertyPanel, SpacingLBHdl));
- mpRBNoWrap->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPOFF, false));
+ mpRBNoWrap->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPOFF, mxFrame));
if ( AllSettings::GetLayoutRTL() )
{
- mpRBWrapLeft->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPRIGHT, false));
- mpRBWrapRight->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPLEFT, false));
+ mpRBWrapLeft->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPRIGHT, mxFrame));
+ mpRBWrapRight->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPLEFT, mxFrame));
}
else
{
- mpRBWrapLeft->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPLEFT, false));
- mpRBWrapRight->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPRIGHT, false));
+ mpRBWrapLeft->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPLEFT, mxFrame));
+ mpRBWrapRight->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPRIGHT, mxFrame));
}
- mpRBWrapParallel->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPON, false));
- mpRBWrapThrough->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPTHROUGH, false));
- mpRBIdealWrap->SetModeRadioImage(::GetImage(mxFrame, UNO_WRAPIDEAL, false));
+ mpRBWrapParallel->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPON, mxFrame));
+ mpRBWrapThrough->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPTHROUGH, mxFrame));
+ mpRBIdealWrap->SetModeRadioImage(vcl::CommandInfoProvider::GetImageForCommand(UNO_WRAPIDEAL, mxFrame));
aCustomEntry = mpCustomEntry->GetText();
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index a8fd640005f1..4c74017a81f0 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -434,15 +434,7 @@ void ToolBox::InsertItem(const OUString& rCommand, const css::uno::Reference<css
OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(rFrame));
OUString aLabel(vcl::CommandInfoProvider::GetLabelForCommand(rCommand, aModuleName));
OUString aTooltip(vcl::CommandInfoProvider::GetTooltipForCommand(rCommand, rFrame));
-
- vcl::ImageType eImageType = vcl::ImageType::Size16;
-
- if (GetToolboxButtonSize() == ToolBoxButtonSize::Large)
- eImageType = vcl::ImageType::Size26;
- else if (GetToolboxButtonSize() == ToolBoxButtonSize::Size32)
- eImageType = vcl::ImageType::Size32;
-
- Image aImage(CommandInfoProvider::GetImageForCommand(rCommand, rFrame, eImageType));
+ Image aImage(CommandInfoProvider::GetImageForCommand(rCommand, rFrame, GetImageSize()));
sal_uInt16 nItemId = GetItemCount() + 1;
//TODO: ImplToolItems::size_type -> sal_uInt16!
@@ -633,6 +625,17 @@ ToolBoxButtonSize ToolBox::GetToolboxButtonSize() const
return mpData->meButtonSize;
}
+ImageType ToolBox::GetImageSize() const
+{
+ ImageType eImageType = ImageType::Size16;
+ if (mpData->meButtonSize == ToolBoxButtonSize::Large)
+ eImageType = ImageType::Size26;
+ else if (mpData->meButtonSize == ToolBoxButtonSize::Size32)
+ eImageType = ImageType::Size32;
+
+ return eImageType;
+}
+
/*static*/ Size ToolBox::GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize)
{
OutputDevice *pDefault = Application::GetDefaultDevice();