diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-03-23 10:38:40 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-03-23 10:40:18 +0100 |
commit | 1a412714031bf6cf3f7962b044b2edea74899b46 (patch) | |
tree | b5537f1521e964a7de5ca925b3ad6e1afc5b48b2 /sw | |
parent | 99298d615bc71c6dbc0ea718803ae73ef6648e81 (diff) |
fixed crash due to use of STL deque for SwLineRects
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index ad0e241093f8..aa0438bfc74f 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -945,13 +945,16 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut ); // Remove all help line that are almost covered (tables) - for (SwSubsRects::iterator it = this->begin(); it != this->end(); ++it) + SwSubsRects::iterator it = this->begin(); + while ( it != this->end() ) { SwLineRect &rLi = *it; const bool bVerticalSubs = rLi.Height() > rLi.Width(); - for (SwSubsRects::iterator itK = it; itK != this->end(); ++itK) + SwSubsRects::iterator itK = it; + while ( itK != this->end() ) { + bool bRemoved = false; SwLineRect &rLk = (*itK); if ( rLi.SSize() == rLk.SSize() ) { @@ -969,6 +972,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, // don't continue with inner loop any more: // the array may shrink! itK = this->end(); + bRemoved = true; } } else @@ -983,11 +987,17 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, // don't continue with inner loop any more: // the array may shrink! itK = this->end(); + bRemoved = true; } } } } + + if ( !bRemoved ) + ++itK; } + + ++it; } if ( pRects && (!pRects->empty()) ) @@ -1008,7 +1018,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, pOut->SetDrawMode( 0 ); } - for (SwSubsRects::iterator it = this->begin(); it != this->end(); ++it) + for (it = this->begin(); it != this->end(); ++it) { SwLineRect &rLRect = (*it); // Add condition <!rLRect.IsLocked()> to prevent paint of locked subsidiary lines. |