diff options
author | Eike Rathke <erack@redhat.com> | 2014-05-21 17:53:53 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-05-21 18:02:09 +0200 |
commit | cf53a5d4938f6f64bd6d3fe70dd9b555c9d30d0f (patch) | |
tree | ae56da4bf8cc3af0c8a11c02200f629672ac4343 | |
parent | 34f0e4f42594adb97bdb64e5f2e8f00801b48e2e (diff) |
we have GetEntryPos(), use it
Change-Id: Iebb19951efa81817793a155164862076d1198e6e
-rw-r--r-- | include/svx/langbox.hxx | 3 | ||||
-rw-r--r-- | svx/source/dialog/langbox.cxx | 20 |
2 files changed, 15 insertions, 8 deletions
diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index dc872d8ed772..410b2405f30d 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -101,6 +101,7 @@ protected: SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const = 0; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) = 0; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const = 0; + SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryPos( const void* pData ) const = 0; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const = 0; SVX_DLLPRIVATE virtual void ImplSetNoSelection() = 0; SVX_DLLPRIVATE virtual void ImplHide() = 0; @@ -127,6 +128,7 @@ private: SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE; + SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryPos( const void* pData ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE; @@ -155,6 +157,7 @@ private: SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE; + SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryPos( const void* pData ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE; diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 8d934175c39c..92f5cb6b0b8d 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -448,14 +448,7 @@ bool SvxLanguageBoxBase::IsLanguageSelected( const LanguageType eLangType ) cons sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const { - sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND; - sal_Int32 nCount = ImplGetEntryCount(); - - for ( sal_Int32 i=0; nPos == LISTBOX_ENTRY_NOTFOUND && i<nCount; i++ ) - if ( eType == LanguageType((sal_uIntPtr)ImplGetEntryData(i)) ) - nPos = i; - - return nPos; + return ImplGetEntryPos( (void*)(sal_uIntPtr)eType); } @@ -627,6 +620,17 @@ bool SvxLanguageComboBox::ImplIsEntryPosSelected( sal_Int32 nPos ) const } +sal_Int32 SvxLanguageBox::ImplGetEntryPos( const void* pData ) const +{ + return GetEntryPos( pData); +} + +sal_Int32 SvxLanguageComboBox::ImplGetEntryPos( const void* pData ) const +{ + return GetEntryPos( pData); +} + + sal_Int32 SvxLanguageBox::ImplGetEntryCount() const { return GetEntryCount(); |