Kaydet (Commit) 238cfa9e authored tarafından Tamás Zolnai's avatar Tamás Zolnai

tdf#112557: Subtitle placeholder shape leads to corrupted PPTX file

Change-Id: I26680ecdb5f0db4f27180c221de062341af0265c
Reviewed-on: https://gerrit.libreoffice.org/42611Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 7320a375
......@@ -110,6 +110,7 @@ public:
void testTdf112088();
void testTdf112333();
void testTdf112552();
void testTdf112557();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
......@@ -147,6 +148,7 @@ public:
CPPUNIT_TEST(testTdf112088);
CPPUNIT_TEST(testTdf112333);
CPPUNIT_TEST(testTdf112552);
CPPUNIT_TEST(testTdf112557);
CPPUNIT_TEST_SUITE_END();
......@@ -1115,6 +1117,18 @@ void SdOOXMLExportTest2::testTdf112552()
xDocShRef->DoClose();
}
void SdOOXMLExportTest2::testTdf112557()
{
// Subtitle shape should be skipped by export.
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf112557.odp"), ODP);
utl::TempFile tempFile;
xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
assertXPath(pXmlDocContent, "/p:sldMaster/p:cSld/p:spTree/p:sp", 2); // title and object
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -322,8 +322,11 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape(const Reference< XShape >&
}
else if (sShapeType == "com.sun.star.presentation.SubtitleShape")
{
if (!WritePlaceholder(xShape, Subtitle, mbMaster))
ShapeExport::WriteTextShape(xShape);
if(mePageType != MASTER)
{
if (!WritePlaceholder(xShape, Subtitle, mbMaster))
ShapeExport::WriteTextShape(xShape);
}
}
else
SAL_WARN("sd.eppt", "unknown shape not handled: " << USS(sShapeType));
......@@ -2035,7 +2038,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro
pFS->startElementNS(XML_p, XML_cSld, FSEND);
ImplWriteBackground(pFS, aXBackgroundPropSet);
WriteShapeTree(pFS, LAYOUT, true);
WriteShapeTree(pFS, MASTER, true);
pFS->endElementNS(XML_p, XML_cSld);
......@@ -2199,7 +2202,7 @@ void PowerPointExport::WriteShapeTree(const FSHelperPtr& pFS, PageType ePageType
ShapeExport& PowerPointShapeExport::WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj)
{
if ((ePageType == NOTICE && bPresObj) || ePageType == LAYOUT)
if ((ePageType == NOTICE && bPresObj) || ePageType == LAYOUT || ePageType == MASTER)
return WritePlaceholderShape(xShape, SlideImage);
return WriteTextShape(xShape);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment