Kaydet (Commit) 9d48e8fd authored tarafından Eike Rathke's avatar Eike Rathke

sal_Int32 ComboBox::InsertEntryWithImage()

Change-Id: Iaa1ddc931b71fcdf08d571c7e3573a936d378709
üst 99595346
......@@ -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);
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment