Created attachment 185680 [details] Sample DOCX Open the attached DOCX, originating from MS Word. => Note how the blue rectangle in the header is displaced, and partly overlaps the text "Enterprise Elite Services". Observed using LO 7.6.0.0.alpha0+ (2da16ff9f018fae68c53a801e5a234dafc2ebcec) / Ubuntu. This is a regression from the following commit, bibisected using repo linux-64-7.0. Adding CC: to Attila Bakos and László Németh. https://cgit.freedesktop.org/libreoffice/core/commit/?id=27d04f6dbf38aa28fb7215590d578c4567db5770 author Attila Bakos <bakos.attilakaroly@nisz.hu> 2020-03-19 14:40:36 +0100 committer László Németh <nemeth@numbertext.org> 2020-04-07 12:44:17 +0200 tdf#119038 DOCX: fix FollowTextFlow handling
Created attachment 185681 [details] PDF exported from Word
Created attachment 185682 [details] PDF exported from LO 7.6 build
Created attachment 185694 [details] Sample compared in MSO 2016, LO 7.6+ in Windows I set New.
Created attachment 185695 [details] Sample DOCX resaved in MSO without compatibility
Created attachment 185696 [details] Sample DOCX resaved in MSO compared MSO LO Same for DOCX resaved without compatiblity.
The original is compat12 (DOC-level). The problem is also "fixed" if Word 2010 round-trips it without compatibility mode (into compat14). I'm guessing the problem is related to the old style of creating a rectangle <v:rect id="_x0000_s2050" style="position:absolute;margin-left:-36.9pt;margin-top:-25.2pt;width:612pt;height:21.6pt;z-index:251664384" fillcolor="#002060" stroked="f"/> This doesn't say anything about layoutInCell status - which defaults to true (and is generally always forced to true for compat15), but is NOT true in LO for the round-tripped files, probably because of if (m_pImpl->m_nWrap == text::WrapTextMode_THROUGH && m_pImpl->m_nHoriRelation == text::RelOrientation::FRAME) // text::RelOrientation::FRAME is OOXML's "column", which behaves // as if layout-in-cell would be always off. m_pImpl->m_bLayoutInCell = false; So I expect the trick is to add the same thing to the code path that creates these old-style rectangles.
Created attachment 192059 [details] 153909-min.docx: minimized version for easier debugging
I created bug 159285 because the original document hangs on opening in 24.2
Wow - I just took the very long path way around finding out that the problem code forcing FollowTextFlow to be true is in writerfilter/source/ooxml/OOXMLFastContextHandler.cxx - put there by the commit referenced in comment 0.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ad0266eb84eafa32ccc4e0ddf3c6392860bc9b13 tdf#153909 docx import: wrap through shapes shouldn't FollowTextFlow It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9aaf0f4b2c74d76d38460725b07c78e4aeabdbf3 tdf#153909: docx import: pre-emptive unit test for layoutInCell It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/51a1ce9ca77c7559957abd8daf2e51b2e0f5d17b tdf#153909 docx import: wrap through shapes shouldn't FollowTextFlow It will be available in 24.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/15d19f48dc9eaf74d37b3da36a4bfc68be483547 tdf#153909 docx import: wrap through shapes shouldn't FollowTextFlow It will be available in 7.6.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7144a9c791ab587b4621c2b35611ba2020baab58 tdf#162211 tdf#153909 layoutInCell vml: don't discard layoutInCell It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.