summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/editeng/impedit3.cxx')
-rw-r--r--editeng/source/editeng/impedit3.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 3a5ac2b26115..504d7740c329 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -896,18 +896,19 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
{
// Throw away a Portion, if necessary correct the one before,
// if the Hyph portion has swallowed a character ...
+ sal_uInt16 nTmpLen = pPortion->GetLen();
pParaPortion->GetTextPortions().Remove( nTmpPortion );
- if ( nTmpPortion && pPortion->GetLen() )
+ if (nTmpPortion && nTmpLen)
{
nTmpPortion--;
TextPortion* pPrev = pParaPortion->GetTextPortions()[nTmpPortion];
DBG_ASSERT( pPrev->GetKind() == PORTIONKIND_TEXT, "Portion?!" );
nTmpWidth -= pPrev->GetSize().Width();
nTmpPos = nTmpPos - pPrev->GetLen();
- pPrev->SetLen( pPrev->GetLen() + pPortion->GetLen() );
+ pPrev->SetLen(pPrev->GetLen() + nTmpLen);
pPrev->GetSize().Width() = (-1);
}
- delete pPortion;
+
DBG_ASSERT( nTmpPortion < pParaPortion->GetTextPortions().Count(), "No more Portions left!" );
pPortion = pParaPortion->GetTextPortions()[nTmpPortion];
}