diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-07-19 19:29:24 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-07-27 17:35:13 +0200 |
commit | 319df529878026e8c4e449e0f6d6c04e2693ac8e (patch) | |
tree | dcda0bbf37c689841bdc731cffc599118f1ddff2 /sw | |
parent | 488974a1293062b17d802dfcdd950f94fc7c6d55 (diff) |
don't use an invalidated iterator
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 54f385fedc4e..8f4e0a202932 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -556,7 +556,7 @@ void DocxAttributeOutput::EndRun() } // Write the hyperlink and toc fields starts - for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); ++pIt ) + for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); ) { // Add the fields starts for hyperlinks, TOCs and index marks if ( pIt->bOpen && !pIt->pField ) @@ -565,10 +565,11 @@ void DocxAttributeOutput::EndRun() // Remove the field if no end needs to be written if ( !pIt->bClose ) { - m_Fields.erase( pIt ); - --pIt; + pIt = m_Fields.erase( pIt ); + continue; } } + ++pIt; } DoWriteBookmarks( ); |