summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-07-19 19:29:24 +0200
committerLuboš Luňák <l.lunak@suse.cz>2011-07-27 17:35:13 +0200
commit9bdcecd3e516728e488a26fbfe85a5a6aa1f1968 (patch)
treec86dbd4aabda2061e2e426e9c16c1d980526b706
parentc234df7779b0e43e4433e71933c22f9e703da735 (diff)
don't use an invalidated iterator
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9e066a0732..0ae06f08b0 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( );