[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 12 08:52:28 UTC 2018


 sw/source/ui/config/optload.cxx  |   49 ++++-----------------------------------
 sw/source/uibase/inc/optload.hxx |   12 ---------
 2 files changed, 6 insertions(+), 55 deletions(-)

New commits:
commit 25f06457382bb5c9c648d65eb102c9d91983cda0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 11 17:31:53 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 12 09:52:00 2018 +0100

    m_EntryList just shadows ComboBox entries
    
    seems CaptionComboBox has devolved to a ComboBox that doesn't allow typing
    space
    
    Change-Id: I6beffaa8157eb91f0fd9fbe7f0de92a54e97470c
    Reviewed-on: https://gerrit.libreoffice.org/64979
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index e036f6f53254..118ea1ecad1c 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -722,15 +722,15 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl, SvTreeListBox*, void)
                 SwFieldType *pType = pMgr->GetFieldType( SwFieldIds::Unknown, i );
                 if( pType->Which() == SwFieldIds::SetExp &&
                     static_cast<SwSetExpFieldType *>( pType)->GetType() & nsSwGetSetExpType::GSE_SEQ )
-                    m_pCategoryBox->InsertSwEntry(pType->GetName());
+                    m_pCategoryBox->InsertEntry(pType->GetName());
             }
         }
         else
         {
-            m_pCategoryBox->InsertSwEntry(m_sIllustration);
-            m_pCategoryBox->InsertSwEntry(m_sTable);
-            m_pCategoryBox->InsertSwEntry(m_sText);
-            m_pCategoryBox->InsertSwEntry(m_sDrawing);
+            m_pCategoryBox->InsertEntry(m_sIllustration);
+            m_pCategoryBox->InsertEntry(m_sTable);
+            m_pCategoryBox->InsertEntry(m_sText);
+            m_pCategoryBox->InsertEntry(m_sDrawing);
         }
 
         if(!pOpt->GetCategory().isEmpty())
@@ -750,7 +750,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl, SvTreeListBox*, void)
                 case TABLE_CAP:         nPos = 2;   break;
                 case FRAME_CAP:         nPos = 3;   break;
             }
-            m_pCategoryBox->SetText(m_pCategoryBox->GetSwEntry(nPos));
+            m_pCategoryBox->SetText(m_pCategoryBox->GetEntry(nPos));
         }
 
         for (sal_Int32 i = 0; i < m_pFormatBox->GetEntryCount(); i++)
@@ -950,43 +950,6 @@ CaptionComboBox::~CaptionComboBox()
 {
 }
 
-sal_Int32 CaptionComboBox::InsertEntry(const OUString& rStr, sal_Int32)
-{
-    InsertSwEntry(rStr);
-    return 0;
-}
-
-void CaptionComboBox::InsertSwEntry(const OUString& rEntry)
-{
-    InsertSorted(rEntry);
-}
-
-void CaptionComboBox::InsertSorted(OUString const& rEntry)
-{
-    ComboBox::InsertEntry(rEntry);
-    sal_Int32 nPos = ComboBox::GetEntryPos(rEntry);
-    m_EntryList.insert(m_EntryList.begin() + nPos, rEntry);
-}
-
-void CaptionComboBox::RemoveEntryAt(sal_Int32 const nPos)
-{
-    if (nPos < 0 || static_cast<size_t>(nPos) >= m_EntryList.size())
-        return;
-
-    // Remove old element
-    ComboBox::RemoveEntryAt(nPos);
-
-    m_EntryList.erase(m_EntryList.begin() + nPos);
-}
-
-const OUString& CaptionComboBox::GetSwEntry(sal_Int32 const nPos) const
-{
-    if (0 <= nPos && static_cast<size_t>(nPos) < m_EntryList.size())
-        return m_EntryList[nPos];
-
-    return aDefault;
-}
-
 // Description: ComboBox without Spaces
 void CaptionComboBox::KeyInput(const KeyEvent& rEvt)
 {
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index cf7b270d3a24..f39e63420f63 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -101,24 +101,12 @@ public:
 
 class CaptionComboBox : public ComboBox
 {
-    std::vector<OUString> m_EntryList;
-    OUString const        aDefault;
-
-    void InsertSorted(OUString const& rEntry);
-
 protected:
     virtual void KeyInput( const KeyEvent& ) override;
 
 public:
     CaptionComboBox(vcl::Window* pParent, WinBits nStyle);
     virtual ~CaptionComboBox() override;
-
-    void                    InsertSwEntry(const OUString&);
-    virtual sal_Int32       InsertEntry(const OUString& rStr, sal_Int32 = COMBOBOX_APPEND) override;
-
-    virtual void            RemoveEntryAt(sal_Int32 nPos) override;
-
-    const OUString&         GetSwEntry(sal_Int32) const;
 };
 
 class SwCaptionPreview : public vcl::Window


More information about the Libreoffice-commits mailing list