From d661a22ae283c604e9e95eceeaf4e6b47e7e1753 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 13 May 2019 12:09:04 +1000 Subject: [PATCH] Write an anchor-type attribute when embedding images in an ODF document Without this some readers will fail to display the image or position the image at the start of a paragraph rather than inline. Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0 Reviewed-by: Lars Knoll --- src/gui/text/qtextodfwriter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 1a96f7608f3..1906502c107 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -510,6 +510,7 @@ void QTextOdfWriter::writeInlineCharacter(QXmlStreamWriter &writer, const QTextF writer.writeAttribute(svgNS, QString::fromLatin1("width"), pixelToPoint(width)); writer.writeAttribute(svgNS, QString::fromLatin1("height"), pixelToPoint(height)); + writer.writeAttribute(textNS, QStringLiteral("anchor-type"), QStringLiteral("as-char")); writer.writeStartElement(drawNS, QString::fromLatin1("image")); writer.writeAttribute(xlinkNS, QString::fromLatin1("href"), filename); writer.writeEndElement(); // image