From ab72a07f1a1213bf6f9515058865fb898ff7bf24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 24 Dec 2016 15:27:39 +0000 Subject: [PATCH] unwind RID_TOOLBAR_IMGLIST and RID_TOOLBAR_BIGIMGLIST ImageLists Change-Id: Iae7ffce940f90e48dfb95b33abab35ca03a6b305 --- extensions/source/bibliography/bib.hrc | 13 +++++--- extensions/source/bibliography/toolbar.cxx | 35 ++++++++----------- extensions/source/bibliography/toolbar.hxx | 2 -- extensions/source/bibliography/toolbar.src | 39 +++++++++++++--------- 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/extensions/source/bibliography/bib.hrc b/extensions/source/bibliography/bib.hrc index 2a08819171cc..5c7ea6ed58a5 100644 --- a/extensions/source/bibliography/bib.hrc +++ b/extensions/source/bibliography/bib.hrc @@ -25,11 +25,14 @@ #define RID_BIB_START RID_EXTENSIONS_START #endif -//Controls(100) -#define RID_BIB_CONTROLS (RID_BIB_START + 100) -#define RID_TOOLBAR_IMGLIST (RID_BIB_CONTROLS+ 2) -// free -#define RID_TOOLBAR_BIGIMGLIST (RID_BIB_CONTROLS+ 4) +//Bitmaps(100) +#define RID_BIB_IMAGES (RID_BIB_START + 100) +#define RID_EXTBMP_AUTOFILTER_SC (RID_BIB_IMAGES + 1) +#define RID_EXTBMP_FILTERCRIT_SC (RID_BIB_IMAGES + 2) +#define RID_EXTBMP_REMOVE_FILTER_SORT_SC (RID_BIB_IMAGES + 3) +#define RID_EXTBMP_AUTOFILTER_LC (RID_BIB_IMAGES + 4) +#define RID_EXTBMP_FILTERCRIT_LC (RID_BIB_IMAGES + 5) +#define RID_EXTBMP_REMOVE_FILTER_SORT_LC (RID_BIB_IMAGES + 6) // Strings (500) #define RID_BIB_STRING (RID_BIB_START + 200) diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index db6fb3edf1fa..9f5541d1fdfe 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -175,18 +175,16 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink) : ToolBox(pParent, "toolbar", "modules/sbibliography/ui/toolbar.ui") - , aImgLst(BibResId( RID_TOOLBAR_IMGLIST )), - aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )), - aFtSource(VclPtr::Create(this,WB_VCENTER)), - aLBSource(VclPtr::Create(this,WB_DROPDOWN)), - aFtQuery(VclPtr::Create(this,WB_VCENTER)), - aEdQuery(VclPtr::Create(this)), - pPopupMenu(VclPtr::Create()), - nMenuId(0), - nSelMenuItem(0), - aLayoutManager( aLink ), - nSymbolsSize( SFX_SYMBOLS_SIZE_SMALL ), - nOutStyle( 0 ) + , aFtSource(VclPtr::Create(this,WB_VCENTER)) + , aLBSource(VclPtr::Create(this,WB_DROPDOWN)) + , aFtQuery(VclPtr::Create(this,WB_VCENTER)) + , aEdQuery(VclPtr::Create(this)) + , pPopupMenu(VclPtr::Create()) + , nMenuId(0) + , nSelMenuItem(0) + , aLayoutManager(aLink) + , nSymbolsSize(SFX_SYMBOLS_SIZE_SMALL) + , nOutStyle(0) { SvtMiscOptions aSvtMiscOptions; nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize(); @@ -556,7 +554,6 @@ IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void ) RebuildToolbar(); } - IMPL_LINK_NOARG( BibToolBar, SettingsChanged_Impl, VclSimpleEvent&, void ) { // Check if toolbar button size have changed and we have to use system settings @@ -568,7 +565,6 @@ IMPL_LINK_NOARG( BibToolBar, SettingsChanged_Impl, VclSimpleEvent&, void ) } } - void BibToolBar::RebuildToolbar() { ApplyImageList(); @@ -576,16 +572,11 @@ void BibToolBar::RebuildToolbar() Application::PostUserEvent( aLayoutManager ); } - void BibToolBar::ApplyImageList() { - ImageList& rList = ( nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ) ? - ( aImgLst ) : - ( aBigImgLst ); - - SetItemImage(nTBC_BT_AUTOFILTER , rList.GetImage(SID_FM_AUTOFILTER)); - SetItemImage(nTBC_BT_FILTERCRIT , rList.GetImage(SID_FM_FILTERCRIT)); - SetItemImage(nTBC_BT_REMOVEFILTER, rList.GetImage(SID_FM_REMOVE_FILTER_SORT )); + SetItemImage(nTBC_BT_AUTOFILTER, Image(BitmapEx(BibResId(nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_AUTOFILTER_SC : RID_EXTBMP_AUTOFILTER_LC)))); + SetItemImage(nTBC_BT_FILTERCRIT, Image(BitmapEx(BibResId(nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_FILTERCRIT_SC : RID_EXTBMP_FILTERCRIT_LC)))); + SetItemImage(nTBC_BT_REMOVEFILTER, Image(BitmapEx(BibResId(nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_REMOVE_FILTER_SORT_SC : RID_EXTBMP_REMOVE_FILTER_SORT_LC)))); AdjustToolBox(); } diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index e6f4d1abc40b..fc6f01b5518b 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -110,8 +110,6 @@ class BibToolBar: public ToolBox BibToolBarListenerArr aListenerArr; css::uno::Reference< css::frame::XController > xController; Idle aIdle; - ImageList aImgLst; - ImageList aBigImgLst; VclPtr aFtSource; VclPtr aLBSource; VclPtr aFtQuery; diff --git a/extensions/source/bibliography/toolbar.src b/extensions/source/bibliography/toolbar.src index d5103605771f..24a6dc796cd8 100644 --- a/extensions/source/bibliography/toolbar.src +++ b/extensions/source/bibliography/toolbar.src @@ -21,25 +21,34 @@ #include "svx/svxcommands.h" #include "bib.hrc" -#define BIB_IMAGES \ - IdList = \ - { \ - SID_FM_AUTOFILTER; /*10716*/ \ - SID_FM_FILTERCRIT; /*10715*/ \ - SID_FM_REMOVE_FILTER_SORT ; /*10711*/ \ - }; \ - IdCount = { 3; }; - -ImageList RID_TOOLBAR_IMGLIST +Bitmap RID_EXTBMP_AUTOFILTER_SC { - Prefix = "sc"; - BIB_IMAGES + File = "sc10716.png"; }; -ImageList RID_TOOLBAR_BIGIMGLIST +Bitmap RID_EXTBMP_FILTERCRIT_SC { - Prefix = "lc"; - BIB_IMAGES + File = "sc10715.png"; +}; + +Bitmap RID_EXTBMP_REMOVE_FILTER_SORT_SC +{ + File = "sc10711.png"; +}; + +Bitmap RID_EXTBMP_AUTOFILTER_LC +{ + File = "lc10716.png"; +}; + +Bitmap RID_EXTBMP_FILTERCRIT_LC +{ + File = "lc10715.png"; +}; + +Bitmap RID_EXTBMP_REMOVE_FILTER_SORT_LC +{ + File = "lc10711.png"; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */