sw/qa/extras/ooxmlexport/ooxmlexport20.cxx |    2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx  |    2 +-
 sw/source/filter/ww8/docxsdrexport.cxx     |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f44401b6dcfb2303b5f714ee9b02cdc88e3e7abd
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Oct 27 13:46:24 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Oct 29 15:57:40 2025 +0100

    mso-test: remove unnecessary ID attribute from PICT shape
    
    when loading and then saving the document from tdf#91061, we end up with a 
ID element,
    which is not part of the specified format, which causes ms-office to think 
the document is corrupt
    
    Couple of unit tests which needed to be tweaked, but neither
    one appears to related specifically to the now removed "ID" attribute,
    the tests where just using that attribute as a convenient handle.
    
    Change-Id: I6c9b54a5a42d530d6c1bc75858d6c55563f778e1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193036
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
index 789028c180bf..cec10a22c424 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -829,7 +829,7 @@ CPPUNIT_TEST_FIXTURE(Test, testKDE302504)
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
-    assertXPath(pXmlDoc, "//v:shape", "ID", u"KoPathShape");
+    assertXPath(pXmlDoc, "//v:shape", "id", u"shape_0");
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testKDE216114)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 85ebb3da58ff..24a80e22d538 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79591)
     xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
 
     assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr",
 "name", u"_x0000_t0");
-    assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", 
"ID", u"_x0000_t0");
+    assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", 
"id", u"shape_0");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx")
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 1936504bad32..ce62953b5b55 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1358,6 +1358,7 @@ void DocxSdrExport::endDMLAnchorInline(const 
SwFrameFormat* pFrameFormat)
 
 void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const 
SwFrameFormat& rFrameFormat)
 {
+    m_pImpl->getExport().VMLExporter().SetSkipwzName(true);
     m_pImpl->getSerializer()->startElementNS(XML_w, XML_pict);
     m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer());
     // See WinwordAnchoring::SetAnchoring(), these are not part of the 
SdrObject, have to be passed around manually.
@@ -1372,6 +1373,7 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* 
sdrObj, const SwFrameFormat
         *sdrObj, rFlow.GetValue(), rHoriOri.GetHoriOrient(), 
rVertOri.GetVertOrient(),
         rHoriOri.GetRelationOrient(), rVertOri.GetRelationOrient(), 
pAttrList.get(), true);
     m_pImpl->getSerializer()->endElementNS(XML_w, XML_pict);
+    m_pImpl->getExport().VMLExporter().SetSkipwzName(false);
 }
 
 static bool lcl_isLockedCanvas(const uno::Reference<drawing::XShape>& xShape)

Reply via email to