Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-46096

QTextDocumentWriter writes invalid .odt files if images are present

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.0
    • ODF Writer
    • None
    • Mac OS 10.10.3.
    • macOS

    Description

      I insert images into QTextDocument with
      document()->addResource(QTextDocument::ImageResource, url, image);
      QTextImageFormat imageFormat;
      imageFormat.setWidth( image.width() );
      imageFormat.setHeight( image.height() );
      imageFormat.setName( url.toString() );
      textCursor().insertImage(imageFormat);

      If I write the document to file with QTextDocumentWriter, the output cannot be read by OpenOffice 4.0.1., probably because the document is not valid ODF1.2.

      The document contains the following content fragment:
      <text text:style-name="p1"><text:span>
      <draw:frame draw:name="dropped_image_0" svg:width="231.75pt" svg:height="257.25pt">
      <draw:image xlink:href="Pictures/Picture1"/>
      </draw:frame>
      </text:span></text>
      <text text:style-name="p1"><text:span text:style-name="c4">yyy</text:span></text>

      According to ODF spec, <draw:image/> requires further mandatory type/show/actuate attributes.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            reorx Jens
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes