summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docredln.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docredln.cxx')
-rw-r--r--sw/source/core/doc/docredln.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index ab47e58d0965..d3fae50bb22d 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3516,18 +3516,20 @@ void SwRangeRedline::InvalidateRange() // trigger the Layout
sal_Int32 nTmp2 = nSttCnt; nSttCnt = nEndCnt; nEndCnt = nTmp2;
}
- SwUpdateAttr aHt( 0, 0, RES_FMT_CHG );
SwNodes& rNds = GetDoc()->GetNodes();
- for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
+ for (sal_uLong n(nSttNd); n <= nEndNd; ++n)
{
- SwNode* pNd = rNds[n];
- if( pNd->IsTxtNode() )
+ SwNode* pNode = rNds[n];
+
+ if (pNode && pNode->IsTxtNode())
{
- aHt.nStart = n == nSttNd ? nSttCnt : 0;
- aHt.nEnd = (n == nEndNd)
- ? nEndCnt
- : static_cast<SwTxtNode*>(pNd)->GetTxt().getLength();
- ((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt );
+ SwTxtNode* pNd = static_cast< SwTxtNode* >(pNode);
+ SwUpdateAttr aHt(
+ n == nSttNd ? nSttCnt : 0,
+ n == nEndNd ? nEndCnt : pNd->GetTxt().getLength(),
+ RES_FMT_CHG);
+
+ pNd->ModifyNotification(&aHt, &aHt);
}
}
}