sd/qa/unit/data/pptx/multiplelayoutfooter.pptx |binary sd/qa/unit/export-tests-ooxml4.cxx | 24 ++++++++++++++++++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 9 --------- 3 files changed, 24 insertions(+), 9 deletions(-)
New commits: commit c9351ed558b66f2c986c7d240185c09798167071 Author: Jaume Pujantell <[email protected]> AuthorDate: Wed Nov 19 09:15:38 2025 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Mon Dec 8 11:51:36 2025 +0100 sd: pptx: fix footer moving places for MSO In a pptx file with a slide master that has multiple slide layouts, the footer would loose properties when saved in LO and opened in MSO. This is due to the master de-duplicating logic that in trying to emulate pptx's natural way of dealing with master and layout slide it treats multiple Impress masters as equivalent. This is needed for most export functions, but when exporting an element from an Impress slide that references an Impress master (like a footer), we need to differentiate exactly which one of the equivalent masters it comes from to make the indices match. Change-Id: I815c3db54256d934b69108c7268f6d7642c33cbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194190 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195216 Tested-by: Miklos Vajna <[email protected]> diff --git a/sd/qa/unit/data/pptx/multiplelayoutfooter.pptx b/sd/qa/unit/data/pptx/multiplelayoutfooter.pptx new file mode 100644 index 000000000000..9536e13a6e07 Binary files /dev/null and b/sd/qa/unit/data/pptx/multiplelayoutfooter.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index ce587ebf507f..335a8b527cc4 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -1520,6 +1520,30 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextStylesXML) u"6000"); } +CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testFooterIdxConsistency) +{ + createSdImpressDoc("pptx/multiplelayoutfooter.pptx"); + save(u"Impress Office Open XML"_ustr); + + // slide1 points to slideLayout2 + xmlDocUniquePtr pRelsDoc = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); + assertXPath(pRelsDoc, + "/rels:Relationships/rels:Relationship[@Type='http://" + "schemas.openxmlformats.org/officeDocument/2006/" + "relationships/slideLayout']", + "Target", u"../slideLayouts/slideLayout2.xml"); + + // And they agree on the idx of the footer: + xmlDocUniquePtr pSlide = parseExport(u"ppt/slides/slide1.xml"_ustr); + OUString aFtrIdx = getXPath(pSlide, "//p:sp/p:nvSpPr/p:nvPr/p:ph", "idx"); + xmlDocUniquePtr pLayout = parseExport(u"ppt/slideLayouts/slideLayout2.xml"_ustr); + assertXPath(pLayout, "//p:sp/p:nvSpPr/p:nvPr/p:ph", "idx", aFtrIdx); + // Without the fix it fails with: + // - Expected: 1 + // - Actual : 2 + // - In <>, attribute 'idx' of '//p:sp/p:nvSpPr/p:nvPr/p:ph' incorrect value. +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 9df144934297..0f9eb7ed4272 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -2983,15 +2983,6 @@ Reference<XShape> PowerPointExport::GetReferencedPlaceholderXShape(const Placeho { pPage = &SdPage::getImplementation(mXDrawPage)->TRG_GetMasterPage(); } - for (sal_uInt32 i = 0; i < mnMasterPages; i++) - { - if (maMastersLayouts[i].first == pPage) - { - if (maEquivalentMasters[i] < mnMasterPages) - pPage = maMastersLayouts[maEquivalentMasters[i]].first; - break; - } - } SdPage* pMasterPage = dynamic_cast<SdPage*>(pPage); if (SdrObject* pMasterFooter = (pMasterPage ? pMasterPage->GetPresObj(ePresObjKind) : nullptr))
