diff -uNr old/sc/source/ui/docshell/dbdocfun.cxx new/sc/source/ui/docshell/dbdocfun.cxx --- old/sc/source/ui/docshell/dbdocfun.cxx 2009-04-29 15:36:12.468750000 +0800 +++ new/sc/source/ui/docshell/dbdocfun.cxx 2009-05-07 11:55:27.625000000 +0800 @@ -58,6 +58,7 @@ #include "editable.hxx" #include "attrib.hxx" #include "drwlayer.hxx" +#include "dpshttab.hxx" // ----------------------------------------------------------------- @@ -1355,6 +1356,18 @@ } //! test for overlap with other data pilot tables + if( pOldObj ) + { + const ScSheetSourceDesc* pSheetDesc = pOldObj->GetSheetDesc(); + if( pSheetDesc && pSheetDesc->aSourceRange.Intersects( aNewOut ) ) + { + ScRange aOldRange = pOldObj->GetOutRange(); + USHORT nDiff = aOldRange.aStart.Row()-aNewOut.aStart.Row(); + aNewOut.aStart.SetRow( aOldRange.aStart.Row() ); + aNewOut.aEnd.SetRow( aNewOut.aEnd.Row()+nDiff ); + pDestObj->SetOutRange( aNewOut ); + } + } pDestObj->Output();