diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-01-09 15:51:10 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-03-09 17:02:40 +0100 |
commit | 6eea398000f04c68f422ab07353ea4631f4edb5e (patch) | |
tree | 7daaaa39ad8b0d0e57a2238828eb91a2b0c6e4a2 | |
parent | 285b3a4fe0b5b21abe061dfb664800b7e537471e (diff) |
fdo#46337: don't use an invalidated iterator
(cherry picked from commit 2df1c40b4b7cb3107a68984db644f10097f04c3c)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
-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 d9f33762d60a..0ea06b7b3527 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -517,7 +517,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 ) @@ -528,10 +528,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 |