Apache OpenOffice (AOO) Bugzilla – Issue 128437
error reading a LibreOffice file
Last modified: 2024-01-11 15:52:58 UTC
Created attachment 87009 [details] file with frame File DE3Sin.odt was written by LibreOffice; it contains a header and a frame. Why does it cause a ReadError with OpenOffice? Is .odt incompatible with .odt? Without the frame, the file is readable.
The error during opening file DE3Sin.odt in AOO 4.1.9 maybe caused by the OpenDocument format (ODF) version. LibreOffice uses by default the version 1.3, AOO - 1.2. File DE3Sin.odt saved in LO in version 1.2 opens up normally in AOO with no apparent loss of content, however one should keep in mind a warning displayed in the LO's dialog "Options - Load/Save - General": "Not using ODF 1.3 Extended may cause information to be lost". (cf. the attached file containing screenshots)
Created attachment 87010 [details] Additional information
Cross-posted with issue 128282 (add filter for ODF 1.3) Currently AOO displays a warning: see issue 128412.
If you unzip the attached Sin.odt and format content.xml nicely (eg. xmllint --format content.xml), and delete the <draw:a> elements and all their contents, and zip up the files back into a changed .odt, and open that, then instead of the error message, it opens successfully and OpenOffice displays empty boxes where the images should be. Fiddling further, by deleting some of the <draw:a> elements while leaving others, we see leaving the 1st and the 2nd but deleting the 3rd shows 2 pictures and 1 empty box, while deleting the 1st and 2nd but leaving the 3rd still gives the error. That 3rd <draw:a> element is clearly a problem for OpenOffice. How is it different from the 1st and 2nd? The 1st and 2nd elements use this nesting: <text:p> <draw:a> <draw:frame> <draw:text-box> <text:p> <draw:frame> <draw:image/> </draw:frame> </text:p> </draw:text-box> </draw:frame> </draw:a> </text:p> The 3rd element uses this nesting: <text:p> <draw:a> <draw:frame> <draw:text-box> <text:p> <draw:a> <======= NEW!!! <draw:frame> <draw:image/> </draw:frame> </draw:frame> </text:p> </draw:text-box> </draw:frame> </draw:a> <draw:a> <draw:frame> <draw:text-box> <text:p> <draw:a> <======= NEW!!! <draw:frame> <draw:image/> </draw:frame> </draw:a> </text:p> </draw:text-box> </draw:frame> </draw:a> </text:p> Deleting those inner <draw:a> elements also gets the file to open successfully. So it looks like OpenOffice's <text:p> doesn't like having a child <draw:a> element, at least when nested a second time. However even ODF 1.2 allows having <draw:a> under <text:p>, as is stated in section 5.1.3 of the specification. So this is not an ODF 1.3 issue, this is a bug even in our ODF 1.2 implementation.