From cf53a5d4938f6f64bd6d3fe70dd9b555c9d30d0f Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 21 May 2014 17:53:53 +0200 Subject: [PATCH] we have GetEntryPos(), use it Change-Id: Iebb19951efa81817793a155164862076d1198e6e --- include/svx/langbox.hxx | 3 +++ 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