diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-12-11 17:31:53 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-12-12 09:52:00 +0100 |
commit | 25f06457382bb5c9c648d65eb102c9d91983cda0 (patch) | |
tree | ac78cbb164fa017413200e946a3d4680fe65a918 /sw | |
parent | b5f372f5517ba4fad7a38cad14684123700055b2 (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/optload.cxx | 49 | ||||
-rw-r--r-- | sw/source/uibase/inc/optload.hxx | 12 |
2 files changed, 6 insertions, 55 deletions
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 |