diff options
author | Eike Rathke <erack@redhat.com> | 2014-05-13 19:19:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-05-15 12:34:35 +0200 |
commit | 1d1a28290a87e2db9e01535792aa0ed3dcbd27b7 (patch) | |
tree | 9e3c8cd031579b6915beb477ead839afc2fe2372 | |
parent | interface with COMBOBOX_... instead of LISTBOX_... (diff) | |
download | core-1d1a28290a87e2db9e01535792aa0ed3dcbd27b7.tar.gz core-1d1a28290a87e2db9e01535792aa0ed3dcbd27b7.zip |
+sal_Int32 ComboBox::GetEntryPos( const void* pData ) const
Change-Id: I9199da366eb70e818e1d85823cd7cf530f70167d
-rw-r--r-- | include/vcl/combobox.hxx | 1 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx index 85ea06f9683c..3ea2f64a0375 100644 --- a/include/vcl/combobox.hxx +++ b/include/vcl/combobox.hxx @@ -138,6 +138,7 @@ public: void Clear(); sal_Int32 GetEntryPos( const OUString& rStr ) const; + sal_Int32 GetEntryPos( const void* pData ) const; Image GetEntryImage( sal_Int32 nPos ) const; OUString GetEntry( sal_Int32 nPos ) const; sal_Int32 GetEntryCount() const; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index cfd2e8e45a6a..a5810f27a074 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -931,6 +931,14 @@ sal_Int32 ComboBox::GetEntryPos( const OUString& rStr ) const return nPos; } +sal_Int32 ComboBox::GetEntryPos( const void* pData ) const +{ + sal_Int32 nPos = mpImplLB->GetEntryList()->FindEntry( pData ); + if ( nPos != LISTBOX_ENTRY_NOTFOUND ) + nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount(); + return nPos; +} + OUString ComboBox::GetEntry( sal_Int32 nPos ) const { const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount(); |