sal_Int32 ComboBox::InsertEntryWithImage()
Change-Id: Iaa1ddc931b71fcdf08d571c7e3573a936d378709
This commit is contained in:
@@ -130,7 +130,7 @@ public:
|
|||||||
virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) SAL_OVERRIDE;
|
virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual sal_Int32 InsertEntry(const OUString& rStr, sal_Int32 nPos = COMBOBOX_APPEND);
|
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 );
|
void RemoveEntry( const OUString& rStr );
|
||||||
virtual void RemoveEntryAt(sal_Int32 nPos);
|
virtual void RemoveEntryAt(sal_Int32 nPos);
|
||||||
|
@@ -872,11 +872,11 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, sal_Int32 const nPos)
|
|||||||
return nRealPos;
|
return nRealPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::InsertEntryWithImage(
|
sal_Int32 ComboBox::InsertEntryWithImage(
|
||||||
const OUString& rStr, const Image& rImage, sal_Int32 const nPos)
|
const OUString& rStr, const Image& rImage, sal_Int32 const nPos)
|
||||||
{
|
{
|
||||||
if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= mpImplLB->GetEntryList()->GetEntryCount())
|
if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= mpImplLB->GetEntryList()->GetEntryCount())
|
||||||
return;
|
return COMBOBOX_ERROR;
|
||||||
|
|
||||||
sal_Int32 nRealPos;
|
sal_Int32 nRealPos;
|
||||||
if (nPos == COMBOBOX_APPEND)
|
if (nPos == COMBOBOX_APPEND)
|
||||||
@@ -885,13 +885,14 @@ void ComboBox::InsertEntryWithImage(
|
|||||||
{
|
{
|
||||||
const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
|
const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
|
||||||
if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
|
if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
|
||||||
return;
|
return COMBOBOX_ERROR;
|
||||||
nRealPos = nPos + nMRUCount;
|
nRealPos = nPos + nMRUCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
nRealPos = mpImplLB->InsertEntry( nRealPos, rStr, rImage );
|
nRealPos = mpImplLB->InsertEntry( nRealPos, rStr, rImage );
|
||||||
nRealPos -= mpImplLB->GetEntryList()->GetMRUCount();
|
nRealPos -= mpImplLB->GetEntryList()->GetMRUCount();
|
||||||
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
|
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
|
||||||
|
return nRealPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::RemoveEntry( const OUString& rStr )
|
void ComboBox::RemoveEntry( const OUString& rStr )
|
||||||
|
Reference in New Issue
Block a user