summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-06-01 19:14:40 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-06-01 19:14:40 -0400
commitb4d153610889c00967521ca31d5429b98547c949 (patch)
tree4a70565ad85b730422d86a0497c6ec00976d254c /sc/inc
parent3471d7eef30df7e2e1288b8c7708d3f3857c02ae (diff)
ScUserList and ScUserListData no longer dependent of ScCollection.
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/userlist.hxx32
1 files changed, 21 insertions, 11 deletions
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index acfac1249288..5fa00ebe93a5 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -31,14 +31,13 @@
#include <tools/stream.hxx>
#include "scdllapi.h"
-#include "collect.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
/**
* Stores individual user-defined sort list.
*/
-class SC_DLLPUBLIC ScUserListData : public ScDataObject
+class SC_DLLPUBLIC ScUserListData
{
public:
struct SubStr
@@ -57,9 +56,7 @@ private:
public:
ScUserListData(const ::rtl::OUString& rStr);
ScUserListData(const ScUserListData& rData);
- virtual ~ScUserListData();
-
- virtual ScDataObject* Clone() const { return new ScUserListData(*this); }
+ ~ScUserListData();
const ::rtl::OUString& GetString() const { return aStr; }
void SetString(const ::rtl::OUString& rStr);
@@ -73,22 +70,35 @@ public:
/**
* Collection of user-defined sort lists.
*/
-class SC_DLLPUBLIC ScUserList : public ScCollection
+class SC_DLLPUBLIC ScUserList
{
+ typedef ::boost::ptr_vector<ScUserListData> DataType;
+ DataType maData;
public:
- ScUserList( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4);
- ScUserList( const ScUserList& rUserList ) : ScCollection ( rUserList ) {}
+ typedef DataType::iterator iterator;
+ typedef DataType::const_iterator const_iterator;
- virtual ScDataObject* Clone() const;
+ ScUserList();
+ ScUserList(const ScUserList& r);
- ScUserListData* GetData( const ::rtl::OUString& rSubStr ) const;
+ const ScUserListData* GetData( const ::rtl::OUString& rSubStr ) const;
/// If the list in rStr is already inserted
bool HasEntry( const ::rtl::OUString& rStr ) const;
- ScUserListData* operator[]( const sal_uInt16 nIndex) const;
+ const ScUserListData* operator[](size_t nIndex) const;
+ ScUserListData* operator[](size_t nIndex);
ScUserList& operator= ( const ScUserList& r );
bool operator==( const ScUserList& r ) const;
bool operator!=( const ScUserList& r ) const;
+
+ iterator begin();
+ iterator end();
+ const_iterator begin() const;
+ const_iterator end() const;
+ void clear();
+ size_t size() const;
+ void push_back(ScUserListData* p);
+ void erase(iterator itr);
};
#endif