diff options
Diffstat (limited to 'sw/source/core/docnode/nodes.cxx')
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 6d0e35061d..491e948f21 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1999,9 +1999,13 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex() < aInsPos.GetIndex() ) { - nNodeCnt -= + ULONG nDistance = ( pAktNode->EndOfSectionIndex() - aRg.aStart.GetIndex() ); + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; // dann alle Nodes der Tabelle in die akt. Zelle kopieren // fuer den TabellenNode einen DummyNode einfuegen? @@ -2036,7 +2040,11 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, SwNodeIndex nStt( aInsPos, -1 ); SwTableNode* pTblNd = ((SwTableNode*)pAktNode)-> MakeCopy( pDoc, aInsPos ); - nNodeCnt -= aInsPos.GetIndex() - nStt.GetIndex() -2; + ULONG nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2; + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; aRg.aStart = pAktNode->EndOfSectionIndex(); @@ -2060,7 +2068,11 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, SwSectionNode* pSectNd = ((SwSectionNode*)pAktNode)-> MakeCopy( pDoc, aInsPos ); - nNodeCnt -= aInsPos.GetIndex() - nStt.GetIndex() -2; + ULONG nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2; + if (nDistance < nNodeCnt) + nNodeCnt -= nDistance; + else + nNodeCnt = 1; aRg.aStart = pAktNode->EndOfSectionIndex(); if( bNewFrms && pSectNd && |