From cce1ef54d817377ef39c0f34eff9db478dc13d8d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 12 Feb 2023 12:54:05 +0100 Subject: [PATCH] Fix Open Document warning on settings.xml and bump version to 1.3 --- novelwriter/core/toodt.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/novelwriter/core/toodt.py b/novelwriter/core/toodt.py index 968d7b87..f4740f13 100644 --- a/novelwriter/core/toodt.py +++ b/novelwriter/core/toodt.py @@ -65,7 +65,7 @@ def _mkTag(nsName, tagName, nsMap=XML_NS): # Mimetype and Version X_MIME = "application/vnd.oasis.opendocument.text" -X_VERS = "1.2" +X_VERS = "1.3" # Text Formatting Tags TAG_BR = _mkTag("text", "line-break") @@ -503,9 +503,8 @@ class ToOdt(Tokenizer): etree.SubElement(xMani, mFile, attrib={mPath: "styles.xml", mType: "text/xml"}) oRoot = _mkTag("office", "document-settings", nsMap=OFFICE_NS) - oSett = _mkTag("office", "settings", nsMap=OFFICE_NS) - xSett = etree.Element(oRoot, nsmap=OFFICE_NS) - etree.SubElement(xSett, oSett) + oVers = _mkTag("office", "version", nsMap=OFFICE_NS) + xSett = etree.Element(oRoot, nsmap=OFFICE_NS, attrib={oVers: X_VERS}) with ZipFile(savePath, mode="w") as outFile: outFile.writestr("mimetype", X_MIME)