Created attachment 181266 [details] A hyperlink with an anchored shape with text Saving the attached document as DOCX gives a corrupt file, which gives "SAXException: [word/document.xml line 2]: Opening and ending tag mismatch: p line 2 and hyperlink" error. This is a regression since 4.3; version 4.2 produced a normal file.
Repro with Version: 7.3.4.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Ubuntu package version: 1:7.3.4-0ubuntu0.22.04.1 Calc: threaded Converting to DOCX and opening the file will cause the following error: File format error found at SAXParseException: '[word/document.xml line 2]: Opening and ending tag mismatch: p line 2 and hyperlink ./sax/source/fastparser/fastparser.cxx:619', Stream 'word/document.xml', Line 2, Column 2321 ./writerfilter/source/filter/WriterFilter.cxx:213(row,col).
Also repro with Version: 7.5.0.0.alpha0+ / LibreOffice Community Build ID: 61f5c991a97de8990badfed6ef840941b5aa8c7f CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Calc: threaded
This seems to have begun at the below commit. Adding Cc: to Michael Stahl ; Could you possibly take a look at this one? Thanks 8b400e2c6b64ea88b911187a21de7090ee49f305 is the first bad commit commit 8b400e2c6b64ea88b911187a21de7090ee49f305 Author: Matthew Francis <mjay.francis@gmail.com> Date: Wed May 27 18:16:49 2015 +0800 source-hash-ebf767eeb2a169ba533e1b2ffccf16f41d95df35 commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35 Author: Michael Stahl <mstahl@redhat.com> AuthorDate: Thu Jan 22 12:50:07 2015 +0100 Commit: Michael Stahl <mstahl@redhat.com> CommitDate: Thu Jan 22 13:58:10 2015 +0100 writerfilter: DOCX import: better error handling than "catch (...) {}" If there is a SAXParseException, OOXMLDocumentImpl::resolve() should not ignore it, because if it occurs in a substream some end tag handlers may not have been run and the DomainMapper may be in an inconsistent state, so continuing to parse the outer document is probably not a good idea. Also add some exception mangling so sfx2 can present a useful error dialog. Change-Id: I169ba6db25f2ae264af08a64edf76a6bf6757f85
(In reply to raal from comment #3) Oh - you likely bisected to see the error message on load. But the real problem appeared long before - in 4.3, somewhere in early 2014 (or even in late 2013), when the saved document got corrupted. Before the commit that you identified, the corruption was silently ignored, and simply the part of file before the identified XML error was imported. In this case, you may see that in 4.2, the whole file got imported after export; in 4.3, the second part of the hyperlink gets cut off. This is what should be checked in bibisection. Thank you, and sorry for me not clarifying that initially.
Regression after commit 20a3792502120d67b1a9fdea641e15ea504359d3 Author Pallavi Jadhav <pallavi.jadhav@synerzip.com> Date Wed Mar 19 16:29:42 2014 +0530 fdo#76316 : File gets corrupt after Roundtrip
*** Bug 150191 has been marked as a duplicate of this bug. ***
Tünde Tóth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/05df784c6febd1d77e95db8ef3dfdc03347a48a3 tdf#149996 DOCX export: fix hyperlinks in nested paragraphs It will be available in 7.6.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.
Tünde Tóth committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/619132f022b7a71938069d7c282aaf8b578287e5 tdf#149996 DOCX export: fix hyperlinks in nested paragraphs It will be available in 7.5.3. 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.
VERIFIED IN: Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41 CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win Locale: hu-HU (hu_HU); UI: hu-HU Calc: CL threaded