xmloff/qa/unit/draw.cxx            |    7 +++----
 xmloff/source/draw/shapeexport.cxx |    8 ++++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 34c4a18d78b0b8a2eb2bc4376190d894b8c3d6f4
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Sep 2 17:50:50 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Sep 24 14:50:36 2024 +0200

    tdf#162686: Adapt to ODF 1.4
    
    Change-Id: I47f29a88eb0e98dc0fd312a3895d3a578fa04d46
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172768
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index f81df002c4ae..85ac46936eb8 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -555,16 +555,15 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionMetalTypeStrict)
 {
     loadFromFile(u"tdf145700_3D_metal_type_MSCompatible.doc");
 
-    // save ODF 1.3 strict and test, that new attribute is not written. Adapt 
when attribute is
-    // added to ODF.
+    // save ODF 1.4 strict and test that new attribute is written.
     const SvtSaveOptions::ODFDefaultVersion 
nCurrentODFVersion(GetODFDefaultVersion());
-    SetODFDefaultVersion(SvtSaveOptions::ODFVER_013);
+    SetODFDefaultVersion(SvtSaveOptions::ODFVER_014);
     save(u"writer8"_ustr);
 
     // assert XML.
     xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
     assertXPath(pXmlDoc, "//draw:enhanced-geometry"_ostr, 
"extrusion-metal"_ostr, u"true"_ustr);
-    assertXPath(pXmlDoc, 
"//draw:enhanced-geometry[@loext:extrusion-metal-type]"_ostr, 0);
+    assertXPath(pXmlDoc, 
"//draw:enhanced-geometry[@draw:extrusion-metal-type]"_ostr, 1);
 
     SetODFDefaultVersion(nCurrentODFVersion);
 }
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 65709b7bfba3..99e7e916cf4d 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -4604,8 +4604,12 @@ static void ImpExportEnhancedGeometry( SvXMLExport& 
rExport, const uno::Referenc
                                         if (rProp.Value >>= eMetalType)
                                         {
                                             
SvtSaveOptions::ODFSaneDefaultVersion eVersion = 
rExport.getSaneDefaultVersion();
-                                            if (eVersion > 
SvtSaveOptions::ODFSVER_013
-                                                && (eVersion & 
SvtSaveOptions::ODFSVER_EXTENDED))
+                                            if (eVersion >= 
SvtSaveOptions::ODFSVER_014)
+                                            {
+                                                aStr = "draw:MetalODF";
+                                                
rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_EXTRUSION_METAL_TYPE, aStr);
+                                            }
+                                            else if (eVersion & 
SvtSaveOptions::ODFSVER_EXTENDED)
                                             {
                                                 if (eMetalType == 
drawing::EnhancedCustomShapeMetalType::MetalMSCompatible)
                                                     aStr = 
"loext:MetalMSCompatible";

Reply via email to