[Libreoffice-commits] .: sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Mar 18 05:30:25 PDT 2011
sw/source/core/docnode/nodes.cxx | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 7482695994c5f6bf9995748944e38d2792aaed92
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 18 12:29:41 2011 +0000
Resolves: fdo#32553 freeze/hang on mailmerge to attached pdf
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 6d0e350..491e948 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 &&
More information about the Libreoffice-commits
mailing list