# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1251892107 -7200
# Node ID eb647c766bbc990c0967cc5408f136847a3f56e3
# Parent  96dc80b770d0d5daa0e66b02bbe7a66d22f15ecf
#i102420# revert changes

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
@@ -31,12 +31,6 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-#ifdef DEBUG
-#include <iostream>
-#include <dbgoutsw.hxx>
-#include <deque>
-#endif
-
 #include <stdlib.h>
 #include <node.hxx>
 #include <doc.hxx>
@@ -451,16 +445,12 @@
 BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
 					const SwNodeIndex& aIndex, BOOL bNewFrms )
 {
-	if( aIndex == 0)
+	SwNode * pAktNode;
+	if( aIndex == 0 ||
+		( (pAktNode = &aIndex.GetNode())->GetStartNode() &&
+		  !pAktNode->StartOfSectionIndex() ))
         return FALSE;
     
-	SwNode * pAktNode = &aIndex.GetNode();
-    if (pAktNode->GetStartNode() && !pAktNode->StartOfSectionIndex())
-		return FALSE;
-        
-    if (aRange.aStart <= aIndex && aRange.aEnd >= aIndex)
-        return FALSE;
-
 	SwNodeRange aRg( aRange );
 
 	// "einfache" StartNodes oder EndNodes ueberspringen
@@ -514,43 +504,8 @@
 	USHORT nSectNdCnt = 0;
 	BOOL bSaveNewFrms = bNewFrms;
 
-    typedef ::std::deque< ::std::pair<sal_uInt32,sal_uInt32> > tRanges;
-    tRanges aRanges;
 	// bis alles verschoben ist
-    
-    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) -> (%ld)", aPair.first, aPair.second, aIdx.GetIndex());
-        ::std::clog << buffer << ::std::endl;
-#endif
-        if (::std::find(aRanges.begin(), aRanges.end(), aPair) != aRanges.end())
-        {
-#ifdef DEBUG
-            ::std::clog << dbg_out(*this) << ::std::endl;
-#endif
- 
-            break;
-        }
-            
-        aRanges.push_back(aPair);
-        
-#ifdef DEBUG
-        ::std::clog << dbg_out(*this) << ::std::endl;
-#endif
-        
+	while( aRg.aStart < aRg.aEnd )
 		switch( (pAktNode = &aRg.aEnd.GetNode())->GetNodeType() )
 		{
 		case ND_ENDNODE:
@@ -957,7 +912,6 @@
 			ASSERT( FALSE, "was ist das fuer ein Node??" );
 			break;
 		}
-    }
     
 	if( nInsPos )							// kopiere den Rest
 	{
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -2053,6 +2053,15 @@
     {
     }
     release();
+
+#if OSL_DEBUG_LEVEL > 1
+    OUString aRangeStr( getSourceRangeRepresentation() );
+
+	// check if it can properly convert into a SwUnoTableCrsr
+	// which is required for some functions
+    SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
+    DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+#endif
 }
 
 
@@ -2094,6 +2103,15 @@
     {
     }
     release();
+
+#if OSL_DEBUG_LEVEL > 1
+    OUString aRangeStr( getSourceRangeRepresentation() );
+
+    // check if it can properly convert into a SwUnoTableCrsr
+	// which is required for some functions
+    SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
+    DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+#endif
 }
 
 
