summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-30 19:16:46 +0100
committerMichael Stahl <mstahl@redhat.com>2015-10-30 19:51:09 +0100
commit872f449377f24c97877ae3fe9c35549ef3c0c531 (patch)
treeead82ac8b969bbf8b4711e613d0e4cf8aa6f026a /svl/source
parent9eda4d7f2f610a7f155146ab775114cf61822a71 (diff)
svl: replace boost::ptr_vector with std::vector
Change-Id: I7377f9e99b0567a942cdb36f6964ffedacce6a68
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/items/aeitem.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx
index b5896c5af304..5f30d90c4ec6 100644
--- a/svl/source/items/aeitem.cxx
+++ b/svl/source/items/aeitem.cxx
@@ -20,7 +20,8 @@
#include <rtl/ustring.hxx>
#include <svl/aeitem.hxx>
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
+
+#include <vector>
TYPEINIT1_AUTOFACTORY(SfxAllEnumItem, SfxEnumItem)
@@ -36,27 +37,27 @@ class SfxAllEnumValueArr : boost::noncopyable
{
public:
const SfxAllEnumValue_Impl &operator[](size_t i) const {
- return mValues[i];
+ return m_Values[i];
}
bool empty() const {
- return mValues.empty();
+ return m_Values.empty();
}
- void Insert(sal_uInt16 n, SfxAllEnumValue_Impl *value) {
- mValues.insert(mValues.begin() + n, value);
+ void Insert(sal_uInt16 n, SfxAllEnumValue_Impl const& value) {
+ m_Values.insert(m_Values.begin() + n, value);
}
void Erase(sal_uInt16 n) {
- mValues.erase(mValues.begin() + n);
+ m_Values.erase(m_Values.begin() + n);
}
size_t size() const {
- return mValues.size();
+ return m_Values.size();
}
private:
- boost::ptr_vector<SfxAllEnumValue_Impl> mValues;
+ std::vector<SfxAllEnumValue_Impl> m_Values;
};
@@ -113,10 +114,10 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
for ( size_t nPos = 0; nPos < rCopy.pValues->size(); ++nPos )
{
- SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
- pVal->nValue = (*rCopy.pValues)[nPos].nValue;
- pVal->aText = (*rCopy.pValues)[nPos].aText;
- pValues->Insert( nPos, pVal );
+ SfxAllEnumValue_Impl aVal;
+ aVal.nValue = (*rCopy.pValues)[nPos].nValue;
+ aVal.aText = (*rCopy.pValues)[nPos].aText;
+ pValues->Insert( nPos, aVal );
}
if( rCopy.pDisabledValues )
@@ -208,29 +209,29 @@ sal_uInt16 SfxAllEnumItem::GetPosByValue( sal_uInt16 nValue ) const
void SfxAllEnumItem::InsertValue( sal_uInt16 nValue, const OUString &rValue )
{
- SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
- pVal->nValue = nValue;
- pVal->aText = rValue;
+ SfxAllEnumValue_Impl aVal;
+ aVal.nValue = nValue;
+ aVal.aText = rValue;
if ( !pValues )
pValues = new SfxAllEnumValueArr;
else if ( GetPosByValue( nValue ) != USHRT_MAX )
// remove when exists
RemoveValue( nValue );
// then insert
- pValues->Insert( _GetPosByValue(nValue), pVal ); // FIXME: Duplicates?
+ pValues->Insert( _GetPosByValue(nValue), aVal ); // FIXME: Duplicates?
}
void SfxAllEnumItem::InsertValue( sal_uInt16 nValue )
{
- SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
- pVal->nValue = nValue;
- pVal->aText = OUString::number(nValue);
+ SfxAllEnumValue_Impl aVal;
+ aVal.nValue = nValue;
+ aVal.aText = OUString::number(nValue);
if ( !pValues )
pValues = new SfxAllEnumValueArr;
- pValues->Insert( _GetPosByValue(nValue), pVal ); // FIXME: Duplicates?
+ pValues->Insert( _GetPosByValue(nValue), aVal ); // FIXME: Duplicates?
}
void SfxAllEnumItem::DisableValue( sal_uInt16 nValue )