summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorRishabh Kumar <kris.kr296@gmail.com>2016-07-06 12:50:54 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-07-06 14:22:07 +0000
commit6a4e4fc74b8b66961fbfa86cde88ce72f84d1544 (patch)
tree8bcf87a57480f47eedf5843fc14f2afa16e912b4 /svx
parentfc95bc132db20e7701088c76da6ec039031feadf (diff)
Add XGradientList to SvxPresetListBox
Change-Id: I0b4af0eb465b997e8bea012b1f2e3cc07cce6ddb Reviewed-on: https://gerrit.libreoffice.org/26953 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/SvxPresetListBox.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx
index c14ad1fa0bba..6a421cd6eac6 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -85,18 +85,29 @@ void SvxPresetListBox::DrawLayout()
SetColCount(getColumnCount());
SetLineCount(5);
}
-
-void SvxPresetListBox::FillPresetListBox(XHatchList& pList, sal_uInt32 nStartIndex)
+template< typename ListType, typename EntryType >
+void SvxPresetListBox::FillPresetListBoxImpl(ListType & pList, sal_uInt32 nStartIndex)
{
const Size aSize(100,60);
BitmapEx aBitmap;
for(long nIndex = 0; nIndex < pList.Count(); nIndex++, nStartIndex++)
{
aBitmap = pList.GetBitmapForPreview(nIndex, aSize);
- InsertItem(nStartIndex, Image(aBitmap), pList.GetHatch( nIndex )->GetName());
+ EntryType *pItem = static_cast<EntryType*>( pList.Get( nIndex ) );
+ InsertItem(nStartIndex, Image(aBitmap), pItem->GetName());
}
}
+void SvxPresetListBox::FillPresetListBox(XGradientList& pList, sal_uInt32 nStartIndex)
+{
+ FillPresetListBoxImpl< XGradientList, XGradientEntry>( pList, nStartIndex );
+}
+
+void SvxPresetListBox::FillPresetListBox(XHatchList& pList, sal_uInt32 nStartIndex)
+{
+ FillPresetListBoxImpl< XHatchList, XHatchEntry>( pList, nStartIndex );
+}
+
IMPL_LINK_TYPED(SvxPresetListBox, OnMenuItemSelected, Menu*, pMenu, bool)
{
if( pMenu == nullptr )