summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-03-13 20:57:52 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2018-03-14 15:18:56 +0100
commit7c354d1bf1ca29a5ae9ee9d6f18dd68b90530043 (patch)
treebcf46554170a392be70e36ff0272f108ed734db0
parent7a9a3c8941d9ebcf7660e622325c8ac28610571d (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>
-rw-r--r--oox/source/ppt/animationspersist.cxx10
-rw-r--r--sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptxbin0 -> 41239 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx16
3 files changed, 24 insertions, 2 deletions
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index cd14fe43b374..2c1aaa2c88c7 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
new file mode 100644
index 000000000000..ac72639efd77
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 9fb9d4ab6ff0..765ca29269ea 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -133,6 +133,8 @@ public:
void testTdf115394Zero();
void testBulletsAsImage();
void testTdf111789();
+ /// SmartArt animated elements
+ void testTdf104792();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -191,6 +193,7 @@ public:
CPPUNIT_TEST(testTdf115394Zero);
CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST(testTdf111789);
+ CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST_SUITE_END();
@@ -1538,6 +1541,19 @@ void SdOOXMLExportTest2::testTdf111789()
xDocShRef->DoClose();
}
+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();