sw/qa/extras/ooxmlexport/data/CT-with-frame.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 10 ++++++++++ sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-)
New commits: commit bf9eb540d7544799b4c7d66b07719631e654732b Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Feb 25 16:03:20 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Feb 26 12:07:41 2025 +0100 tdf#165330 writerfilter: fix import of redline in paragraph after frame The flag m_bIsActualParagraphFramed is reset only in ExecuteFrameConversion() which is called at the end of the paragraph that follows the one that is in the frame, so all redlines in that paragraph were erroneously moved to the frame; reset it when a paragraph ends, if the next paragraph is also in the frame it can set the flag again. (regression from commit e8bae67b3dbcc90ace8264b6b1aefaf0ce459aba) Change-Id: I75a18d2e7b600737958e984c135ebf6201e6f979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182181 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit d09f3f24c38eda633825f4ac214731db06bc9a9a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182190 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/data/CT-with-frame.docx b/sw/qa/extras/ooxmlexport/data/CT-with-frame.docx new file mode 100644 index 000000000000..85653b0caaec Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/CT-with-frame.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 17b09796db41..7eb8f39f4137 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -1603,6 +1603,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128156) assertXPath(pXmlDoc, "//w:ins", 2); } +CPPUNIT_TEST_FIXTURE(Test, testTdf165330) +{ + loadAndSave("CT-with-frame.docx"); + + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); + // check that *both* tracked changes were round tripped + assertXPathContent(pXmlDoc, "//w:p[1]/w:ins/w:r/w:t", u"world! "); + assertXPathContent(pXmlDoc, "//w:p[3]/w:ins/w:r/w:t", u"hello "); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf125546) { loadAndSave("tdf125546.docx"); diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index ea56f5a83fbe..a797804df116 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -3061,6 +3061,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con else SetIsPreviousParagraphFramed(false); + m_bIsActualParagraphFramed = false; m_StreamStateStack.top().bRemoveThisParagraph = false; if( !IsInHeaderFooter() && !IsInShape() && (!pParaContext || !pParaContext->props().IsFrameMode()) ) @@ -9670,8 +9671,6 @@ void DomainMapper_Impl::ExecuteFrameConversion() DBG_UNHANDLED_EXCEPTION( "writerfilter.dmapper", "Exception caught when converting to frame"); } - m_bIsActualParagraphFramed = false; - if (redPos.size() == m_aStoredRedlines[StoredRedlines::FRAME].size()) { for( sal_Int32 i = m_aStoredRedlines[StoredRedlines::FRAME].size() - 1; i >= 0; --i)