summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichaël Lefèvre <lefevre00@yahoo.fr>2014-12-15 15:46:32 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-17 08:20:11 +0000
commit7c181e5e0aa218ba0abff6c8ea42e107f59bf3f0 (patch)
tree4974908e34dc99e518abf7ae48f705a5596ebec1 /sw
parent53421edf6c821d9a74c32c2fd8d5eb15fb5e5fd3 (diff)
fdo#75757 Remove inheritance to std::vector
Change-Id: I5d5746869e47a1d25d6bec28452394e215d4427d Reviewed-on: https://gerrit.libreoffice.org/13483 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docary.hxx12
-rw-r--r--sw/source/core/tox/tox.cxx6
2 files changed, 14 insertions, 4 deletions
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 2f388b1f65e7..bd96c3caece7 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -140,11 +140,21 @@ public:
void dumpAsXml(xmlTextWriterPtr w) const;
};
-class SwTOXTypes : public std::vector<SwTOXType*> {
+class SwTOXTypes {
+private:
+ typedef std::vector<SwTOXType*> _SwTOXTypes;
+ _SwTOXTypes items;
public:
/// the destructor will free all objects still in the vector
~SwTOXTypes();
sal_uInt16 GetPos(const SwTOXType* pTOXType) const;
+ size_t size() const { return items.size(); };
+ SwTOXType* operator[] (size_t n) { return items[n]; };
+ const SwTOXType* operator[] (size_t n) const { return items[n]; };
+ void push_back ( SwTOXType* value) { items.push_back(value); };
+ void clear() { items.clear(); };
+ _SwTOXTypes::const_iterator begin() const { return items.begin(); };
+ _SwTOXTypes::const_iterator end() const { return items.end(); };
};
class SW_DLLPUBLIC SwNumRuleTbl : public std::vector<SwNumRule*> {
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index a66278c5969a..3e13274be437 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -860,13 +860,13 @@ const SwFormTokens& SwForm::GetPattern(sal_uInt16 nLevel) const
sal_uInt16 SwTOXTypes::GetPos(const SwTOXType* pTOXType) const
{
- const_iterator it = std::find(begin(), end(), pTOXType);
- return it == end() ? USHRT_MAX : it - begin();
+ _SwTOXTypes::const_iterator it = std::find(items.begin(), items.end(), pTOXType);
+ return it == items.end() ? USHRT_MAX : it - items.begin();
}
SwTOXTypes::~SwTOXTypes()
{
- for(const_iterator it = begin(); it != end(); ++it)
+ for(_SwTOXTypes::const_iterator it = items.begin(); it != items.end(); ++it)
delete *it;
}