diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-13 20:57:52 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-22 10:31:21 +0100 |
commit | c33ec20ebadcc957b4fbbaf0267bed17efda97cd (patch) | |
tree | e318a5671ba672612452002f3ec44fc666ba653a | |
parent | 6a9a239a1ce799275b8b6eab49ec06b51894f5eb (diff) |
tdf#104792 Double check for target shape
Change-Id: Ibe23377c7752d9ce97c7b100af4b2759b3ce946f
Reviewed-on: https://gerrit.libreoffice.org/51241
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51410
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | oox/source/ppt/animationspersist.cxx | 10 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx | bin | 0 -> 41239 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 16 |
3 files changed, 24 insertions, 2 deletions
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx index 94cdd9672e39..ac93174bc4ac 100644 --- a/oox/source/ppt/animationspersist.cxx +++ b/oox/source/ppt/animationspersist.cxx @@ -141,8 +141,14 @@ namespace oox { namespace ppt { sShapeName = maShapeTarget.msSubShapeId; Any rTarget; - ::oox::drawingml::ShapePtr pShape = pSlide->getShape(sShapeName); - SAL_WARN_IF( !pShape, "oox.ppt", "failed to locate Shape"); + ::oox::drawingml::ShapePtr pShape = pSlide->getShape( sShapeName ); + SAL_WARN_IF( !pShape, "oox.ppt", "failed to locate Shape" ); + + if( !pShape && maShapeTarget.mnType == XML_dgm ) + { + pShape = pSlide->getShape( msValue ); + } + if( pShape ) { Reference< XShape > xShape( pShape->getXShape() ); diff --git a/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx b/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx Binary files differnew file mode 100644 index 000000000000..ac72639efd77 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index c998c45c6709..14cb434926a7 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -111,6 +111,8 @@ public: void testGroupsRotatedPosition(); void testAccentColor(); void testTdf114848(); + /// SmartArt animated elements + void testTdf104792(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -143,6 +145,7 @@ public: CPPUNIT_TEST(testGroupsRotatedPosition); CPPUNIT_TEST(testAccentColor); CPPUNIT_TEST(testTdf114848); + CPPUNIT_TEST(testTdf104792); CPPUNIT_TEST_SUITE_END(); @@ -908,6 +911,19 @@ void SdOOXMLExportTest2::testTdf114848() assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "1f497d"); } +void SdOOXMLExportTest2::testTdf104792() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[1]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:set/p:cBhvr/p:tgtEl/p:spTgt", 1); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |