sal_Int32 ComboBox::InsertEntryWithImage()

Change-Id: Iaa1ddc931b71fcdf08d571c7e3573a936d378709
This commit is contained in:
Eike Rathke
2014-05-13 15:05:40 +02:00
parent 9959534635
commit 9d48e8fdf4
2 changed files with 5 additions and 4 deletions

View File

@@ -130,7 +130,7 @@ public:
virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) SAL_OVERRIDE;
virtual sal_Int32 InsertEntry(const OUString& rStr, sal_Int32 nPos = COMBOBOX_APPEND);
void InsertEntryWithImage( const OUString& rStr, const Image& rImage, sal_Int32 nPos = COMBOBOX_APPEND );
sal_Int32 InsertEntryWithImage( const OUString& rStr, const Image& rImage, sal_Int32 nPos = COMBOBOX_APPEND );
void RemoveEntry( const OUString& rStr );
virtual void RemoveEntryAt(sal_Int32 nPos);

View File

@@ -872,11 +872,11 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos)
return nRealPos;
}
void ComboBox::InsertEntryWithImage(
sal_Int32 ComboBox::InsertEntryWithImage(
const OUString& rStr, const Image& rImage, sal_Int32 const nPos)
{
if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= mpImplLB->GetEntryList()->GetEntryCount())
return;
return COMBOBOX_ERROR;
sal_Int32 nRealPos;
if (nPos == COMBOBOX_APPEND)
@@ -885,13 +885,14 @@ void ComboBox::InsertEntryWithImage(
{
const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
return;
return COMBOBOX_ERROR;
nRealPos = nPos + nMRUCount;
}
nRealPos = mpImplLB->InsertEntry( nRealPos, rStr, rImage );
nRealPos -= mpImplLB->GetEntryList()->GetMRUCount();
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
void ComboBox::RemoveEntry( const OUString& rStr )