# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1249653113 -7200
# Node ID 65dafca71021c79bbc508ef91e112cc60c73a230
# Parent  1a4515412168af0b0eb90c65fd561c89922fba53
#i102420# debug _MoveNodes: output the destination, too. Break after two iterations.

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -517,13 +517,23 @@
     typedef ::std::deque< ::std::pair<sal_uInt32,sal_uInt32> > tRanges;
     tRanges aRanges;
 	// bis alles verschoben ist
-	while( aRg.aStart < aRg.aEnd)
+    
+    sal_uInt32 nMax = 3;
+    
+	while( aRg.aStart < aRg.aEnd && nMax > 0)
     {
+        nMax--;
+        
+        if (nMax == 0)
+        {
+            break;
+        }
+        
         ::std::pair<sal_uInt32, sal_uInt32> aPair(aRg.aStart.GetIndex(), aRg.aEnd.GetIndex());
 
 #ifdef DEBUG        
         char buffer[256];
-        snprintf(buffer, sizeof(buffer), "(%ld, %ld)", aPair.first, aPair.second);
+        snprintf(buffer, sizeof(buffer), "(%ld, %ld) -> (%ld)", aPair.first, aPair.second, aIdx.GetIndex());
         ::std::clog << buffer << ::std::endl;
 #endif
         if (::std::find(aRanges.begin(), aRanges.end(), aPair) != aRanges.end())
@@ -537,6 +547,10 @@
             
         aRanges.push_back(aPair);
         
+#ifdef DEBUG
+        ::std::clog << dbg_out(*this) << ::std::endl;
+#endif
+        
 		switch( (pAktNode = &aRg.aEnd.GetNode())->GetNodeType() )
 		{
 		case ND_ENDNODE:
