oox/source/export/shapes.cxx | 2 +- sd/qa/unit/data/odp/tdf170166.odp |binary sd/qa/unit/export-tests-ooxml4.cxx | 21 +++++++++++++++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 22 +++++++++------------- 4 files changed, 31 insertions(+), 14 deletions(-)
New commits: commit 415c7e04dc6a4a1638a63bf7195c8319b1cb8f85 Author: Balazs Varga <[email protected]> AuthorDate: Mon Dec 29 16:02:04 2025 +0100 Commit: Aron Budea <[email protected]> CommitDate: Wed Dec 31 03:37:25 2025 +0100 tdf#170166: sd ooxml export: fix bullets in subtitle presobj Properly export of Subtitles as presObj was missed with this commit: 238cfa9efa21f08514703ea6cc181ce02d8feb12 Such as missing '<a:buNone/>' attributes in slides/slide1.xml But still keep not to export subtitle presboj into masterslide.xml which still would cause corrupt xml when opening in mso. regression after: ef32ba978d7be844440ee0d9c78ad37128b35512 Change-Id: I4f3e069ad1ade5bbcfa50f9096539c882c66e0b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196308 Tested-by: Jenkins Reviewed-by: Aron Budea <[email protected]> diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 3b20157f2988..a7a35440871b 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2189,7 +2189,7 @@ constexpr auto constMap = frozen::make_unordered_map<std::u16string_view, ShapeC { u"com.sun.star.presentation.OutlinerShape", &ShapeExport::WriteTextShape }, { u"com.sun.star.presentation.SlideNumberShape", &ShapeExport::WriteTextShape }, { u"com.sun.star.presentation.TitleTextShape", &ShapeExport::WriteTextShape }, - //{ u"com.sun.star.presentation.SubtitleShape", &ShapeExport::WriteTextShape }, TODO: handle subtitle shape: see tdf#112557 workaround + { u"com.sun.star.presentation.SubtitleShape", &ShapeExport::WriteTextShape } }); } // end anonymous namespace diff --git a/sd/qa/unit/data/odp/tdf170166.odp b/sd/qa/unit/data/odp/tdf170166.odp new file mode 100644 index 000000000000..78d9412867f0 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf170166.odp differ diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index 9c0a15915f2c..5ff3d1ae11ef 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -1645,6 +1645,27 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextAlignLeft) assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr", "algn", u"l"); } +CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testSubtitleNoBullets) +{ + createSdImpressDoc("odp/tdf170166.odp"); + saveAndReload(TestFilter::PPTX); + + const SdrPage* pPage1 = GetPage(1); + { + // subtitle placeholder object + SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage1->GetObj(0)); + CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong object type!", SdrObjKind::Text, + pTxtObj->GetObjIdentifier()); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); + // Without a fix, it will fail with numbering type: SVX_NUM_CHAR_SPECIAL + CPPUNIT_ASSERT(pNumFmt); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's numbering type is wrong!", SVX_NUM_NUMBER_NONE, + pNumFmt->GetNumRule().GetLevel(0).GetNumberingType()); + } +} + CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testOLEObjectAnimationTarget) { createSdImpressDoc("pptx/tdf169088.pptx"); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 9fdf97b0a79e..05161ab133a3 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -355,12 +355,16 @@ ShapeExport& PowerPointShapeExport::WriteTextShape(const Reference< XShape >& xS if (!WritePlaceholder(xShape, Title, mbMaster)) ShapeExport::WriteTextShape(xShape); } - /*else if (sShapeType == "com.sun.star.presentation.SubtitleShape") + else if (sShapeType == "com.sun.star.presentation.SubtitleShape") { - TODO: handle subtitle shape: see tdf#112557 workaround - if (!WritePlaceholder(xShape, Subtitle, mbMaster)) - ShapeExport::WriteTextShape(xShape); - }*/ + // TODO: handle subtitle shape: see tdf#112557 workaround + // MSO does not like subtitles on master slides + if (mePageType != MASTER) + { + if (!WritePlaceholder(xShape, Subtitle, mbMaster)) + ShapeExport::WriteTextShape(xShape); + } + } else SAL_WARN("sd.eppt", "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored"); @@ -377,14 +381,6 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape(const Reference< XShape >& { WritePageShape(xShape, mePageType, mrExport.GetPresObj()); } - else if (sShapeType == "com.sun.star.presentation.SubtitleShape") - { - if(mePageType != MASTER) - { - if (!WritePlaceholder(xShape, Subtitle, mbMaster)) - ShapeExport::WriteTextShape(xShape); - } - } else SAL_WARN("sd.eppt", "unknown shape not handled: " << sShapeType.toUtf8());
