diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-01-25 00:38:36 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-01-25 03:10:54 -0600 |
commit | 5d8bd348ec1c136ce423bc76cd06bf91d96f54e4 (patch) | |
tree | 6b245f240864de25fc0f942df53e50bc9f9eb831 /vcl/source/edit | |
parent | e190c8345d8a6abb933affe1416ed85100eceb19 (diff) |
coverity#440841 : Dereference after NULL check
Change-Id: Ifdbd256c3478161c16fff02e79608498175aa024
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 68a42007c9be..06ed0d529ec7 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2442,19 +2442,24 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) nDelFromLine = nLine; break; } - if ( !pLine && ( nIndex < pNode->GetText().getLength() ) ) + if ( !pLine ) { - pLine = new TextLine; - pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine ); - } - if ( pLine ) - { - aSaveLine = *pLine; - pLine->SetStart( nIndex ); - pLine->SetEnd( nIndex ); - pLine->SetStartPortion( nEndPortion+1 ); - pLine->SetEndPortion( nEndPortion+1 ); + if ( nIndex < pNode->GetText().getLength() ) + { + pLine = new TextLine; + pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine ); + } + else + { + break; + } } + aSaveLine = *pLine; + pLine->SetStart( nIndex ); + pLine->SetEnd( nIndex ); + pLine->SetStartPortion( nEndPortion+1 ); + pLine->SetEndPortion( nEndPortion+1 ); + } // while ( Index < Len ) if (nDelFromLine != std::numeric_limits<size_t>::max()) |