diff options
author | Noel Grandin <noel@peralex.com> | 2015-12-11 14:57:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-12-12 06:51:56 +0200 |
commit | 0bcef149ce3785306271fa06184eb62950b62087 (patch) | |
tree | 72d69380e36371f09f181a2727a2908846bf099d /sc/inc | |
parent | a3d6d9e4466f9a3d6d2c34bb8f372a5265583573 (diff) |
tdf#96339 fix bug in sort list
this bug was caused by commit
2aacf6c2cd82322b953988ff30d3bc997ae76d7b
"sc: boost::ptr_vector->std::vector"
Since the code in question likes passing around a pointer
to the element of the vector, convert to using
std::vector<std::unique_ptr>
Change-Id: I9e9676fe7c2dc32e23ba6708aaea1f16c1bf2ff8
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/userlist.hxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 1933b8455222..b103aeec97d0 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -22,6 +22,7 @@ #include "scdllapi.h" +#include <memory> #include <vector> /** @@ -46,6 +47,7 @@ private: public: ScUserListData(const OUString& rStr); ScUserListData(const ScUserListData& rData); + ~ScUserListData(); const OUString& GetString() const { return aStr; } void SetString(const OUString& rStr); @@ -61,7 +63,7 @@ public: */ class SC_DLLPUBLIC ScUserList { - typedef std::vector<ScUserListData> DataType; + typedef std::vector< std::unique_ptr<ScUserListData> > DataType; DataType maData; public: typedef DataType::iterator iterator; @@ -83,9 +85,8 @@ public: iterator begin(); const_iterator begin() const; void clear(); - void reserve(size_t nSize) { maData.reserve(nSize); } size_t size() const; - void push_back(const ScUserListData& r) { maData.push_back(r); } + void push_back(ScUserListData* p); void erase(iterator itr); }; |