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";