summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-05 21:44:48 +0200
committerMichael Stahl <mstahl@redhat.com>2015-10-05 23:28:06 +0200
commitb6b3251683d5a3bfbf038127f8bd226e23698bce (patch)
tree33a66af46fb00e2f65d4ca89244ca0caacbdf298 /sw/source
parent63b0a1fe18ac38cded0774a0119c2aea4ff01593 (diff)
sw: replace boost::ptr_vector with std::vector
Change-Id: If7b9251a1b3f953a7386d621da40b0c14bbf61be
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/cctrl/swlbox.cxx35
-rw-r--r--sw/source/uibase/inc/swlbox.hxx11
2 files changed, 23 insertions, 23 deletions
diff --git a/sw/source/uibase/cctrl/swlbox.cxx b/sw/source/uibase/cctrl/swlbox.cxx
index b17e28a6314f..7d048161b353 100644
--- a/sw/source/uibase/cctrl/swlbox.cxx
+++ b/sw/source/uibase/cctrl/swlbox.cxx
@@ -58,8 +58,7 @@ void SwComboBox::Init()
sal_Int32 nSize = GetEntryCount();
for( sal_Int32 i=0; i < nSize; ++i )
{
- SwBoxEntry* pTmp = new SwBoxEntry(ComboBox::GetEntry(i), i);
- aEntryLst.push_back(pTmp);
+ m_EntryList.push_back(SwBoxEntry(ComboBox::GetEntry(i), i));
}
}
@@ -70,7 +69,7 @@ SwComboBox::~SwComboBox()
void SwComboBox::InsertSwEntry(const SwBoxEntry& rEntry)
{
- InsertSorted(new SwBoxEntry(rEntry));
+ InsertSorted(rEntry);
}
sal_Int32 SwComboBox::InsertEntry(const OUString& rStr, sal_Int32)
@@ -81,23 +80,23 @@ sal_Int32 SwComboBox::InsertEntry(const OUString& rStr, sal_Int32)
void SwComboBox::RemoveEntryAt(sal_Int32 const nPos)
{
- if(nPos < 0 || static_cast<size_t>(nPos) >= aEntryLst.size())
+ if (nPos < 0 || static_cast<size_t>(nPos) >= m_EntryList.size())
return;
// Remove old element
- SwBoxEntry* pEntry = &aEntryLst[nPos];
+ SwBoxEntry const& rEntry = m_EntryList[nPos];
ComboBox::RemoveEntryAt(nPos);
// Don't add new entries to the list
- if(pEntry->bNew)
+ if (rEntry.bNew)
{
- aEntryLst.erase(aEntryLst.begin() + nPos);
+ m_EntryList.erase(m_EntryList.begin() + nPos);
}
else
{
// add to DelEntryLst
- aDelEntryLst.transfer(aDelEntryLst.end(),
- aEntryLst.begin() + nPos, aEntryLst);
+ m_DelEntryList.push_back(m_EntryList[nPos]);
+ m_EntryList.erase(m_EntryList.begin() + nPos);
}
}
@@ -108,30 +107,30 @@ sal_Int32 SwComboBox::GetSwEntryPos(const SwBoxEntry& rEntry) const
const SwBoxEntry& SwComboBox::GetSwEntry(sal_Int32 const nPos) const
{
- if(0 <= nPos && static_cast<size_t>(nPos) < aEntryLst.size())
- return aEntryLst[nPos];
+ if (0 <= nPos && static_cast<size_t>(nPos) < m_EntryList.size())
+ return m_EntryList[nPos];
return aDefault;
}
sal_Int32 SwComboBox::GetRemovedCount() const
{
- return static_cast<sal_Int32>(aDelEntryLst.size());
+ return static_cast<sal_Int32>(m_DelEntryList.size());
}
const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_Int32 nPos) const
{
- if(0 <= nPos && static_cast<size_t>(nPos) < aDelEntryLst.size())
- return aDelEntryLst[nPos];
+ if (0 <= nPos && static_cast<size_t>(nPos) < m_DelEntryList.size())
+ return m_DelEntryList[nPos];
return aDefault;
}
-void SwComboBox::InsertSorted(SwBoxEntry* pEntry)
+void SwComboBox::InsertSorted(SwBoxEntry const& rEntry)
{
- ComboBox::InsertEntry(pEntry->aName);
- sal_Int32 nPos = ComboBox::GetEntryPos(pEntry->aName);
- aEntryLst.insert( aEntryLst.begin() + nPos, pEntry );
+ ComboBox::InsertEntry(rEntry.aName);
+ sal_Int32 nPos = ComboBox::GetEntryPos(rEntry.aName);
+ m_EntryList.insert(m_EntryList.begin() + nPos, rEntry);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/swlbox.hxx b/sw/source/uibase/inc/swlbox.hxx
index a845479402e9..d07472f99df5 100644
--- a/sw/source/uibase/inc/swlbox.hxx
+++ b/sw/source/uibase/inc/swlbox.hxx
@@ -22,12 +22,13 @@
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include "swdllapi.h"
-#include <boost/ptr_container/ptr_vector.hpp>
+
+#include <vector>
class SwBoxEntry;
namespace vcl { class Window; }
-typedef boost::ptr_vector<SwBoxEntry> SwEntryLst;
+typedef std::vector<SwBoxEntry> SwEntryList;
class SW_DLLPUBLIC SwBoxEntry
{
@@ -50,11 +51,11 @@ public:
// for combo boxes
class SW_DLLPUBLIC SwComboBox : public ComboBox
{
- SwEntryLst aEntryLst;
- SwEntryLst aDelEntryLst;
+ SwEntryList m_EntryList;
+ SwEntryList m_DelEntryList;
SwBoxEntry aDefault;
- SAL_DLLPRIVATE void InsertSorted(SwBoxEntry* pEntry);
+ SAL_DLLPRIVATE void InsertSorted(SwBoxEntry const& rEntry);
SAL_DLLPRIVATE void Init();
public: