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

Eike Rathke erack at redhat.com
Fri May 16 13:10:45 PDT 2014


 include/svx/langbox.hxx       |   31 +++++++++++-
 svx/source/dialog/langbox.cxx |  101 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 125 insertions(+), 7 deletions(-)

New commits:
commit 0ab5802eb0e530e930bed6d5dbed1a0317ae323b
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 16 22:00:15 2014 +0200

    more SvxLanguageBoxBase interfacing
    
    Change-Id: Ife9317d40756099ae4d8ecb84cccea91bd75a14c

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index a278fac..dc872d8 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -69,6 +69,14 @@ public:
     LanguageType    GetSelectLanguage() const;
     bool            IsLanguageSelected( const LanguageType eLangType ) const;
 
+    void                SetNoSelectionLBB();
+    void                HideLBB();
+    void                DisableLBB();
+    void                SaveValueLBB();
+    sal_Int32           GetSelectEntryPosLBB( sal_Int32 nSelIndex = 0 ) const;
+    void*               GetEntryDataLBB( sal_Int32  nPos ) const;
+    sal_Int32           GetSavedValueLBB() const;
+
 protected:
     Image                   m_aNotCheckedImage;
     Image                   m_aCheckedImage;
@@ -89,11 +97,16 @@ protected:
     SVX_DLLPRIVATE virtual void         ImplClear() = 0;
     SVX_DLLPRIVATE virtual sal_Int32    ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) = 0;
     SVX_DLLPRIVATE virtual void         ImplSetEntryData( sal_Int32 nPos, void* pData ) = 0;
-    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos() const = 0;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const = 0;
     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    ImplGetEntryCount() const = 0;
+    SVX_DLLPRIVATE virtual void         ImplSetNoSelection() = 0;
+    SVX_DLLPRIVATE virtual void         ImplHide() = 0;
+    SVX_DLLPRIVATE virtual void         ImplDisable() = 0;
+    SVX_DLLPRIVATE virtual void         ImplSaveValue() = 0;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSavedValue() const = 0;
 };
 
 
@@ -110,11 +123,16 @@ private:
     SVX_DLLPRIVATE virtual void         ImplClear() SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual sal_Int32    ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual void         ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE;
-    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos() const SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const SAL_OVERRIDE;
     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    ImplGetEntryCount() const SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplSetNoSelection() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplHide() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplDisable() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplSaveValue() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSavedValue() const SAL_OVERRIDE;
 };
 
 
@@ -125,17 +143,24 @@ public:
     virtual ~SvxLanguageComboBox();
 
 private:
+    sal_Int32   mnSavedValuePos;
+
     SVX_DLLPRIVATE virtual sal_Int32    ImplInsertImgEntry( const OUString& rEntry, sal_Int32  nPos, bool bChecked ) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual void         ImplRemoveEntryAt( sal_Int32 nPos ) SAL_OVERRIDE;
 
     SVX_DLLPRIVATE virtual void         ImplClear() SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual sal_Int32    ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual void         ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE;
-    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos() const SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const SAL_OVERRIDE;
     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    ImplGetEntryCount() const SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplSetNoSelection() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplHide() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplDisable() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual void         ImplSaveValue() SAL_OVERRIDE;
+    SVX_DLLPRIVATE virtual sal_Int32    ImplGetSavedValue() const SAL_OVERRIDE;
 };
 
 #endif
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 41ae5bf..8d93417 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -459,6 +459,42 @@ sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const
 }
 
 
+void SvxLanguageBoxBase::SetNoSelectionLBB()
+{
+    ImplSetNoSelection();
+}
+
+void SvxLanguageBoxBase::HideLBB()
+{
+    ImplHide();
+}
+
+void SvxLanguageBoxBase::DisableLBB()
+{
+    ImplDisable();
+}
+
+void SvxLanguageBoxBase::SaveValueLBB()
+{
+    ImplSaveValue();
+}
+
+sal_Int32 SvxLanguageBoxBase::GetSelectEntryPosLBB( sal_Int32 nSelIndex ) const
+{
+    return ImplGetSelectEntryPos( nSelIndex);
+}
+
+void* SvxLanguageBoxBase::GetEntryDataLBB( sal_Int32  nPos ) const
+{
+    return ImplGetEntryData( nPos);
+}
+
+sal_Int32 SvxLanguageBoxBase::GetSavedValueLBB() const
+{
+    return ImplGetSavedValue();
+}
+
+
 SvxLanguageBox::SvxLanguageBox( Window* pParent, WinBits nBits, bool bCheck )
     : ListBox( pParent, nBits )
     , SvxLanguageBoxBase( bCheck )
@@ -477,6 +513,7 @@ SvxLanguageBox::~SvxLanguageBox()
 SvxLanguageComboBox::SvxLanguageComboBox( Window* pParent, WinBits nBits, bool bCheck )
     : ComboBox( pParent, nBits )
     , SvxLanguageBoxBase( bCheck )
+    , mnSavedValuePos( COMBOBOX_ENTRY_NOTFOUND )
 {
     // display entries sorted
     SetStyle( GetStyle() | WB_SORT );
@@ -546,14 +583,14 @@ void SvxLanguageComboBox::ImplSetEntryData( sal_Int32 nPos, void* pData )
 }
 
 
-sal_Int32 SvxLanguageBox::ImplGetSelectEntryPos() const
+sal_Int32 SvxLanguageBox::ImplGetSelectEntryPos( sal_Int32 nSelIndex ) const
 {
-    return GetSelectEntryPos();
+    return GetSelectEntryPos( nSelIndex);
 }
 
-sal_Int32 SvxLanguageComboBox::ImplGetSelectEntryPos() const
+sal_Int32 SvxLanguageComboBox::ImplGetSelectEntryPos( sal_Int32 nSelIndex ) const
 {
-    return GetSelectEntryPos();
+    return GetSelectEntryPos( nSelIndex);
 }
 
 
@@ -601,4 +638,60 @@ sal_Int32 SvxLanguageComboBox::ImplGetEntryCount() const
 }
 
 
+void SvxLanguageBox::ImplSetNoSelection()
+{
+    SetNoSelection();
+}
+
+void SvxLanguageComboBox::ImplSetNoSelection()
+{
+    SetNoSelection();
+}
+
+
+void SvxLanguageBox::ImplHide()
+{
+    Hide();
+}
+
+void SvxLanguageComboBox::ImplHide()
+{
+    Hide();
+}
+
+
+void SvxLanguageBox::ImplDisable()
+{
+    Disable();
+}
+
+void SvxLanguageComboBox::ImplDisable()
+{
+    Disable();
+}
+
+
+void SvxLanguageBox::ImplSaveValue()
+{
+    SaveValue();
+}
+
+void SvxLanguageComboBox::ImplSaveValue()
+{
+    // Emulate the ListBox behavior.
+    mnSavedValuePos = GetSelectEntryPos();
+}
+
+
+sal_Int32 SvxLanguageBox::ImplGetSavedValue() const
+{
+    return GetSavedValue();
+}
+
+sal_Int32 SvxLanguageComboBox::ImplGetSavedValue() const
+{
+    return mnSavedValuePos;
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list