Issue 128437 - error reading a LibreOffice file
Summary: error reading a LibreOffice file
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 4.1.9
Hardware: All All
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-10 00:40 UTC by TAB
Modified: 2024-01-11 15:52 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
file with frame (104.00 KB, application/vnd.oasis.opendocument.text)
2021-03-10 00:40 UTC, TAB
no flags Details
Additional information (274.33 KB, image/jpeg)
2021-03-10 07:17 UTC, Czesław Wolański
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description TAB 2021-03-10 00:40:48 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.
Comment 1 Czesław Wolański 2021-03-10 07:16:29 UTC
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)
Comment 2 Czesław Wolański 2021-03-10 07:17:58 UTC
Created attachment 87010 [details]
Additional information
Comment 3 oooforum (fr) 2021-03-11 10:58:16 UTC
Cross-posted with issue 128282 (add filter for ODF 1.3)

Currently AOO displays a warning: see issue 128412.
Comment 4 damjan 2024-01-10 17:02:54 UTC
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.