summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-01-09 15:51:10 +0100
committerPetr Mladek <pmladek@suse.cz>2012-03-13 11:17:20 +0100
commitbcc1b51cfe3bdd8289ac8f2b9803428d052d6d2a (patch)
treef6ec7d97c96b9e1994f074db139c42be95fce92d
parent26c910621485f18a99ade340ab178f85cb27d3f8 (diff)
fdo#46337: don't use an invalidated iteratorlibreoffice-3-4-6
(cherry picked from commit 2df1c40b4b7cb3107a68984db644f10097f04c3c) Signed-off-by: Michael Stahl <mstahl@redhat.com> Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Norbert Thiebaud <nthiebaud@gmail.com>
-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 5dfb281bf2..a8d29cb66d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -515,7 +515,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 )
@@ -526,10 +526,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