summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-09-22 16:12:06 +0200
committerAndras Timar <andras.timar@collabora.com>2017-09-23 16:20:01 +0200
commit65b7634ac5074aaef9b80028e4953f04270a3c3e (patch)
tree3315c9829746e75aec91d74dbe3c4dc021960c45
parenttdf#112552: Shape's gray background is lost after saving to PPTX (diff)
downloadcore-65b7634ac5074aaef9b80028e4953f04270a3c3e.tar.gz
core-65b7634ac5074aaef9b80028e4953f04270a3c3e.zip
tdf#112557: Subtitle placeholder shape leads to corrupted PPTX file
Reviewed-on: https://gerrit.libreoffice.org/42611 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 238cfa9efa21f08514703ea6cc181ce02d8feb12) Change-Id: I26680ecdb5f0db4f27180c221de062341af0265c Reviewed-on: https://gerrit.libreoffice.org/42651 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rwxr-xr-xsd/qa/unit/data/odp/tdf112557.odpbin0 -> 12749 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx14
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx11
3 files changed, 21 insertions, 4 deletions
diff --git a/sd/qa/unit/data/odp/tdf112557.odp b/sd/qa/unit/data/odp/tdf112557.odp
new file mode 100755
index 000000000000..5587e7fcef82
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf112557.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 0cea10d65a8f..13accd5e5c13 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -108,6 +108,7 @@ public:
void testTdf106867();
void testTdf112280();
void testTdf112552();
+ void testTdf112557();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -139,6 +140,7 @@ public:
CPPUNIT_TEST(testTdf106867);
CPPUNIT_TEST(testTdf112280);
CPPUNIT_TEST(testTdf112552);
+ CPPUNIT_TEST(testTdf112557);
CPPUNIT_TEST_SUITE_END();
@@ -872,6 +874,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();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7557a73e5a4d..5d59edfebda0 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -310,8 +310,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));
@@ -1911,7 +1914,7 @@ void PowerPointExport::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPr
pFS->startElementNS( XML_p, XML_cSld, FSEND );
ImplWriteBackground( pFS, aXBackgroundPropSet );
- WriteShapeTree( pFS, LAYOUT, true );
+ WriteShapeTree( pFS, MASTER, true );
pFS->endElementNS( XML_p, XML_cSld );
@@ -2068,7 +2071,7 @@ void PowerPointExport::WriteShapeTree( const FSHelperPtr& pFS, PageType ePageTyp
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 );