diff options
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 2c398703bc74..6107f950608a 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -272,8 +272,10 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, ContentNode* pStartNode = aTmpSel.Min().GetNode(); ContentNode* pEndNode = aTmpSel.Max().GetNode(); - sal_Int32 nStartPara = pEditEngine->GetEditDoc().GetPos( pStartNode ); - sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos( pEndNode ); + const sal_Int32 nStartPara = pEditEngine->GetEditDoc().GetPos(pStartNode); + const sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos(pEndNode); + if (nStartPara == EE_PARA_NOT_FOUND || nEndPara == EE_PARA_NOT_FOUND) + return; for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { ParaPortion* pTmpPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara ); |