summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-09-03 21:56:07 +0800
committerMark Hung <marklh9@gmail.com>2018-09-04 18:15:34 +0200
commit6db1448eaa30ac7e2ebc64ad561b1d4a2c6e4ff2 (patch)
treedc9b05b0ce9f5adbffe0afaef5d1bfed35448f1b
parent8d7b1f2e7c13a1ebcf6dfa2afed80f1df6d2565d (diff)
tdf#119629 Fix keytime formula and missing effect node type.
1. Don't override keytime formula value if already read. 2. MSO's effect node type Click parallel node, with group node, after group node were missing, now mapping to ON_CLICK, WITH_PREVIOUS, AFTER_PREVIOUS correspondingly. Change-Id: Id81d6c8597f4de58a7face3f013fcd7a36bb0fd9 Reviewed-on: https://gerrit.libreoffice.org/59940 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r--sd/qa/unit/data/ppt/tdf119629.pptbin0 -> 112128 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx22
-rw-r--r--sd/source/filter/ppt/pptanimations.hxx4
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx5
4 files changed, 30 insertions, 1 deletions
diff --git a/sd/qa/unit/data/ppt/tdf119629.ppt b/sd/qa/unit/data/ppt/tdf119629.ppt
new file mode 100644
index 000000000000..b9c90e916fff
--- /dev/null
+++ b/sd/qa/unit/data/ppt/tdf119629.ppt
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index b17fb213c5b1..3e5bd8ef3bfb 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -102,6 +102,7 @@ public:
void testTdf115394PPT();
void testBulletsAsImage();
void testTdf113818();
+ void testTdf119629();
void testTdf113822();
CPPUNIT_TEST_SUITE(SdExportTest);
@@ -130,6 +131,7 @@ public:
CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testBulletsAsImage);
CPPUNIT_TEST(testTdf113818);
+ CPPUNIT_TEST(testTdf119629);
CPPUNIT_TEST(testTdf113822);
CPPUNIT_TEST_SUITE_END();
@@ -1137,6 +1139,26 @@ void SdExportTest::testTdf113818()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf119629()
+{
+ utl::TempFile tempFile;
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf119629.ppt"), PPT);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPT);
+ xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
+
+ xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
+
+ // MSO's effect node type Click parallel node, with group node, after group node
+ // were missing.
+ assertXPath(pXmlDoc, "//draw:page"
+ "/anim:par[@presentation:node-type='timing-root']"
+ "/anim:seq[@presentation:node-type='main-sequence']"
+ "/anim:par[@presentation:node-type='on-click']"
+ "/anim:par[@presentation:node-type='with-previous']"
+ "/anim:par[@presentation:node-type='on-click']"
+ "/anim:animate[@anim:formula='width*sin(2.5*pi*$)']", 1);
+ xDocShRef->DoClose();
+}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
diff --git a/sd/source/filter/ppt/pptanimations.hxx b/sd/source/filter/ppt/pptanimations.hxx
index 8de13b56d090..f9d5fa5479a3 100644
--- a/sd/source/filter/ppt/pptanimations.hxx
+++ b/sd/source/filter/ppt/pptanimations.hxx
@@ -125,11 +125,15 @@ namespace ppt
#define DFF_ANIM_PRESS_CLASS_OLE_ACTION 5
#define DFF_ANIM_PRESS_CLASS_MEDIACALL 6
+// Effect node type.
#define DFF_ANIM_NODE_TYPE_ON_CLICK 1
#define DFF_ANIM_NODE_TYPE_WITH_PREVIOUS 2
#define DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS 3
#define DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE 4
#define DFF_ANIM_NODE_TYPE_INTERACTIVE_SEQ 5
+#define DFF_ANIM_NODE_TYPE_CLICK_PARALLEL 6
+#define DFF_ANIM_NODE_TYPE_WITH_GROUP 7
+#define DFF_ANIM_NODE_TYPE_AFTER_GROUP 8
#define DFF_ANIM_NODE_TYPE_TIMING_ROOT 9
/* constants for fill entry in AnimationNode */
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 18c3b82988f4..8e553159d968 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -673,8 +673,11 @@ void AnimationImporter::fillNode( Reference< XAnimationNode > const & xNode, con
sal_Int16 nNodeType = css::presentation::EffectNodeType::DEFAULT;
switch( nPPTNodeType )
{
+ case DFF_ANIM_NODE_TYPE_CLICK_PARALLEL: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_ON_CLICK: nNodeType = css::presentation::EffectNodeType::ON_CLICK; break;
+ case DFF_ANIM_NODE_TYPE_WITH_GROUP: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_WITH_PREVIOUS: nNodeType = css::presentation::EffectNodeType::WITH_PREVIOUS; break;
+ case DFF_ANIM_NODE_TYPE_AFTER_GROUP: SAL_FALLTHROUGH;
case DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS: nNodeType = css::presentation::EffectNodeType::AFTER_PREVIOUS; break;
case DFF_ANIM_NODE_TYPE_MAIN_SEQUENCE: nNodeType = css::presentation::EffectNodeType::MAIN_SEQUENCE; break;
case DFF_ANIM_NODE_TYPE_TIMING_ROOT: nNodeType = css::presentation::EffectNodeType::TIMING_ROOT; break;
@@ -2151,7 +2154,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
if( pValue && pValue->getType() == DFF_msofbtAnimAttributeValue )
{
// Any occurrence of the formula becomes the formula of the whole list.
- if (importAttributeValue(pValue, aValue2))
+ if (importAttributeValue(pValue, aValue2) && aFormula.isEmpty())
aValue2 >>= aFormula;
}
aValues[nKeyTime] = aValue1;