hidden use of removed RID_SVXIMGLIST_FMEXPL resource

Change-Id: I23c64f0071640cb9946340151b7648f47894a113
This commit is contained in:
Caolán McNamara 2016-12-30 14:29:33 +00:00
parent faff682995
commit 3ff74ff16b

View File

@ -45,11 +45,11 @@
#include <memory> #include <memory>
#include "svx/svxids.hrc" #include "svx/svxids.hrc"
#include "svx/fmresids.hrc"
// Copied from svx // Copied from svx
// Function-Id's // Function-Id's
#define RID_FMSHELL_CONVERSIONMENU (RID_FORMS_START + 4) #define RID_FMSHELL_CONVERSIONMENU (RID_FORMS_START + 4)
#define RID_SVXIMGLIST_FMEXPL (RID_FORMS_START + 0)
static const sal_Int16 nConvertSlots[] = static const sal_Int16 nConvertSlots[] =
{ {
@ -61,7 +61,6 @@ static const sal_Int16 nConvertSlots[] =
SID_FM_CONVERTTO_RADIOBUTTON, SID_FM_CONVERTTO_RADIOBUTTON,
SID_FM_CONVERTTO_GROUPBOX, SID_FM_CONVERTTO_GROUPBOX,
SID_FM_CONVERTTO_COMBOBOX, SID_FM_CONVERTTO_COMBOBOX,
// SID_FM_CONVERTTO_GRID,
SID_FM_CONVERTTO_IMAGEBUTTON, SID_FM_CONVERTTO_IMAGEBUTTON,
SID_FM_CONVERTTO_FILECONTROL, SID_FM_CONVERTTO_FILECONTROL,
SID_FM_CONVERTTO_DATE, SID_FM_CONVERTTO_DATE,
@ -75,30 +74,6 @@ static const sal_Int16 nConvertSlots[] =
SID_FM_CONVERTTO_SPINBUTTON SID_FM_CONVERTTO_SPINBUTTON
}; };
static const sal_Int16 nCreateSlots[] =
{
SID_FM_EDIT,
SID_FM_PUSHBUTTON,
SID_FM_FIXEDTEXT,
SID_FM_LISTBOX,
SID_FM_CHECKBOX,
SID_FM_RADIOBUTTON,
SID_FM_GROUPBOX,
SID_FM_COMBOBOX,
// SID_FM_DBGRID,
SID_FM_IMAGEBUTTON,
SID_FM_FILECONTROL,
SID_FM_DATEFIELD,
SID_FM_TIMEFIELD,
SID_FM_NUMERICFIELD,
SID_FM_CURRENCYFIELD,
SID_FM_PATTERNFIELD,
SID_FM_IMAGECONTROL,
SID_FM_FORMATTEDFIELD,
SID_FM_SCROLLBAR,
SID_FM_SPINBUTTON
};
static const char* aCommands[] = static const char* aCommands[] =
{ {
".uno:ConvertToEdit", ".uno:ConvertToEdit",
@ -109,7 +84,6 @@ static const char* aCommands[] =
".uno:ConvertToRadio", ".uno:ConvertToRadio",
".uno:ConvertToGroup", ".uno:ConvertToGroup",
".uno:ConvertToCombo", ".uno:ConvertToCombo",
// ".uno:ConvertToGrid",
".uno:ConvertToImageBtn", ".uno:ConvertToImageBtn",
".uno:ConvertToFileControl", ".uno:ConvertToFileControl",
".uno:ConvertToDate", ".uno:ConvertToDate",
@ -123,6 +97,30 @@ static const char* aCommands[] =
".uno:ConvertToSpinButton" ".uno:ConvertToSpinButton"
}; };
static const sal_Int16 nImgIds[] =
{
RID_SVXBMP_EDITBOX,
RID_SVXBMP_BUTTON,
RID_SVXBMP_FIXEDTEXT,
RID_SVXBMP_LISTBOX,
RID_SVXBMP_CHECKBOX,
RID_SVXBMP_RADIOBUTTON,
RID_SVXBMP_GROUPBOX,
RID_SVXBMP_COMBOBOX,
RID_SVXBMP_IMAGEBUTTON,
RID_SVXBMP_FILECONTROL,
RID_SVXBMP_DATEFIELD,
RID_SVXBMP_TIMEFIELD,
RID_SVXBMP_NUMERICFIELD,
RID_SVXBMP_CURRENCYFIELD,
RID_SVXBMP_PATTERNFIELD,
RID_SVXBMP_IMAGECONTROL,
RID_SVXBMP_FORMATTEDFIELD,
RID_SVXBMP_SCROLLBAR,
RID_SVXBMP_SPINBUTTON,
RID_SVXBMP_NAVIGATIONBAR
};
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
using namespace css::lang; using namespace css::lang;
@ -206,21 +204,14 @@ ControlMenuController::ControlMenuController( const css::uno::Reference< css::un
// private function // private function
void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu ) void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
{ {
std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag())); std::unique_ptr<ResMgr> xResMgr(ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag()));
ResId aResId( RID_SVXIMGLIST_FMEXPL, *pResMgr ); for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(nConvertSlots); ++i)
aResId.SetRT( RSC_IMAGELIST );
if ( pResMgr->IsAvailable( aResId ))
{ {
ImageList aImageList( aResId ); ResId aResId(nImgIds[i], *xResMgr);
for ( sal_uInt32 i=0; i < SAL_N_ELEMENTS(nConvertSlots); ++i ) if (m_bShowMenuImages && xResMgr->IsAvailable(aResId))
{ pPopupMenu->SetItemImage(nConvertSlots[i], Image(BitmapEx(aResId)));
// das entsprechende Image dran else
if ( m_bShowMenuImages ) pPopupMenu->SetItemImage(nConvertSlots[i], Image());
pPopupMenu->SetItemImage( nConvertSlots[i], aImageList.GetImage(nCreateSlots[i]));
else
pPopupMenu->SetItemImage( nConvertSlots[i], Image() );
}
} }
} }