ama: see remarks ... diff -uNr sw.old/source/core/doc/docredln.cxx sw.new/source/core/doc/docredln.cxx --- sw.old/source/core/doc/docredln.cxx 2007-07-24 09:48:56.000000000 +0800 +++ sw.new/source/core/doc/docredln.cxx 2007-11-21 11:11:52.000000000 +0800 @@ -1743,6 +1755,28 @@ if( pDelStt && pDelEnd ) { + //#i73682# see comments below + if ( pDelEnd->nContent == 0 && !pDelEnd->nNode.GetNode().IsTxtNode() ) + { + SwNodeIndex aSttIdx = pDelStt->nNode, aEndIdx = pDelEnd->nNode; + SwNodes& rNds = aSttIdx.GetNode().GetNodes(); + SwCntntNode *pCNdBfStt = rNds.GoPrevious( &aSttIdx ), + *pCNdAfEnd = rNds.GoNext( &aEndIdx ); ama: the following condition will be true if one of the pCNd... is out of the accepted section even if the other is inside an accepted section. But if at least one of these nodes are acceptable, there is no need to change the redline position! + if ( (!pCNdBfStt && !pCNdAfEnd) || + (pCNdBfStt && lcl_StartExceptSection(pCNdBfStt) != lcl_StartExceptSection(&pDelStt->nNode.GetNode())) || + (pCNdAfEnd && lcl_StartExceptSection(pCNdAfEnd) != lcl_StartExceptSection(&pDelEnd->nNode.GetNode())) ) + { + SwPosition aTmpDelEnd = *pDelEnd; ama: Next line of course -> has to be replaced by . + aTmpDelEnd->nNode--; + SwCntntNode *pCNd = aTmpDelEnd.nNode.GetNode().GetCntntNode(); + if ( pCNd ) + { ama: Next line is superfluous because of the Assign afterwards + aTmpDelEnd.nContent = pCNd->Len(); + aTmpDelEnd.nContent.Assign( pCNd, pCNd->Len() ); + pDelEnd = &aTmpDelEnd; + } + } + } SwPaM aPam( *pDelStt, *pDelEnd ); SwCntntNode* pCSttNd = pDelStt->nNode.GetNode().GetCntntNode(); SwCntntNode* pCEndNd = pDelEnd->nNode.GetNode().GetCntntNode();