diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-04 10:07:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-04 11:37:40 +0100 |
commit | d64105fd3a16356ff858da1497d7fd73b98f55c6 (patch) | |
tree | 61b7a1beb7d4561b9ccea5b94a64d7de4efad7a4 /sw/source/filter/ww8/ww8par.cxx | |
parent | 15a439dacf77bfcd7cc47bd1c360945375a24141 (diff) |
drop pams before removing extraneous paras
and remove extra paras in order of largest index first
Change-Id: Iafbe612a8a8bd51cb157b4a4c07031c6603d92ee
Diffstat (limited to 'sw/source/filter/ww8/ww8par.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index d6a25ccec401..1142325a4e93 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4632,9 +4632,8 @@ void wwSectionManager::InsertSegments() void wwExtraneousParas::delete_all_from_doc() { - typedef std::vector<SwTextNode*>::iterator myParaIter; - myParaIter aEnd = m_aTextNodes.end(); - for (myParaIter aI = m_aTextNodes.begin(); aI != aEnd; ++aI) + auto aEnd = m_aTextNodes.rend(); + for (auto aI = m_aTextNodes.rbegin(); aI != aEnd; ++aI) { SwTextNode *pTextNode = *aI; SwNodeIndex aIdx(*pTextNode); @@ -5357,6 +5356,12 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) DELETEZ( m_pLstManager ); } + SAL_WARN_IF(m_pTableEndPaM, "sw.ww8", "document ended without table ending"); + m_pTableEndPaM.reset(); //ensure this is deleted before pPaM + mpCrsr.reset(); + m_pPaM = nullptr; + m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs + // remove extra paragraphs after attribute ctrl // stacks etc. are destroyed, and before fields // are updated @@ -5368,12 +5373,6 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) if (m_bNewDoc) m_rDoc.getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( eMode )); - SAL_WARN_IF(m_pTableEndPaM, "sw.ww8", "document ended without table ending"); - m_pTableEndPaM.reset(); //ensure this is deleted before pPaM - mpCrsr.reset(); - m_pPaM = nullptr; - m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs - UpdatePageDescs(m_rDoc, nPageDescOffset); return nErrRet; |