From e71d05eaa9a8c9e628b256f3e889b85ac11ed474 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 27 Apr 2018 15:42:26 +0100 Subject: ofz#8038 defer subdocument redlining to end of parse like main document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibdec7e5f9cee45ba11fc0e3aabcc46bb5da54c2c Reviewed-on: https://gerrit.libreoffice.org/53567 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/qa/core/data/ww6/pass/ofz-redlining-1.doc | Bin 0 -> 35101 bytes sw/source/filter/ww8/ww8par.cxx | 3 +++ sw/source/filter/ww8/ww8par.hxx | 3 ++- sw/source/filter/ww8/ww8par2.cxx | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 sw/qa/core/data/ww6/pass/ofz-redlining-1.doc diff --git a/sw/qa/core/data/ww6/pass/ofz-redlining-1.doc b/sw/qa/core/data/ww6/pass/ofz-redlining-1.doc new file mode 100644 index 000000000000..b2f60eb2a251 Binary files /dev/null and b/sw/qa/core/data/ww6/pass/ofz-redlining-1.doc differ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 8e8d2f99bfd0..c9b994a76f94 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2028,6 +2028,7 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr ) pRdr->m_xCtrlStck = std::move(mxOldStck); pRdr->m_xRedlineStack->closeall(*pRdr->m_pPaM->GetPoint()); + pRdr->m_aFrameRedlines.emplace(std::move(pRdr->m_xRedlineStack)); pRdr->m_xRedlineStack = std::move(mxOldRedlines); pRdr->DeleteAnchorStack(); @@ -5298,6 +5299,8 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) // are updated m_aExtraneousParas.delete_all_from_doc(); m_xRedlineStack->closeall(*m_pPaM->GetPoint()); + while (!m_aFrameRedlines.empty()) + m_aFrameRedlines.pop(); m_xRedlineStack.reset(); // For i120928,achieve the graphics from the special bookmark with is for graphic bullet diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 68e4063217a1..37d74e6c0d26 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1090,7 +1090,8 @@ private: This stack is for redlines, because their sequence of discovery can be out of order of their order of insertion into the document. */ - std::unique_ptr m_xRedlineStack; + std::stack> m_aFrameRedlines; //inside frames, tables, etc + std::unique_ptr m_xRedlineStack; //main document /* This stack is for fields that get referenced later, e.g. BookMarks and TOX. diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 0bfeeb680fb8..56c45f4d5ba5 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2701,6 +2701,7 @@ void WW8TabDesc::MoveOutsideTable() void WW8TabDesc::FinishSwTable() { m_pIo->m_xRedlineStack->closeall(*m_pIo->m_pPaM->GetPoint()); + m_pIo->m_aFrameRedlines.emplace(std::move(m_pIo->m_xRedlineStack)); m_pIo->m_xRedlineStack = std::move(mxOldRedlineStack); WW8DupProperties aDup(m_pIo->m_rDoc,m_pIo->m_xCtrlStck.get()); -- cgit