diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-01-09 15:51:10 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-01-09 15:53:34 +0100 |
commit | 2df1c40b4b7cb3107a68984db644f10097f04c3c (patch) | |
tree | 80240c448e48f9a1d82d4619a33211a46e772c93 /sw | |
parent | 7ec8f13d3ac0650c7e62e31220f1eda9d0a9284c (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 b23bcc075e0f..df37cf0f1c14 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -518,7 +518,7 @@ void DocxAttributeOutput::StartRun( const SwRedlineData* pRedlineData ) void DocxAttributeOutput::EndRun() { // Write field 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 all but hyperlinks and TOCs if ( pIt->bOpen && pIt->pField ) @@ -529,10 +529,11 @@ void DocxAttributeOutput::EndRun() // Unknown fields sould be removed too if ( !pIt->bClose || ( pIt->eType == ww::eUNKNOWN ) ) { - m_Fields.erase( pIt ); - --pIt; + pIt = m_Fields.erase( pIt ); + continue; } } + ++pIt; } // write the run properties + the text, already in the correct order |