[Libreoffice-commits] core.git: include/svx svx/source

Eike Rathke erack at redhat.com
Wed May 21 09:08:42 PDT 2014


 include/svx/langbox.hxx       |    3 +++
 svx/source/dialog/langbox.cxx |   20 ++++++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit cf53a5d4938f6f64bd6d3fe70dd9b555c9d30d0f
Author: Eike Rathke <erack at redhat.com>
Date:   Wed May 21 17:53:53 2014 +0200

    we have GetEntryPos(), use it
    
    Change-Id: Iebb19951efa81817793a155164862076d1198e6e

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index dc872d8..410b240 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 8d93417..92f5cb6 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();


More information about the Libreoffice-commits mailing list