summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 17:03:55 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 17:47:46 +0100
commit917d505bff114f6431368c61565720ba41b1d067 (patch)
treef66e2631767ca31c7bb23d8e831a7d2ed26f5c3f /sw
parentf5a42cf7afa2d5a1899f1c0d7c7093820703fba4 (diff)
cid#1256663: only allow comparing iterators from the same ring
Change-Id: I77eb186f0048a9bc335408bace96111e6cb2ca53
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ring.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 8796dd0e50d5..bca6dba07f0a 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -188,7 +188,12 @@ namespace sw
void increment()
{ m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
bool equal(RingIterator const& other) const
- { return m_pCurrent == other.m_pCurrent && m_pStart == other.m_pStart; }
+ {
+ // we never want to compare iterators from
+ // different rings or starting points
+ assert(m_pStart == other.m_pStart);
+ return m_pCurrent == other.m_pCurrent;
+ }
T& dereference() const
{ return m_pCurrent ? *m_pCurrent : * m_pStart; }
/**