summaryrefslogtreecommitdiff
path: root/sw/inc/ring.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc/ring.hxx')
-rw-r--r--sw/inc/ring.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 8083e959f0e9..e0bfc5a30b90 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -185,6 +185,10 @@ namespace sw
*/
void merge( RingContainer< value_type > aDestRing )
{
+ // first check that we aren't merged already, swapping would
+ // actually un-merge in this case!
+ assert(m_pStart->pPrev != aDestRing.m_pStart);
+ assert(m_pStart != aDestRing.m_pStart->pPrev);
std::swap(*(&m_pStart->pPrev->pNext), *(&aDestRing.m_pStart->pPrev->pNext));
std::swap(*(&m_pStart->pPrev), *(&aDestRing.m_pStart->pPrev));
}