diff options
author | Eike Rathke <erack@redhat.com> | 2014-05-13 15:05:40 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-05-13 15:08:04 +0200 |
commit | 9d48e8fdf4e1efed5fc82e2ca00f2252debc94da (patch) | |
tree | c942fd6ff23c7f4bf4c2d81bd73b218e493f70a1 | |
parent | 99595346359145d8cf909e5795919fb239cccbd9 (diff) |
sal_Int32 ComboBox::InsertEntryWithImage()
Change-Id: Iaa1ddc931b71fcdf08d571c7e3573a936d378709
-rw-r--r-- | include/vcl/combobox.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx index 51770b2b5e73..8af4458651d7 100644 --- a/include/vcl/combobox.hxx +++ b/include/vcl/combobox.hxx @@ -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); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 521d13ab1d97..cfd2e8e45a6a 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -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 ) |